Skip to content

feat(go): Oracle, MySQL/MariaDB, SQL Server, Redis and Cassandra drivers - #44

Merged
FabioHAraujo merged 2 commits into
mainfrom
feat/go-wails-phase2
Dec 4, 2026
Merged

FabioHAraujo merged 2 commits into
mainfrom
feat/go-wails-phase2

Conversation

@FabioHAraujo

Copy link
Copy Markdown
Contributor

Phase 2 of the Go + Wails rewrite. Stacked on the phase 1 PR (feat/go-wails-rewrite); review that one first.

Ports the remaining drivers from src-tauri/src/drivers to Go, one package each under internal/drivers, wired into openSession. Each implements drivers.Session like the SQLite and PostgreSQL ports.

Engine Library Notes
Oracle sijms/go-ora/v2 (pure Go) Service, SID, TNS alias, descriptor and Easy Connect; admin privileges; DBMS_OUTPUT as notices; cancel now interrupts the running statement (Rust stopped before the next one). oracle_tns_sources / oracle_tns_folder port tns.rs (TNS_ADMIN, ORACLE_HOME, registry, PATH, IFILE, default domain).
MySQL / MariaDB go-sql-driver/mysql The driver dials, negotiates TLS and authenticates; the session then speaks the protocol itself, because the driver discards column origins (editability), status flags (transaction state), warning counts and "Rows matched". A guard refuses to connect if a driver upgrade changes the internals it relies on. Cancel via KILL QUERY.
SQL Server microsoft/go-mssqldb Named instances through SQL Browser, Windows authentication (Windows only), cancel via TDS attention. New: PRINT/RAISERROR come back as notices.
Redis / Valkey redis/go-redis/v9 RESP3 replies parsed from raw bytes to keep order and types; cancel via CLIENT UNBLOCK.
Cassandra apache/cassandra-gocql-driver/v2 Statements sent unprepared at LOCAL_ONE; USE reconnects with the keyspace (gocql refuses USE).

Known differences from the Rust drivers

  • Oracle:
    • Native JSON columns fail (go-ora cannot decode them).
    • INTERVAL DAY TO SECOND keeps microseconds.
    • Wallets are not loaded.
  • SQL Server: reads one unexported go-mssqldb field to detect the start of a result set. TestReadsDriverState fails if an upgrade renames it.
  • Cassandra: a NULL tuple and a tuple of nulls both show as NULL.
  • verify-full: uses the system roots only. Rust also bundled webpki roots.

Testing

  • Unit tests that need no server, including fake RESP and MySQL servers that cover handshakes, cancel and edits:

    Driver Tests
    Oracle 33
    MySQL 17
    SQL Server 22
    Redis 15
    Cassandra 22
  • Integration tests: they mirror the Rust ones, plus the view and DDL fixtures for each dialect. They skip without LQ_<ENGINE>_*. CI now runs them in the existing Oracle, MySQL/MariaDB, SQL Server, Redis/Valkey and Cassandra jobs. This PR is their first run against real servers.

  • In the app: test_connection for every new engine reaches its driver and fails fast with a connection error on a closed port. The TNS commands answer, and SQLite and PostgreSQL still pass.

Closes #43

Port the remaining drivers from src-tauri/src/drivers to Go, each in its
own package under internal/drivers, and connect them in openSession.

- Oracle on go-ora (pure Go): service, SID, TNS alias and descriptor
  connects, admin privileges, DBMS_OUTPUT notices, and a cancel that
  interrupts the running statement. tnsnames.ora discovery backs the
  oracle_tns_sources and oracle_tns_folder commands.
- MySQL and MariaDB: go-sql-driver dials and authenticates, then the
  session speaks the protocol itself to keep column origins, status
  flags, warnings and "Rows matched", which the driver discards.
- SQL Server on go-mssqldb: named instances, Windows authentication,
  TDS attention on cancel, and PRINT/RAISERROR as notices.
- Redis and Valkey on go-redis with RESP3 replies parsed in order.
- Cassandra on the Apache gocql driver.

CI runs each driver's tests against the same containers as the Rust
integration jobs. A SQLite test no longer fails when Windows keeps a
just-closed database file locked.

Refs #43
…vers

First run of the Oracle integration tests against XE 21c and Free 23ai.

- CLOB/NCLOB/BLOB columns were named LONG / LONG RAW, the types go-ora
  uses to fetch LOBs inline; map them back.
- DBMS_OUTPUT returned nothing: one 32767-byte out bind fails when
  MAX_STRING_SIZE is STANDARD. Read it through 4000-byte binds.
- Column defaults on servers without DATA_DEFAULT_VC (before 23ai) come
  from DATA_DEFAULT.
- go-ora does not negotiate BOOLEAN, so 23ai sends 1/0. Columns read
  from a BOOLEAN table column are shown as TRUE/FALSE again, and edits
  write true/false literals.
- Tests: expectations follow the types the server describes; the fetch
  cancel and stream queries no longer use SQL that 21c and 23ai reject.

Refs #43
@FabioHAraujo
FabioHAraujo changed the base branch from feat/go-wails-rewrite to main December 4, 2026 23:51
@FabioHAraujo
FabioHAraujo marked this pull request as ready for review December 4, 2026 23:51
@FabioHAraujo
FabioHAraujo merged commit 20d0418 into main Dec 4, 2026
20 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.

Go + Wails phase 2: Oracle, MySQL/MariaDB, SQL Server, Redis, Cassandra drivers

1 participant