exec.go 474 Bytes
Newer Older
Vladimir Barsukov's avatar
Vladimir Barsukov committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package zdb

func (d *Pool) WExec(sql string, args ...any) error {
	return d.qExec(d.SrvMaster, sql, args...)
}
func (d *Pool) WExecNamed(sql string, args map[string]any) error {
	return d.qExec(d.SrvMaster, d.prepare(sql, args))
}
func (d *Pool) WExecOpts(opts Opts) error {
	sql, args := opts.Opts()

	return d.qExec(d.SrvMaster, d.prepare(sql, args))
}

func (d *Pool) qExec(q *Conn, sql string, args ...any) error {
	_, err := q.Exec(d.ctx, sql, args...)

	return err
}