diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3d04df38..3e6eb4eba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,13 +97,12 @@ jobs: - database: mssql container: mssql db_url: "mssql://root:Password123!@127.0.0.1/sqlpage" - - database: odbc - container: postgres - db_url: "Driver=PostgreSQL Unicode;Server=127.0.0.1;Port=5432;Database=sqlpage;UID=root;PWD=Password123!" - setup_odbc: true - database: oracle container: oracle db_url: "Driver=Oracle 21 ODBC driver;Dbq=//127.0.0.1:1521/FREEPDB1;Uid=root;Pwd=Password123!" + - database: duckdb + container: "" + db_url: "Driver=DuckDB;Database=/tmp/sqlpage-test.duckdb" steps: - uses: actions/checkout@v7 # Reuse the exact Linux test harnesses produced by compile_and_lint. @@ -118,9 +117,11 @@ jobs: run: | mkdir -p target/sqlpage-test-binaries tar -xzf target/sqlpage-linux-test-binaries.tar.gz -C target/sqlpage-test-binaries - - name: Install PostgreSQL ODBC driver - if: matrix.setup_odbc - run: sudo apt-get install -y odbc-postgresql + - name: Install DuckDB ODBC driver + if: matrix.database == 'duckdb' + run: | + sudo apt-get update && sudo apt-get install -y unixodbc unzip + sudo scripts/install-duckdb-odbc.sh - name: Install Oracle ODBC driver if: matrix.database == 'oracle' run: | diff --git a/AGENTS.md b/AGENTS.md index b60e9add5..6448e0b28 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -118,7 +118,7 @@ docker compose up --wait mssql # or postgres, mysql, mariadb, oracle DATABASE_URL='mssql://root:Password123!@localhost/sqlpage' cargo test ``` -ODBC tests require the database-specific ODBC driver on the host; starting the container is not sufficient. See the PostgreSQL ODBC and Oracle matrix entries in [CI](./.github/workflows/ci.yml) for driver setup and connection strings. On Linux and macOS, `cargo test --features odbc-static` matches CI's static unixODBC linking. +ODBC tests require the database-specific ODBC driver on the host; starting the container is not sufficient. See the Oracle and DuckDB matrix entries in [CI](./.github/workflows/ci.yml) for driver setup and connection strings. On Linux and macOS, `cargo test --features odbc-static` matches CI's static unixODBC linking. For dynamic frontend changes, run the Playwright tests under `tests/end-to-end/` as described in [CONTRIBUTING.md](./CONTRIBUTING.md). Component browser tests belong in `tests/end-to-end/fixtures//{index.sql,test.ts}` and must import the shared `fixture.ts` harness. Exercise components through SQL fixtures and normal page initialization; do not inject synthetic component DOM or call private initialization functions. Prefer Playwright locators and web-first assertions. For examples containing `test.hurl`, run `scripts/test-examples-hurl.sh `. diff --git a/docker-compose.yml b/docker-compose.yml index 463a297e2..677996dde 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,8 +4,8 @@ # DATABASE_URL='postgres://root:Password123!@localhost/sqlpage' # DATABASE_URL='mssql://root:Password123!@localhost/sqlpage' # DATABASE_URL='mysql://root:Password123!@localhost/sqlpage' -# DATABASE_URL='Driver={/usr/lib64/psqlodbcw.so};Server=127.0.0.1;Port=5432;Database=sqlpage;UID=root;PWD=Password123!' # DATABASE_URL='Driver=Oracle 21 ODBC driver;Dbq=//127.0.0.1:1521/FREEPDB1;Uid=root;Pwd=Password123!' +# DATABASE_URL='Driver=DuckDB;Database=/tmp/sqlpage-test.duckdb' # Run for instance: # docker compose up postgres diff --git a/tests/sql_test_files/data/variable_comparison_without_type_context.sql b/tests/sql_test_files/data/variable_comparison_without_type_context.sql index 1027f8348..d2b7d5172 100644 --- a/tests/sql_test_files/data/variable_comparison_without_type_context.sql +++ b/tests/sql_test_files/data/variable_comparison_without_type_context.sql @@ -1,3 +1,3 @@ --- Context-free variables (no column or literal) need CAST on SQLite and psqlodbc +-- Context-free variables (no column or literal) need CAST on SQLite SET other = 'other'; select 'It works !' as expected, 'It works !' as actual where $x <> $other or $x is null;