Database support

One API contract, evidence per provider.

Trestle ships one external API contract with evidence per provider. SQLite and PostgreSQL are first-class database options. PostgreSQL 16, 17 and 18 are supported.

CapabilitySQLitePostgreSQL
Configuration and connection testAvailableAvailable
Fresh system schemaAvailableAvailable
Collections and physical schemaAvailableAvailable (PG05)
Records, batches and optimistic concurrencyAvailableAvailable (PG06)
Querying and paginationAvailableAvailable (PG07)
Identity, sessions and tokensAvailableAvailable (PG04)
Access rules and file metadataAvailableAvailable (PG08)
Events and automationAvailableAvailable (PG09)
Backups and restoreAvailableAvailable (PG10)
Cross-provider migrationNot applicableAvailable (PG11)

What parity means

Trestle tests observable HTTP behavior rather than pretending the engines are internally identical. Errors, ordering, null handling, uniqueness, timestamps, JSON, optimistic versions, atomic batches, events and jobs form the frozen parity corpus.

Evidence and supported versions

PG03 validates and persists a PostgreSQL connection and initializes all 13 logical system migrations; the PG03R repair made migration history authoritative and enforced the connection timeout. PG04 added identity parity, PG05 collection schema parity and PG06 record parity. PG07 added querying and pagination parity: null, number, datetime and case semantics, typed filter errors, sort direction and filter+cursor pagination behave identically on SQLite and PostgreSQL. PG08-PG10 added access-rule, file, events, jobs and backup/restore parity. PG11 added offline cross-provider migration in both directions. The CI matrix runs the provider-dependent normal and race suites against PostgreSQL 16, 17 and 18; local evidence exercises PostgreSQL 18.6. Availability means one external API contract, not identical internals: see PostgreSQL configuration and Backup and restore for provider-specific operational guidance.

Operational differences matter

Choose SQLite when you want an embedded database with no separate service. Choose PostgreSQL when you want an external database, TLS, connection pooling and server tooling. See the provider-specific guidance in PostgreSQL configuration, Backup and restore, and Migrations.