Skip to content

dialect(sqlite): version checks and fixes, tested with the sqlite3 CLI in Docker - #103

Merged
stbischof merged 1 commit into
eclipse-daanse:mainfrom
dbulahov:main251126_2
Nov 26, 2026
Merged

stbischof merged 1 commit into
eclipse-daanse:mainfrom
dbulahov:main251126_2

Conversation

@dbulahov

Copy link
Copy Markdown
Contributor

What does this PR do?

SQLite is embedded and serves no connection, and the JDBC driver brings
an SQLite of its own: the tests run the sqlite3 CLI of each version in
Docker (3.22.0 to 3.51.0) on the SQL the dialect writes, the dialect
built for the version the CLI reports.

DdlGenerator (dialect api):

  • supportsSchemas: whether createSchema / dropSchema write a statement; null from both where it says no

SqliteDialect:

  • supportsRenameColumn: from 3.25; 3.22 refuses RENAME COLUMN
  • supportsNullsLast, supportsNullsOrdering: from 3.30, one answer; generateOrderByNulls wrote NULLS FIRST/LAST on every version, a syntax error before 3.30, now a CASE there
  • supportsListAgg, generateListAgg: group_concat(x, sep), on every version; ORDER BY inside it from 3.44, an ordered list refused before; DISTINCT with any separator through json_group_array, as a DISTINCT aggregate takes one argument; DISTINCT in the order of another column refused
  • supportsNthValue, generateNthValueAgg: from 3.44, the n-th element of json_group_array(v ORDER BY ...), NULL past the end
  • supportsPercentileDisc/Cont, generatePercentileDisc/Cont: from 3.44, on the sorted json_group_array, core functions only; percentile_cont and ceil are in some builds only
  • supportsAddUniqueConstraint, supportsAddCheckConstraint, supportsAddForeignKeyConstraint: false, no ALTER TABLE ... ADD CONSTRAINT in any version
  • foreignKeyClause: the referenced table by its name alone; REFERENCES "main"."t" was a syntax error
  • mergeGenerator: DO NOTHING where no column is to be updated; an empty DO UPDATE SET was a syntax error
  • supportsSchemas: false, createSchema / dropSchema null; CREATE and DROP SCHEMA are syntax errors in every version
  • createTrigger: no FOR EACH STATEMENT, a syntax error in SQLite: UnsupportedOperationException, as in MySQL
  • supportsRenameTable, supportsRenameView: documented; views and triggers follow a renamed table from 3.25 only

CsvDataImporter:

  • a directory below the base is no schema where the dialect has none; on SQLite its tables go into the connection's own schema

Container tests, sqlite3 CLI in Docker:

  • SqliteCli: keinos/sqlite3 from 3.38, ubuntu:18.04 (3.22.0), alpine:3.8 (3.25.3), alpine:3.12 (3.32.1), alpine:3.14 (3.35.5), built once into images of their own name
  • SqliteRenameColumnTest, SqliteNullsOrderTest, SqliteListAggTest, SqliteNthValueTest, SqlitePercentileTest, SqliteAddConstraintTest, SqliteReturningTest (3.35), SqliteUpsertTest (3.24), SqliteSchemaTest, SqliteRenameTableTest, SqliteTriggerTest
  • SchemaStatementsTest (consistency): supportsSchemas of every dialect

…I in Docker

  SQLite is embedded and serves no connection, and the JDBC driver brings
  an SQLite of its own: the tests run the sqlite3 CLI of each version in
  Docker (3.22.0 to 3.51.0) on the SQL the dialect writes, the dialect
  built for the version the CLI reports.

  DdlGenerator (dialect api):
  - supportsSchemas: whether createSchema / dropSchema write a statement;
    null from both where it says no

  SqliteDialect:
  - supportsRenameColumn: from 3.25; 3.22 refuses RENAME COLUMN
  - supportsNullsLast, supportsNullsOrdering: from 3.30, one answer;
    generateOrderByNulls wrote NULLS FIRST/LAST on every version, a
    syntax error before 3.30, now a CASE there
  - supportsListAgg, generateListAgg: group_concat(x, sep), on every
    version; ORDER BY inside it from 3.44, an ordered list refused
    before; DISTINCT with any separator through json_group_array, as
    a DISTINCT aggregate takes one argument; DISTINCT in the order of
    another column refused
  - supportsNthValue, generateNthValueAgg: from 3.44, the n-th element
    of json_group_array(v ORDER BY ...), NULL past the end
  - supportsPercentileDisc/Cont, generatePercentileDisc/Cont: from 3.44,
    on the sorted json_group_array, core functions only; percentile_cont
    and ceil are in some builds only
  - supportsAddUniqueConstraint, supportsAddCheckConstraint,
    supportsAddForeignKeyConstraint: false, no ALTER TABLE ... ADD
    CONSTRAINT in any version
  - foreignKeyClause: the referenced table by its name alone;
    REFERENCES "main"."t" was a syntax error
  - mergeGenerator: DO NOTHING where no column is to be updated; an
    empty DO UPDATE SET was a syntax error
  - supportsSchemas: false, createSchema / dropSchema null; CREATE and
    DROP SCHEMA are syntax errors in every version
  - createTrigger: no FOR EACH STATEMENT, a syntax error in SQLite:
    UnsupportedOperationException, as in MySQL
  - supportsRenameTable, supportsRenameView: documented; views and
    triggers follow a renamed table from 3.25 only

  CsvDataImporter:
  - a directory below the base is no schema where the dialect has none;
    on SQLite its tables go into the connection's own schema

  Container tests, sqlite3 CLI in Docker:
  - SqliteCli: keinos/sqlite3 from 3.38, ubuntu:18.04 (3.22.0),
    alpine:3.8 (3.25.3), alpine:3.12 (3.32.1), alpine:3.14 (3.35.5),
    built once into images of their own name
  - SqliteRenameColumnTest, SqliteNullsOrderTest, SqliteListAggTest,
    SqliteNthValueTest, SqlitePercentileTest, SqliteAddConstraintTest,
    SqliteReturningTest (3.35), SqliteUpsertTest (3.24),
    SqliteSchemaTest, SqliteRenameTableTest, SqliteTriggerTest
  - SchemaStatementsTest (consistency): supportsSchemas of every dialect
Signed-off-by: <bulahovdenis@gmail.com>
@stbischof
stbischof merged commit 626f4ce into eclipse-daanse:main Nov 26, 2026
30 checks passed
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.

2 participants