func (d *Database) ScanStructContext(ctx context.Context, i interface{}, query string, args ...interface{}) (bool, error) {
	return d.queryFactory().FromSQL(query, args...).ScanStructContext(ctx, i)
}
Queries the database using the supplied context, query, and args and uses CrudExec.ScanStructContext to scan the
results into a struct

i: A pointer to a struct

query: The SQL to execute

args...: for any placeholder parameters in the query
package goqu
import (
	"context"
	"database/sql"
	"sync"
	"github.com/doug-martin/goqu/v9/exec"
)
type (
	Logger interface {
		Printf(format string, v ...interface{})
	}
	SQLDatabase interface {
		Begin() (*sql.Tx, error)
		BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
		ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
		PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
		QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
		QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
	}
	Database struct {
		logger  Logger
		dialect string
		Db     SQLDatabase
		qf     exec.QueryFactory
		qfOnce sync.Once
	}
)
func newDatabase(dialect string, db SQLDatabase) *Database {
	return &Database{
		logger:  nil,
		dialect: dialect,
		Db:      db,
		qf:      nil,
		qfOnce:  sync.Once{},
	}
}
func (d *Database) Dialect() string {
	return d.dialect
}
func (d *Database) Begin() (*TxDatabase, error) {
	sqlTx, err := d.Db.Begin()
	if err != nil {
		return nil, err
	}
	tx := NewTx(d.dialect, sqlTx)
	tx.Logger(d.logger)
	return tx, nil
}
func (d *Database) BeginTx(ctx context.Context, opts *sql.TxOptions) (*TxDatabase, error) {
	sqlTx, err := d.Db.BeginTx(ctx, opts)
	if err != nil {
		return nil, err
	}
	tx := NewTx(d.dialect, sqlTx)
	tx.Logger(d.logger)
	return tx, nil
}
func (d *Database) WithTx(fn func(*TxDatabase) error) error {
	tx, err := d.Begin()
	if err != nil {
		return err
	}
	return tx.Wrap(func() error { return fn(tx) })
}
func (d *Database) From(from ...interface{}) *SelectDataset {
	return newDataset(d.dialect, d.queryFactory()).From(from...)
}
func (d *Database) Select(cols ...interface{}) *SelectDataset {
	return newDataset(d.dialect, d.queryFactory()).Select(cols...)
}
func (d *Database) Update(table interface{}) *UpdateDataset {
	return newUpdateDataset(d.dialect, d.queryFactory()).Table(table)
}
func (d *Database) Insert(table interface{}) *InsertDataset {
	return newInsertDataset(d.dialect, d.queryFactory()).Into(table)
}
func (d *Database) Delete(table interface{}) *DeleteDataset {
	return newDeleteDataset(d.dialect, d.queryFactory()).From(table)
}
func (d *Database) Truncate(table ...interface{}) *TruncateDataset {
	return newTruncateDataset(d.dialect, d.queryFactory()).Table(table...)
}
func (d *Database) Logger(logger Logger) {
	d.logger = logger
}
func (d *Database) Trace(op, sqlString string, args ...interface{}) {
	if d.logger != nil {
		if sqlString != "" {
			if len(args) != 0 {
				d.logger.Printf("[goqu] %s [query:=`%s` args:=%+v]", op, sqlString, args)
			} else {
				d.logger.Printf("[goqu] %s [query:=`%s`]", op, sqlString)
			}
		} else {
			d.logger.Printf("[goqu] %s", op)
		}
	}
}
func (d *Database) Exec(query string, args ...interface{}) (sql.Result, error) {
	return d.ExecContext(context.Background(), query, args...)
}
func (d *Database) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) {
	d.Trace("EXEC", query, args...)
	return d.Db.ExecContext(ctx, query, args...)
}
func (d *Database) Prepare(query string) (*sql.Stmt, error) {
	return d.PrepareContext(context.Background(), query)
}
func (d *Database) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) {
	d.Trace("PREPARE", query)
	return d.Db.PrepareContext(ctx, query)
}
func (d *Database) Query(query string, args ...interface{}) (*sql.Rows, error) {
	return d.QueryContext(context.Background(), query, args...)
}
func (d *Database) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) {
	d.Trace("QUERY", query, args...)
	return d.Db.QueryContext(ctx, query, args...)
}
func (d *Database) QueryRow(query string, args ...interface{}) *sql.Row {
	return d.QueryRowContext(context.Background(), query, args...)
}
func (d *Database) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row {
	d.Trace("QUERY ROW", query, args...)
	return d.Db.QueryRowContext(ctx, query, args...)
}
func (d *Database) queryFactory() exec.QueryFactory {
	d.qfOnce.Do(func() {
		d.qf = exec.NewQueryFactory(d)
	})
	return d.qf
}
func (d *Database) ScanStructs(i interface{}, query string, args ...interface{}) error {
	return d.ScanStructsContext(context.Background(), i, query, args...)
}
func (d *Database) ScanStructsContext(ctx context.Context, i interface{}, query string, args ...interface{}) error {
	return d.queryFactory().FromSQL(query, args...).ScanStructsContext(ctx, i)
}
func (d *Database) ScanStruct(i interface{}, query string, args ...interface{}) (bool, error) {
	return d.ScanStructContext(context.Background(), i, query, args...)
}