Files
base/core/db_connect_postgres_nopg.go
zeekay 85387a93ab feat(base): add PostgreSQL dialect and DBConnect
SQLDialect interface abstracts SQLite vs PostgreSQL SQL differences:
- JSON ops (json_extract vs ->>, json_each vs jsonb_array_elements)
- Date formatting (strftime vs to_char)
- Schema introspection (PRAGMA vs information_schema)
- ID generation (randomblob vs gen_random_bytes)

Adds PostgresDBConnect via pgx driver and DataDSN/AuxDSN config fields
for connecting Base to Neon serverless PostgreSQL instead of SQLite.
2026-03-01 18:37:50 -08:00

15 lines
329 B
Go

//go:build no_pg_driver
package core
import (
"errors"
"github.com/hanzoai/dbx"
)
// PostgresDBConnect is a stub when the pg driver is excluded via the no_pg_driver build tag.
func PostgresDBConnect(_ string) (*dbx.DB, error) {
return nil, errors.New("PostgreSQL support is not available (built with no_pg_driver tag)")
}