Skip to content

Add dedicated CrateDB driver (derives from PostgreSQL) #39

@bgunebakan

Description

@bgunebakan

What problem will this feature request solve?
CrateDB speaks the PostgreSQL wire protocol and is currently used with Metabase via the built-in PostgreSQL driver. However, several sync operations fail because the PostgreSQL driver calls system catalog APIs that CrateDB does not implement.

  • pg_stat_user_tables: queried during database sync (describe-database*) pgcompat: ERROR: Relation 'pg_catalog.pg_stat_user_tables' unknown crate#19166
  • pg_catalog.has_any_column_privilege: queried during table privilege checks and field sync
  • pg_catalog.pg_get_indexdef: queried during index sync
  • pg_constraint: queried during foreign key sync
  • SHOW timezone / SET TIME ZONE: CrateDB does not support timezone session state

Additionally, CrateDB has reserved keywords (role, schema, table) that cause syntax errors. crate/crate#19234

Describe the solution you'd like.
Create a dedicated :cratedb driver module under modules/drivers/cratedb/ that derives from :postgres and overrides only the incompatible parts. This follows the same pattern as the existing Redshift driver (which also derives from postgres).

How does this feature request impact you?
Without a dedicated driver, CrateDB cannot be used with new Metabase versions >= v0.48.4.

Additional information
The Redshift driver modules/drivers/redshift/ is the closest reference implementation, it also derives from :postgres and overrides only what differs. The CrateDB driver would follow exactly the same pattern and would be similarly lightweight.

Upstream tracking issue: crate/crate-clients-tools#153

I collected all information and compatibility differences from related issues and code analysis. Can be some other changes on implementation.

Thoughts? @amotl @kneth @matriv

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions