v0.0.371
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m26s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m26s
This commit is contained in:
parent
be24f7a190
commit
2afb265ea4
@ -1,5 +1,5 @@
|
||||
package goext
|
||||
|
||||
const GoextVersion = "0.0.370"
|
||||
const GoextVersion = "0.0.371"
|
||||
|
||||
const GoextVersionTimestamp = "2024-01-13T14:10:25+0100"
|
||||
const GoextVersionTimestamp = "2024-01-13T14:19:19+0100"
|
||||
|
@ -46,7 +46,7 @@ func (db *database) Exec(ctx context.Context, sqlstr string, prep PP) (sql.Resul
|
||||
for _, v := range db.lstr {
|
||||
err := v.PreExec(ctx, nil, &sqlstr, &prep)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, exerr.Wrap(err, "failed to call SQL pre-exec listener").Str("original_sql", origsql).Str("sql", sqlstr).Any("sql_params", prep).Build()
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ func (db *database) Query(ctx context.Context, sqlstr string, prep PP) (*sqlx.Ro
|
||||
for _, v := range db.lstr {
|
||||
err := v.PreQuery(ctx, nil, &sqlstr, &prep)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, exerr.Wrap(err, "failed to call SQL pre-query listener").Str("original_sql", origsql).Str("sql", sqlstr).Any("sql_params", prep).Build()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/exerr"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
)
|
||||
|
||||
@ -48,7 +49,7 @@ func (tx *transaction) Rollback() error {
|
||||
for _, v := range tx.db.lstr {
|
||||
err := v.PreTxRollback(tx.id)
|
||||
if err != nil {
|
||||
return err
|
||||
return exerr.Wrap(err, "failed to call SQL pre-rollback listener").Int("tx.id", int(tx.id)).Build()
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +70,7 @@ func (tx *transaction) Commit() error {
|
||||
for _, v := range tx.db.lstr {
|
||||
err := v.PreTxCommit(tx.id)
|
||||
if err != nil {
|
||||
return err
|
||||
return exerr.Wrap(err, "failed to call SQL pre-commit listener").Int("tx.id", int(tx.id)).Build()
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,7 +92,7 @@ func (tx *transaction) Exec(ctx context.Context, sqlstr string, prep PP) (sql.Re
|
||||
for _, v := range tx.db.lstr {
|
||||
err := v.PreExec(ctx, langext.Ptr(tx.id), &sqlstr, &prep)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, exerr.Wrap(err, "failed to call SQL pre-exec listener").Int("tx.id", int(tx.id)).Str("original_sql", origsql).Str("sql", sqlstr).Any("sql_params", prep).Build()
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,7 +107,7 @@ func (tx *transaction) Exec(ctx context.Context, sqlstr string, prep PP) (sql.Re
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, exerr.Wrap(err, "Failed to [exec] sql statement").Int("tx.id", int(tx.id)).Str("original_sql", origsql).Str("sql", sqlstr).Any("sql_params", prep).Build()
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
@ -116,7 +117,7 @@ func (tx *transaction) Query(ctx context.Context, sqlstr string, prep PP) (*sqlx
|
||||
for _, v := range tx.db.lstr {
|
||||
err := v.PreQuery(ctx, langext.Ptr(tx.id), &sqlstr, &prep)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, exerr.Wrap(err, "failed to call SQL pre-query listener").Int("tx.id", int(tx.id)).Str("original_sql", origsql).Str("sql", sqlstr).Any("sql_params", prep).Build()
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,7 +132,7 @@ func (tx *transaction) Query(ctx context.Context, sqlstr string, prep PP) (*sqlx
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, exerr.Wrap(err, "Failed to [query] sql statement").Int("tx.id", int(tx.id)).Str("original_sql", origsql).Str("sql", sqlstr).Any("sql_params", prep).Build()
|
||||
}
|
||||
return rows, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user