summaryrefslogtreecommitdiff
path: root/pgruntime/behavior.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2026-11-10 00:32:16 +0100
committerStefan Majewsky <majewsky@gmx.net>2026-11-10 00:32:16 +0100
commitf082ae9a138edd1ee1bcdfc40276013064fbec7e (patch)
treec18e5e63f283912f0989e9e82701ca28ff52c332 /pgruntime/behavior.go
parent833e477420513a46faa4ebcc1164c50a8288a9ab (diff)
downloadgo-gg-f082ae9a138edd1ee1bcdfc40276013064fbec7e.tar.gz
replace execQuery() with new gsql.Exec() helper
Diffstat (limited to 'pgruntime/behavior.go')
-rw-r--r--pgruntime/behavior.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pgruntime/behavior.go b/pgruntime/behavior.go
index d327d09..76d8bd0 100644
--- a/pgruntime/behavior.go
+++ b/pgruntime/behavior.go
@@ -63,7 +63,7 @@ func (b ConnectionBehavior) applyTo(ctx context.Context, db gsql.ConnectionHandl
func applyMigrations(ctx context.Context, db gsql.ConnectionHandle, migrations map[int64]string) error {
// apply schema_migrations table schema
- _, err := execQuery(ctx, db, MigrationsSchema, nil)
+ _, err := gsql.Exec(ctx, db, MigrationsSchema)
if err != nil {
return fmt.Errorf("could not apply schema_migrations table schema: %w", err)
}
@@ -81,7 +81,7 @@ func applyMigrations(ctx context.Context, db gsql.ConnectionHandle, migrations m
switch rowCount {
case 0:
record.CurrentVersion = 0
- _, err = execQuery(ctx, db, `INSERT INTO schema_migrations (version, dirty) VALUES (0, FALSE)`, nil)
+ _, err = gsql.Exec(ctx, db, `INSERT INTO schema_migrations (version, dirty) VALUES (0, FALSE)`)
if err != nil {
return fmt.Errorf("could not initialize schema_migrations record: %w", err)
}
@@ -126,11 +126,11 @@ func applyMigrations(ctx context.Context, db gsql.ConnectionHandle, migrations m
}
// perform the next migration
- _, err = execQuery(ctx, db, migrations[version], nil)
+ _, err = gsql.Exec(ctx, db, migrations[version])
if err != nil {
return fmt.Errorf("could not execute schema migration: %w", err)
}
- _, err = execQuery(ctx, db, `UPDATE schema_migrations SET version = $1, dirty = FALSE`, []any{version})
+ _, err = gsql.Exec(ctx, db, `UPDATE schema_migrations SET version = $1, dirty = FALSE`, version)
if err != nil {
return fmt.Errorf("could not update schema_migrations record: %w", err)
}