Merge pull request #97 from Sagit-chu/opencode/glowing-orchid

fix: backend postgresql
This commit is contained in:
sagit
2026-02-12 16:47:04 +08:00
committed by GitHub
2 changed files with 4 additions and 2 deletions
@@ -1414,7 +1414,7 @@ func ensurePostgresTableIDDefault(db *store.DB, schemaName, tableName string) er
var serialSeq sql.NullString
if err := db.QueryRow(`
SELECT pg_get_serial_sequence(format('%I.%I', ?, ?), 'id')
SELECT pg_get_serial_sequence(quote_ident(?) || '.' || quote_ident(?), 'id')
`, schemaName, tableName).Scan(&serialSeq); err != nil {
return err
}
+3 -1
View File
@@ -250,7 +250,9 @@ get_current_db_type() {
db_type=$(get_env_var "DB_TYPE")
database_url=$(get_env_var "DATABASE_URL")
if [[ "$db_type" == "postgres" || "$database_url" == postgres://* || "$database_url" == postgresql://* ]]; then
if [[ "$db_type" == "sqlite" ]]; then
echo "sqlite"
elif [[ "$db_type" == "postgres" || "$database_url" == postgres://* || "$database_url" == postgresql://* ]]; then
echo "postgres"
else
echo "sqlite"