Add SQL dialect support to StatementOptions#44
Merged
Conversation
Add dialect getter/setter to StatementOptions with SQL_DIALECT_CURRENT as the default, preserving backward compatibility. Uses options.getDialect() in Statement constructor instead of the hardcoded SQL_DIALECT_CURRENT constant. Closes asfernandes#42 (REQ-1).
This was referenced Mar 12, 2026
asfernandes
reviewed
Mar 12, 2026
asfernandes
reviewed
Mar 12, 2026
7fcb0f5 to
79043eb
Compare
…ic-as-double behavior In SQL dialect 1, NUMERIC(18,2) columns are described as DOUBLE PRECISION instead of scaled integers. The updated test inserts a value into a NUMERIC(18,2) table column, then selects it using s dialect-1-prepared statement and verifies that getDouble() retrieves the correct value, exercising the dialect-specific type mapping.
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.
Adds a configurable SQL dialect to
StatementOptions, addressing REQ-1 from #42.Problem
Statementconstructor hardcodesSQL_DIALECT_CURRENT(dialect 3) in the call toIAttachment::prepare(). The ODBC driver needs to support legacy Firebird databases running in dialect 1 (InterBase compatibility mode), whereNUMERIC/DECIMALtypes map toDOUBLE PRECISIONand quoted identifiers behave differently.Changes
StatementOptions: Addeddialectfield (default:SQL_DIALECT_CURRENT) withgetDialect()/setDialect(unsigned)fluent API.Statementconstructor: Replaced hardcodedSQL_DIALECT_CURRENTwithoptions.getDialect().Impact
SQL_DIALECT_CURRENT(3).