Skip to content

Conversation

@daniel-skovenborg
Copy link
Contributor

Sorry, I know this is a very large pull request and that your guidelines encourage to ask before implementing new features. However, I urgently needed this feature enough to implement it, even if it will only ever live in my own fork. I am (for) now done with the task for which the code was designed and think it's ready to be adapted, if you want it.

Description

The Danish National Archives requires the database to be 1NF (exported as SIARD-DK). The following features allows exporting a database for this purpose without creating an auxiliary database.

  • Allow exporting custom views indistinguishable from tables, specifying PK's and FK's
  • Helper configuration module for normalizing array and JSON columns to tables (custom views)
  • Support database preparation statements (for creating temporary tables used in custom views)

The normalization configuration module currently has only the string pattern options implemented that I needed where my own requirements differed from what I deemed to be the proper default.

The Danish National Archives requires the database to be 1NF (exported as SIARD-DK).
The following features allows exporting a database for this purpose without creating an auxiliary database.

- Allow exporting custom views indistinguishable from tables, specifying PK's and FK's
- Helper configuration module for normalizing array and JSON columns to tables (custom views)
- Support database preparation statements (for creating temporary tables used in custom views)
@daniel-skovenborg
Copy link
Contributor Author

The code has only been tested on PostgreSQL. I believe I have written the array normalization SQL without non-standard features, though.

@luis100 luis100 requested a review from hmiguim August 2, 2024 10:44
@luis100 luis100 added the feature Issue type label Aug 2, 2024
@luis100
Copy link
Member

luis100 commented Feb 17, 2025

Hi @daniel-skovenborg, thank you for your contribution.

Could you provide more details, documentation or an example of how to use the features you've developed?

Best regards, Luis

@daniel-skovenborg
Copy link
Contributor Author

Hi @luis100,
Thanks, I'll create some documentation during quiet times at work the next couples of weeks.

@daniel-skovenborg
Copy link
Contributor Author

I've written a lengthy walkthrough. The example is tested.

export-as-1nf-walkthrough.md

@luis100
Copy link
Member

luis100 commented Feb 28, 2025

Wonderful @daniel-skovenborg we will take a look at it as soon as we can.

@daniel-skovenborg
Copy link
Contributor Author

Being back on my database export task after nearly a year I've discovered an error: I've missed referencedSchema in the new ForeignKeyConfiguration. I'll push a fix soon.

@luis100
Copy link
Member

luis100 commented Apr 30, 2025

Unfortunately we have not yet found someone available to review the developed feature and this is too large PR to accept without proper external review.

The Snyk security check of the PR reports an unrelated security issue which pertains to the com.mysql:mysql-connector-j dependency version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Issue type

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants