Repository navigation
Add trexdb as a source dialect - #2579
Open
p-hoffmann wants to merge 5 commits into
Open
p-hoffmann wants to merge 5 commits into
p-hoffmann wants to merge 5 commits into
Conversation
Sources can now use dialect trexsql with a jdbc:trexsql:// connection string; the trexsql plugin provides the driver. SqlRender has no trexsql target, so TrexsqlDialect registers one at startup that reuses the patterns of the engine trexsql is built on. SqlTranslate keeps one pattern table per JVM, so cohort and characterization SQL that is translated inside libraries picks it up too.
Collaborator
|
Let's discuss this before implementation. |
The dialect is named after the database, trexdb, matching the trexdb target proposed for SqlRender (OHDSI/SqlRender#416), so the DBMSType and the SqlRender target name stay the same string. The jdbc:trexsql:// URL scheme is the driver's and is unchanged. register() now does nothing when the bundled SqlRender already has trexdb patterns, so upgrading to a SqlRender release that ships the dialect does not append a second copy.
There was a problem hiding this comment.
🟢 Approval recommended
The TrexDB source-dialect integration has no active review issues.
No open issues 🎉
What changed in this PR
Adds trexdb as a source dialect, integrating connection parsing and SQL translation into WebAPI’s existing database support.
Changes:
- Adds TrexDB to both database-type enums and routes connection parsing through the generic parser.
- Registers a SqlRender target using DuckDB patterns at startup, skipping registration when native TrexDB patterns are present.
- Adds tests for connection details, SQL translation, repeat registration, and differentiation from PostgreSQL output.
| File | Description |
|---|---|
| src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java | Tests TrexDB connection-string and credential parsing. |
| src/test/java/org/ohdsi/webapi/source/TrexdbDialectTest.java | Tests translation and registration behavior. |
| src/main/java/org/ohdsi/webapi/source/TrexdbDialect.java | Registers the TrexDB SqlRender target at startup. |
| src/main/java/org/ohdsi/webapi/common/DBMSType.java | Adds TrexDB to WebAPI database types. |
| src/main/java/org/ohdsi/webapi/arachne/datasource/util/ConnectionParamsParser.java | Selects the generic parser for TrexDB connections. |
| src/main/java/org/ohdsi/webapi/arachne/commons/types/DBMSType.java | Adds TrexDB to Arachne database types. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets a source use dialect
trexdbwith ajdbc:trexdb://host:portconnection string (driver provided by the trexsql plugin); SQL is translated through atrexdbSqlRender target registered at startup.The
trexdbdialect is proposed for SqlRender itself in OHDSI/SqlRender#416 (OHDSI/SqlRender#416); once WebAPI uses a SqlRender release that includes it, the startup registration does nothing.