Skip to content

Commit

Permalink
Better pgsql open
Browse files Browse the repository at this point in the history
  • Loading branch information
NodudeWasTaken committed Oct 10, 2024
1 parent 36c8b8d commit edc3c7d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/sqlite/database_postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,10 @@ func (db *PostgresDB) open(disableForeignKeys bool, writable bool) (conn *sqlx.D
}

if disableForeignKeys {
_, err = conn.Exec("SET session_replication_role = replica;")

if err != nil {
return nil, fmt.Errorf("conn.Exec(): %w", err)
}
logger.Warn("open with disableForeignKeys is not implemented.")
}
if !writable {
_, err = conn.Exec("SET default_transaction_read_only = ON;")
_, err = conn.Exec("SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;")

if err != nil {
return nil, fmt.Errorf("conn.Exec(): %w", err)
Expand Down

0 comments on commit edc3c7d

Please sign in to comment.