|
@@ -26,7 +26,7 @@ func (db *DBMethods) Begin(ctx context.Context, opts *sql.TxOptions) (*Tx, error
|
|
if db.Debug {
|
|
if db.Debug {
|
|
t := time.Now()
|
|
t := time.Now()
|
|
tx, err := db.DB.BeginTx(ctx, opts)
|
|
tx, err := db.DB.BeginTx(ctx, opts)
|
|
- log(os.Stdout, "[func Begin]", t, err, true, "")
|
|
|
|
|
|
+ log(os.Stdout, "Begin", t, err, true, "")
|
|
return &Tx{tx, db.Debug, db.Driver, t}, err
|
|
return &Tx{tx, db.Debug, db.Driver, t}, err
|
|
}
|
|
}
|
|
|
|
|
|
@@ -41,7 +41,7 @@ func (db *DBMethods) Close() error {
|
|
if db.Debug {
|
|
if db.Debug {
|
|
t := time.Now()
|
|
t := time.Now()
|
|
err := db.DB.Close()
|
|
err := db.DB.Close()
|
|
- log(os.Stdout, "[func Close]", t, err, false, "")
|
|
|
|
|
|
+ log(os.Stdout, "Close", t, err, false, "")
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
return db.DB.Close()
|
|
return db.DB.Close()
|
|
@@ -51,7 +51,7 @@ func (db *DBMethods) Exec(ctx context.Context, query string, args ...any) (sql.R
|
|
if db.Debug {
|
|
if db.Debug {
|
|
t := time.Now()
|
|
t := time.Now()
|
|
res, err := db.DB.ExecContext(ctx, db.fixQuery(query), args...)
|
|
res, err := db.DB.ExecContext(ctx, db.fixQuery(query), args...)
|
|
- log(os.Stdout, "[func Exec]", t, err, false, db.fixQuery(query), args...)
|
|
|
|
|
|
+ log(os.Stdout, "Exec", t, err, false, db.fixQuery(query), args...)
|
|
return res, err
|
|
return res, err
|
|
}
|
|
}
|
|
return db.DB.ExecContext(ctx, db.fixQuery(query), args...)
|
|
return db.DB.ExecContext(ctx, db.fixQuery(query), args...)
|
|
@@ -61,7 +61,7 @@ func (db *DBMethods) Ping(ctx context.Context) error {
|
|
if db.Debug {
|
|
if db.Debug {
|
|
t := time.Now()
|
|
t := time.Now()
|
|
err := db.DB.PingContext(ctx)
|
|
err := db.DB.PingContext(ctx)
|
|
- log(os.Stdout, "[func Ping]", t, err, false, "")
|
|
|
|
|
|
+ log(os.Stdout, "Ping", t, err, false, "")
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
return db.DB.PingContext(ctx)
|
|
return db.DB.PingContext(ctx)
|
|
@@ -71,7 +71,7 @@ func (db *DBMethods) Prepare(ctx context.Context, query string) (*sql.Stmt, erro
|
|
if db.Debug {
|
|
if db.Debug {
|
|
t := time.Now()
|
|
t := time.Now()
|
|
stm, err := db.DB.PrepareContext(ctx, db.fixQuery(query))
|
|
stm, err := db.DB.PrepareContext(ctx, db.fixQuery(query))
|
|
- log(os.Stdout, "[func Prepare]", t, err, false, db.fixQuery(query))
|
|
|
|
|
|
+ log(os.Stdout, "Prepare", t, err, false, db.fixQuery(query))
|
|
return stm, err
|
|
return stm, err
|
|
}
|
|
}
|
|
return db.DB.PrepareContext(ctx, db.fixQuery(query))
|
|
return db.DB.PrepareContext(ctx, db.fixQuery(query))
|
|
@@ -81,7 +81,7 @@ func (db *DBMethods) Query(ctx context.Context, query string, args ...any) (*sql
|
|
if db.Debug {
|
|
if db.Debug {
|
|
t := time.Now()
|
|
t := time.Now()
|
|
rows, err := db.DB.QueryContext(ctx, db.fixQuery(query), args...)
|
|
rows, err := db.DB.QueryContext(ctx, db.fixQuery(query), args...)
|
|
- log(os.Stdout, "[func Query]", t, err, false, db.fixQuery(query), args...)
|
|
|
|
|
|
+ log(os.Stdout, "Query", t, err, false, db.fixQuery(query), args...)
|
|
return rows, err
|
|
return rows, err
|
|
}
|
|
}
|
|
return db.DB.QueryContext(ctx, db.fixQuery(query), args...)
|
|
return db.DB.QueryContext(ctx, db.fixQuery(query), args...)
|
|
@@ -91,7 +91,7 @@ func (db *DBMethods) QueryRow(ctx context.Context, query string, args ...any) *s
|
|
if db.Debug {
|
|
if db.Debug {
|
|
t := time.Now()
|
|
t := time.Now()
|
|
row := db.DB.QueryRowContext(ctx, db.fixQuery(query), args...)
|
|
row := db.DB.QueryRowContext(ctx, db.fixQuery(query), args...)
|
|
- log(os.Stdout, "[func QueryRow]", t, nil, false, db.fixQuery(query), args...)
|
|
|
|
|
|
+ log(os.Stdout, "QueryRow", t, nil, false, db.fixQuery(query), args...)
|
|
return row
|
|
return row
|
|
}
|
|
}
|
|
return db.DB.QueryRowContext(ctx, db.fixQuery(query), args...)
|
|
return db.DB.QueryRowContext(ctx, db.fixQuery(query), args...)
|