02.11.2025

This commit is contained in:
2025-11-02 19:55:58 +03:00
parent 49371e3eca
commit 9c204a9554
4 changed files with 50 additions and 28 deletions

View File

@@ -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