MCPcopy Index your code
hub / github.com/riverqueue/river / dbExecError

Function dbExecError

rivermigrate/river_migrate_test.go:1019–1023  ·  view source on GitHub ↗

A command returning an error aborts the transaction. This is a shortcut to execute a command in a subtransaction so that we can verify an error, but continue to use the original transaction.

(ctx context.Context, exec riverdriver.Executor, sql string)

Source from the content-addressed store, hash-verified

1017// execute a command in a subtransaction so that we can verify an error, but
1018// continue to use the original transaction.
1019func dbExecError(ctx context.Context, exec riverdriver.Executor, sql string) error {
1020 return dbutil.WithTx(ctx, exec, func(ctx context.Context, exec riverdriver.ExecutorTx) error {
1021 return exec.Exec(ctx, sql)
1022 })
1023}
1024
1025func driverMigrationToInt(r *riverdriver.Migration) int { return r.Version }
1026func migrationToInt(migration Migration) int { return migration.Version }

Callers 1

TestMigratorFunction · 0.85

Calls 2

WithTxFunction · 0.92
ExecMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…