Context
PR TabularisDB/tabularis#822 (PostgreSQL multi-database browsing) adds a new get_table_ddl method to the main repo's DriverTrait and dispatches it from RpcDriver as a "get_table_ddl" RPC call. The in-tree postgres/mysql/sqlite drivers have implementations that call their existing module-level get_table_ddl functions. The dump_database backend command now routes table-listing and DDL-fetch through this trait method instead of matching on the driver string directly, fixing the "Unsupported driver" failure for plugin-registered drivers.
The RpcDriver side in tabularis is wired — it calls self.process.call("get_table_ddl", json!({...})) — but this plugin doesn't yet have a handler for that method, so dump DDL for a plugin-installed Postgres connection will fail with a "method not implemented" error until this is added.
Request
Add a get_table_ddl RPC handler to this plugin, following the existing handler pattern (e.g. src/handlers/metadata.rs where get_tables, get_schemas, etc. live).
Expected RPC contract (inferred from how the main repo dispatches it, mirroring the existing PLUGIN_GUIDE.md patterns):
Request params: { "params": ConnectionParams, "table": "table_name", "schema": "schema_name | null" }
Result: "CREATE TABLE ..." (a single string — the DDL for the existing table)
The simplest correct implementation for Postgres: query pg_catalog or use SHOW CREATE TABLE-equivalent constructions (e.g. reconstruct from pg_class/pg_attribute/pg_constraint) similar to how the deprecated in-tree src/drivers/postgres/mod.rs::get_table_ddl currently works in the main repo (before it gets removed). Alternatively, use pg_dump --schema-only --table=... subprocess if that's already plumbed in this plugin. The output just needs to be a valid CREATE TABLE statement that can be written into a .sql dump file.
Notes
- This is only needed for dump-schema-structure support. The data export step in
dump_database uses its own raw connection path and is unaffected.
- The main repo's in-tree
get_table_ddl in src/drivers/postgres/mod.rs is a good reference: it reconstructs the CREATE TABLE statement from information_schema.columns plus constraint queries. That implementation will eventually be removed when the in-tree postgres driver is fully deprecated.
Context
PR TabularisDB/tabularis#822 (PostgreSQL multi-database browsing) adds a new
get_table_ddlmethod to the main repo'sDriverTraitand dispatches it fromRpcDriveras a"get_table_ddl"RPC call. The in-tree postgres/mysql/sqlite drivers have implementations that call their existing module-levelget_table_ddlfunctions. Thedump_databasebackend command now routes table-listing and DDL-fetch through this trait method instead of matching on the driver string directly, fixing the "Unsupported driver" failure for plugin-registered drivers.The
RpcDriverside intabularisis wired — it callsself.process.call("get_table_ddl", json!({...}))— but this plugin doesn't yet have a handler for that method, so dump DDL for a plugin-installed Postgres connection will fail with a "method not implemented" error until this is added.Request
Add a
get_table_ddlRPC handler to this plugin, following the existing handler pattern (e.g.src/handlers/metadata.rswhereget_tables,get_schemas, etc. live).Expected RPC contract (inferred from how the main repo dispatches it, mirroring the existing
PLUGIN_GUIDE.mdpatterns):The simplest correct implementation for Postgres: query
pg_catalogor useSHOW CREATE TABLE-equivalent constructions (e.g. reconstruct frompg_class/pg_attribute/pg_constraint) similar to how the deprecated in-treesrc/drivers/postgres/mod.rs::get_table_ddlcurrently works in the main repo (before it gets removed). Alternatively, usepg_dump --schema-only --table=...subprocess if that's already plumbed in this plugin. The output just needs to be a validCREATE TABLEstatement that can be written into a.sqldump file.Notes
dump_databaseuses its own raw connection path and is unaffected.get_table_ddlinsrc/drivers/postgres/mod.rsis a good reference: it reconstructs the CREATE TABLE statement frominformation_schema.columnsplus constraint queries. That implementation will eventually be removed when the in-tree postgres driver is fully deprecated.