Skip to content

Conversation

@onmax
Copy link
Contributor

@onmax onmax commented Jan 29, 2026

Summary

  • Adds db.capabilities property to query database feature support at runtime
  • Enables writing portable code that adapts to underlying database features

Changes

Per pi0's suggestion:

  • Export db0/capabilities subpath with dialectCapabilities map and getCapabilities() helper
  • Connectors define capabilityOverrides (optional) for exceptions instead of full capabilities
  • Capabilities computed from dialect + overrides at runtime

Other:

  • Added DatabaseCapabilities interface with 7 capability flags
  • Added capability tests and documentation

Capabilities Matrix

Dialect JSON Bool Array Date UUID Tx Batch
sqlite/libsql
postgresql
mysql

TODOs

currently using the db-compat.onmax.me deployment in the docs and github source code

@onmax onmax force-pushed the feat/capabilities branch from 23b2d24 to 30172ac Compare January 29, 2026 19:03

## Capabilities by Connector

| Connector | JSON | Bool | Array | Date | UUID | Tx | Batch |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if we add an automd generator for this section to stay in sync with source

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, it looks like a dialect-mapped table. I suggest exposing it as a subpath like db0/capabilities with a map from dialects to capabilities users can use.

Later we might only expose capabilityOverrides from connectors that have exception (for example have one less or extra feature)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i amended pr with this comments

@onmax onmax force-pushed the feat/capabilities branch from a8ce927 to 3a1343b Compare February 1, 2026 15:04
@onmax
Copy link
Contributor Author

onmax commented Feb 1, 2026

  1. added mdauto
  2. consuming data from db-compat.onmax.me

@pi0 , let me know how we can proceed :)

@onmax onmax force-pushed the feat/capabilities branch 2 times, most recently from 7a1e2fb to f6f8fb3 Compare February 1, 2026 15:39
@onmax onmax marked this pull request as ready for review February 1, 2026 15:43
@onmax onmax force-pushed the feat/capabilities branch from fa3cc18 to a1161db Compare February 1, 2026 16:12
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