feature: duckdb adapter #102

Open
opened 2026-07-15 20:46:22 -05:00 by noe.trevino · 0 comments
Owner

Did you check the docs?

  • I have read all the dadbod-ui.nvim docs

Duckdb connects through dadbod already, so people can open one, but they get a drawer with no introspection, no table helpers, no pagination. Its one of the most used databases in data work right now and we just dont have an adapter for it.

Describe the solution you'd like

Duckdb was built postgres compatible on purpose, so the postgres adapter is basically the template:

  • schemas and tables from information_schema.schemata / information_schema.tables
  • table helpers from information_schema.columns (it also kept sqlite's pragma_table_info if thats easier)
  • EXPLAIN and EXPLAIN ANALYZE, it has both
  • limit_offset pagination
  • csv / json export through the cli, same shape as sqlite
  • quotes identifiers, postgres style

Acceptance Criteria

  • adapters/duckdb.lua exists
  • connect and introspect
  • schemas listed
  • tables listed
  • table helpers
  • EXPLAIN
  • EXPLAIN ANALYZE
  • pagination
  • export, at least through the lua formatters
  • foreign key jump, or left as a known gap if the constraint lookup doesnt resolve cleanly
  • added to the CURRENT_SUPPORT.md matrix
  • tested

Describe alternatives/other solutions you've considered

Leaving it out and letting people register their own with api.register_adapter. They can, but duckdb is common enough that it should be built in. I also just learned about it and it is the coolest thing in the world

Stored procedures: Duckdb has macros, not procedures in the postgres or sql server sense, so procedures_query is left off and the drawer just doesnt render that section, same as sqlite. Its not a thing. Definitenly need to research this more though

Foreign key jump is the one field thats not a copy from postgres. Duckdb has duckdb_constraints() but its fk enforcement was historically limited, so it needs writing and actually testing against a real fk before we claim it.

We CAN omit this.

### Did you check the docs? - [X] I have read all the dadbod-ui.nvim docs ### Is your feature request related to a problem? Please describe. Duckdb connects through dadbod already, so people can open one, but they get a drawer with no introspection, no table helpers, no pagination. Its one of the most used databases in data work right now and we just dont have an adapter for it. ### Describe the solution you'd like Duckdb was built postgres compatible on purpose, so the postgres adapter is basically the template: - schemas and tables from `information_schema.schemata` / `information_schema.tables` - table helpers from `information_schema.columns` (it also kept sqlite's `pragma_table_info` if thats easier) - `EXPLAIN` and `EXPLAIN ANALYZE`, it has both - `limit_offset` pagination - csv / json export through the cli, same shape as sqlite - quotes identifiers, postgres style ### Acceptance Criteria - [ ] `adapters/duckdb.lua` exists - [ ] connect and introspect - [ ] schemas listed - [ ] tables listed - [ ] table helpers - [ ] EXPLAIN - [ ] EXPLAIN ANALYZE - [ ] pagination - [ ] export, at least through the lua formatters - [ ] foreign key jump, or left as a known gap if the constraint lookup doesnt resolve cleanly - [ ] added to the `CURRENT_SUPPORT.md` matrix - [ ] tested ### Describe alternatives/other solutions you've considered Leaving it out and letting people register their own with `api.register_adapter`. They can, but duckdb is common enough that it should be built in. I also just learned about it and it is the coolest thing in the world Stored procedures: Duckdb has macros, not procedures in the postgres or sql server sense, so `procedures_query` is left off and the drawer just doesnt render that section, same as sqlite. Its not a thing. Definitenly need to research this more though Foreign key jump is the one field thats not a copy from postgres. Duckdb has `duckdb_constraints()` but its fk enforcement was historically limited, so it needs writing and actually testing against a real fk before we claim it. We CAN omit this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
noe.trevino/dadbod-ui.nvim#102
No description provided.