Repository navigation
feat: Apache Cassandra - #29
Merged
Merged
Conversation
Adds Apache Cassandra (CQL) as a connection type, on the `scylla` native driver with TLS through rustls. Works with Cassandra 3.x, 4.x and 5.x. - Driver: contact points, port, optional user and password (keychain), default keyspace, local datacenter and TLS modes; server version from system.local; row limits through paging; server warnings as messages; Cancel stops waiting (CQL has no server-side cancel); no transactions. - Exact values: varint and decimal keep every digit, timestamp, date, time, duration, uuid, inet, blobs as hex, and collections, tuples, UDTs and Cassandra 5 vectors as CQL literals. - Schema browser from system_schema: keyspaces, tables, materialized views, types, functions, aggregates and indexes, with partition, clustering and static column markers. Show DDL builds CREATE statements from the catalog. - Grid editing for single-table SELECTs that include the whole primary key, saved as one logged batch. - Interface: engine picker, connection dialog, CQL editor mode with BEGIN BATCH ... APPLY BATCH as one statement, script splitting, identifier quoting, tree actions and DDL templates, no commit controls. - Export to SQL, CSV and JSON and import from CSV and JSON, MCP tools with a CQL statement classifier, DBeaver and DataGrip connection import. - JSON import keeps numbers exact (no rounding beyond 17 digits). - CI runs Cassandra 4.1 and 5.0 integration tests.
Merged
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.
Problem
LowQuery has no way to connect to Apache Cassandra. CQL is not SQL (no joins, no transactions, keyspaces instead of schemas, collections and UDTs as column values), so it needs its own driver and conventions, as Redis got.
Behavior
Cassandra is a new connection type, on the
scyllanative driver (MIT OR Apache-2.0, TLS through rustls, no OpenSSL). It speaks the CQL native protocol to Apache Cassandra 3.x, 4.x and 5.x.disable/prefer/require/verify-full. The status bar showsApache Cassandra <release_version>.varintanddecimalkeep every digit, floats are shortest round-trip,timestamp/date/time/duration,uuid/timeuuid,inet, blobs as0x…, counters, and collections, tuples, UDTs and Cassandra 5 vectors as valid CQL literals (a cell can be pasted back into anINSERT).max_rows + 1).BEGIN BATCH … APPLY BATCHruns as one statement.system_schema(plussystem_virtual_schemaon 4.0+): keyspaces (system ones last) → tables, materialized views, types, functions, aggregates, indexes → columns with partition/clustering/static markers. Show DDL buildsCREATEstatements from the catalog (DESCRIBEis a cqlsh command, not part of the protocol).Cassandradialect), script splitting for;,''and""quoting,$$bodies,--,//and/* */comments, and batches. CQL identifier quoting andSELECT * FROM ks.tbl LIMIT npreviews; tree actions and DDL templates that exist in CQL.SELECTthat includes the whole primary key is editable; changes are sent as one logged batch (UPDATE … WHERE <pk>,DELETE FROM … WHERE <pk>,INSERT). Otherwise the grid shows why it is read-only (missing key columns, alias, counters, views, system tables).INSERTper row, counters asUPDATE c = c + n), CSV and JSON. Imports run oneINSERTat a time with no transaction (documented).SELECT/LIST; one statement per call, batches count as one;USErefused), catalog search anddescribe_tablewith key roles.jdbc:cassandra:) are mapped.f64, so values beyond 17 digits (varint, NUMERIC, BIGINT) keep every digit for all engines.cqlsh), docs, changelog (Unreleased), README, issue template. No version bump.How it was verified
Against real servers in Docker,
cassandra:5.0(5.0.9) andcassandra:4.1, withLQ_CASSANDRA_HOST/PORT:7 passed on each version: types, limits, errors and warnings, schema/DDL round trip and streaming, result editing, ddl fixtures, cancel, MCP end-to-end (
mcp_cassandra_server) and the export/import round trip (SQL, CSV, CSV for Excel, JSON).Also checked by hand: password authentication (
PasswordAuthenticator: login works, bad and missing credentials report an authentication error and ask for the password) and TLS against a server withclient_encryption_options(preferandrequireconnect,disableis refused by the server,verify-fullrejects an unknown issuer). Those two were one-off checks, not part of the test suite.Local checks (all pass):
bun install --frozen-lockfile,bun run check(0 errors, 0 warnings),bun test(99 pass),bun run buildcargo fmt --check,cargo clippy --lib --tests -- -D warnings,cargo test --locked --lib(212 passed, 74 ignored)bun run devmock: Cassandra appears in the engine picker with its fields, the tree lists keyspaces, and a Cassandra tab has no commit controls.Not run
bun run tauri dev): only the Rust integration tests and the browser mock were exercised.cargo deny(not installed locally); the new dependencies are MIT/Apache-2.0/BSD-3-Clause.DbColumn.key_rolefield and the JSON import parser.user_defined_functions_enabled; the test skips it when the server has it off.Known limitations
list<int>where the table saysfrozen<list<int>>.verify-fullchecks the certificate chain, expiry and signatures but not the host name, because the driver connects to the addresses the cluster reports.