improve postgres support
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user