Skip to content

feat(sql-util): add journal event SQL dialect helper - #4

Open
davidfrigolet wants to merge 1 commit into
masterfrom
feat/sql-util-journal-dialect-helper
Open

davidfrigolet wants to merge 1 commit into
masterfrom
feat/sql-util-journal-dialect-helper

Conversation

@davidfrigolet

Copy link
Copy Markdown
Contributor

Summary

Moves the SQL Journal Event persistence code that lived (duplicated) inside flamingock-java's community/flamingock-sql-auditstore module into this shared flamingock-sql-util module, so it's versioned and reused the same way SqlAuditorDialectHelper/SqlLockDialectHelper already are.

  • SqlJournalDialectHelper — generates portable, per-dialect DDL/DML for the journal table (create table, indexes, insert, unacknowledged-events select, acknowledge update). Lives in dialectHelpers, next to its siblings.
  • SqlJournalConstants — journal column/index names, plus the SQL-identifier validation shared by the journal store and the audit repository.
  • SqlAuditColumnNames — the fixed column-name list for the flattened AuditEntry payload embedded in each journal row (also used by flamingock-java's AuditEntryMapper).

Ported the existing dialect-coverage test suite (SqlJournalDialectHelperTest, one dialect matrix run per SqlDialect) alongside the moved code.

This is part 2 of 3 in centralizing Journal Event persistence (general-util constant, this, then flamingock-java wiring). See companion PRs:

  • flamingock/flamingock-java-general-util#TBD
  • flamingock/flamingock-java#TBD

Test plan

  • ./gradlew :flamingock-sql-util:test — full dialect matrix passes
  • ./gradlew :flamingock-sql-util:spotlessCheck — license headers pass
  • Release this module, then bump sqlVersion in flamingock-java's companion PR

Centralizes SQL Journal Event DDL/DML generation, previously duplicated
inside flamingock-java's community/flamingock-sql-auditstore module, into
this shared module so it can be reused and versioned independently.

- SqlJournalDialectHelper: portable, per-dialect journal table DDL/DML
  (create table, indexes, insert, select-unacknowledged, acknowledge),
  placed alongside the sibling SqlAuditorDialectHelper/SqlLockDialectHelper
- SqlJournalConstants: journal column/index names and SQL identifier
  validation helpers
- SqlAuditColumnNames: shared column-name list for the flattened audit
  payload embedded in each journal row
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant