improve postgres support
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-02-10 19:40:20 +11:00
parent e0cbc20140
commit 3e3d8c2eb0
7 changed files with 743 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ package db
import (
"database/sql"
"fmt"
"log/slog"
"strings"
"vctp/db/queries"
@@ -42,6 +43,9 @@ func (d *LocalDB) Close() error {
}
func newLocalDB(logger *slog.Logger, dsn string) (*LocalDB, error) {
if looksLikePostgresDSN(dsn) {
return nil, fmt.Errorf("database_driver is sqlite but database_url looks like a postgres DSN; set settings.database_driver=postgres")
}
// TODO - work out if https://kerkour.com/sqlite-for-servers is possible without using sqlx
/*