Skip to content

feat(starrocks): add a registry driver that browses catalogs and databases - #3939

Open
vbabenkoru wants to merge 8 commits into
TableProApp:mainfrom
vbabenkoru:starrocks-support
Open

vbabenkoru wants to merge 8 commits into
TableProApp:mainfrom
vbabenkoru:starrocks-support

Conversation

@vbabenkoru

@vbabenkoru vbabenkoru commented Oct 31, 2026 •

Copy link
Copy Markdown

Docs: TableProApp/docs#145.

Summary

  • StarRocks ships as a registry plugin, StarRocksDriverPlugin, compiled from the MySQL driver's sources the way KingbaseES is from PostgreSQL's. The bundled MySQL plugin does not list it.
  • Catalogs fill the database level (SHOW CATALOGS), a catalog's databases the schema level (SHOW DATABASES).
  • The Database field takes catalog.database. A bare name is a database in default_catalog, catalog. a catalog alone.
  • Pooled metadata connections keep that field and switch after connecting (authenticationIsDatabaseScoped), so the browsed catalog never lands in it.
  • A scope is entered in one statement: USE `catalog.database` or SET CATALOG. Re-entering the same catalog keeps the selected database.
  • The handshake reports a plain MySQL version, so the type confirms the server with SELECT current_version().
  • Columns come from information_schema.columns, which leaves out Iceberg's _file and _pos. PRI, UNI and AGG columns are the row key, DUP is not. Defaults read as SQL: 'abc', 0, CURRENT_TIMESTAMP, NULL.
  • Table status and materialized views are read in default_catalog only.
  • One SHOW TABLE STATUS parser for both engines: a negative value is unknown, and StarRocks has no index length.
  • Indexes, foreign keys, triggers, routines, events, partitions, Create Database, transactions and server-side prepare are off.
  • Keyless saves compare FLOAT as text and are not held to the row count.
  • A charset 63 string reads as text when it is UTF-8 (Iceberg VARIANT). VARBINARY arrives as BLOB and stays bytes.
  • EXPLAIN offers LOGICAL, VERBOSE and COSTS. query_timeout is capped at 259200 seconds.
  • starrocks:// URLs parse and copy.
  • An in-place database switch reads the driver's schema inside the session gate, for .bySchema and .hierarchicalSchema alike, and saves it as the last schema.
  • A reconnect restores the database before the schema.

Test plan

  • Measured on StarRocks 4.1.7 in Docker with a filesystem Iceberg catalog:
    • SET CATALOG clears the database even for the same catalog. USE `ice.idb` enters both; USE `ice`.`idb` fails with 5501.
    • In ice, SHOW TABLE STATUS FROM idb returns default_catalog.idb's tables, and information_schema.materialized_views fails with 5502.
    • DELETE on a duplicate key table reports 0 rows and removes the row. A primary key table reports the real count. DELETE ... LIMIT is a syntax error.
    • f = 1.1 misses a FLOAT holding 1.1; CONCAT(f) = '1.1' finds it. DOUBLE and JSON compare by value.
    • JSON arrives as STRING with charset 33, VARBINARY and CAST AS VARBINARY as BLOB with charset 63.
    • SYSDATE() and UTC_DATE() fail, so StarRocks gets no cell expression list.
    • KILL QUERY answers 1317.
  • The real driver against that server, from a throwaway test: ice.idb connects into ice/idb; catalogs and the catalog's databases list; the Iceberg table lists without _file and _pos and with no table status; re-entering ice keeps idb; default_catalog leaves no database; the materialized view lists as one and opens on CREATE MATERIALIZED VIEW; JSON reads as text and VARBINARY as bytes; a bare idb lands in default_catalog; a 0 timeout sets 259200.
  • New: StarRocksCatalogTests, PluginMetadataRegistryStarRocksTests, and in DatabaseManagerDatabaseSwitchTests the saved schema on a catalog switch and the reconnect restore order.
  • MySQLTableStatusRowTests, MySQLProtocolVariantParityTests, PluginMetadataRegistryTypeCountTests, SwitchDatabaseReconnectFailureTests, SQLDDLFallbackPolicyTests, DatabaseTypeTests, the database switch, schema switch, session lane and scoped driver suites (73 cases) and the TableProCore type, grammar and vocabulary tests pass.
  • verify.sh build passes. AllPlugins stopped at DamengDriver, whose Rust library is not built on this Mac; StarRocksDriverPlugin and MySQLDriver linked and load with verify-plugin-loads.sh.
  • Not run here: the iOS build, which stops on a DuckDB header this Mac's libs lack. CI builds it.
  • Pin changed on purpose: TableProModelsTests.DatabaseTypeTests expects DatabaseType.starrocks.pluginTypeId == "StarRocks".

Needs the maintainer

  • Publish the StarRocks registry plugin with the next app release.

vbabenkoru and others added 4 commits October 30, 2026 22:27
StarRocks type on MySQL plugin. Catalogs = database level (SHOW CATALOGS / SET CATALOG), catalog dbs = schema level (USE). Database field takes catalog.database; bare name tried as catalog, else db in default_catalog. Probe SELECT current_version() confirms server. MySQL catalog reads (indexes, FKs, routines, triggers, status) skipped.

Co-authored-by: Cursor <cursoragent@cursor.com>
StarRocks labels JSON/VARIANT results charset 63; grid showed hex. Binary-labelled strings now decode as UTF-8 text, else bytes. Icon: official StarRocks logo (MIT, log-z/logos), template rendering, brand color #01808F.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ed list, tighten comments

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@vbabenkoru
vbabenkoru marked this pull request as ready for review October 31, 2026 14:52
vbabenkoru and others added 4 commits October 31, 2026 09:50
Columns come from information_schema.columns, which names each key model and leaves out the
_file and _pos an Iceberg table's SHOW FULL COLUMNS adds. EXPLAIN offers LOGICAL, VERBOSE and
COSTS, and drops ANALYZE, whose report is colored with terminal escape codes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@datlechin datlechin changed the title feat(mysql): connect to StarRocks and browse its catalogs and databases feat(starrocks): add a registry driver that browses catalogs and databases Oct 31, 2026

This branch has not been deployed

No deployments
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