mirror of
https://github.com/hanzoai/base.git
synced 2026-10-21 03:41:50 +00:00
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.
15 lines
329 B
Go
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)")
|
|
}
|