02.11.2025
This commit is contained in:
@@ -16,16 +16,15 @@ func NewSQLAdapter(db *sql.DB) *DBAdapter {
|
||||
}
|
||||
|
||||
func (a *DBAdapter) Exec(ctx context.Context, batchedQuery models.BatchedQuery) (sql.Result, error) {
|
||||
res, err := a.db.ExecContext(ctx, string(batchedQuery))
|
||||
|
||||
res, err := a.db.ExecContext(ctx, batchedQuery.Query, batchedQuery.Items...)
|
||||
return res, err
|
||||
}
|
||||
|
||||
// CheckQuery - checks if the query is valid
|
||||
func (a *DBAdapter) CheckQuery(query string) error {
|
||||
stmt, err := a.db.Prepare(query)
|
||||
stmt, err := a.db.Prepare(query)
|
||||
if err != nil {
|
||||
return err
|
||||
return err
|
||||
}
|
||||
stmt.Close()
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user