func (q *DBQuerier) BadEnumNameScan(results pgx.BatchResults) (UnnamedEnum123, error) {
	row := results.QueryRow()
	var item UnnamedEnum123
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("scan BadEnumNameBatch row: %w", err)
	}
	return item, nil
}
BadEnumNameScan implements Querier.BadEnumNameScan.
package syntax
import (
	"context"
	"fmt"
	"github.com/jackc/pgconn"
	"github.com/jackc/pgtype"
	"github.com/jackc/pgx/v4"
)
type Querier interface {
	Backtick(ctx context.Context) (string, error)
	BacktickBatch(batch genericBatch)
	BacktickScan(results pgx.BatchResults) (string, error)
	BacktickQuoteBacktick(ctx context.Context) (string, error)
	BacktickQuoteBacktickBatch(batch genericBatch)
	BacktickQuoteBacktickScan(results pgx.BatchResults) (string, error)
	BacktickNewline(ctx context.Context) (string, error)
	BacktickNewlineBatch(batch genericBatch)
	BacktickNewlineScan(results pgx.BatchResults) (string, error)
	BacktickDoubleQuote(ctx context.Context) (string, error)
	BacktickDoubleQuoteBatch(batch genericBatch)
	BacktickDoubleQuoteScan(results pgx.BatchResults) (string, error)
	BacktickBackslashN(ctx context.Context) (string, error)
	BacktickBackslashNBatch(batch genericBatch)
	BacktickBackslashNScan(results pgx.BatchResults) (string, error)
	IllegalNameSymbols(ctx context.Context, helloWorld string) (IllegalNameSymbolsRow, error)
	IllegalNameSymbolsBatch(batch genericBatch, helloWorld string)
	IllegalNameSymbolsScan(results pgx.BatchResults) (IllegalNameSymbolsRow, error)
	SpaceAfter(ctx context.Context, space string) (string, error)
	SpaceAfterBatch(batch genericBatch, space string)
	SpaceAfterScan(results pgx.BatchResults) (string, error)
	BadEnumName(ctx context.Context) (UnnamedEnum123, error)
	BadEnumNameBatch(batch genericBatch)
	BadEnumNameScan(results pgx.BatchResults) (UnnamedEnum123, error)
	GoKeyword(ctx context.Context, go_ string) (string, error)
	GoKeywordBatch(batch genericBatch, go_ string)
	GoKeywordScan(results pgx.BatchResults) (string, error)
}
type DBQuerier struct {
	conn  genericConn    
	types *typeResolver  
}
var _ Querier = &DBQuerier{}
type genericConn interface {
	Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
	Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
}
type genericBatch interface {
	Queue(query string, arguments ...interface{})
}
func NewQuerier(conn genericConn) *DBQuerier {
	return NewQuerierConfig(conn, QuerierConfig{})
}
type QuerierConfig struct {
	DataTypes []pgtype.DataType
}
func NewQuerierConfig(conn genericConn, cfg QuerierConfig) *DBQuerier {
	return &DBQuerier{conn: conn, types: newTypeResolver(cfg.DataTypes)}
}
func (q *DBQuerier) WithTx(tx pgx.Tx) (*DBQuerier, error) {
	return &DBQuerier{conn: tx}, nil
}
type preparer interface {
	Prepare(ctx context.Context, name, sql string) (sd *pgconn.StatementDescription, err error)
}
func PrepareAllQueries(ctx context.Context, p preparer) error {
	if _, err := p.Prepare(ctx, backtickSQL, backtickSQL); err != nil {
		return fmt.Errorf("prepare query 'Backtick': %w", err)
	}
	if _, err := p.Prepare(ctx, backtickQuoteBacktickSQL, backtickQuoteBacktickSQL); err != nil {
		return fmt.Errorf("prepare query 'BacktickQuoteBacktick': %w", err)
	}
	if _, err := p.Prepare(ctx, backtickNewlineSQL, backtickNewlineSQL); err != nil {
		return fmt.Errorf("prepare query 'BacktickNewline': %w", err)
	}
	if _, err := p.Prepare(ctx, backtickDoubleQuoteSQL, backtickDoubleQuoteSQL); err != nil {
		return fmt.Errorf("prepare query 'BacktickDoubleQuote': %w", err)
	}
	if _, err := p.Prepare(ctx, backtickBackslashNSQL, backtickBackslashNSQL); err != nil {
		return fmt.Errorf("prepare query 'BacktickBackslashN': %w", err)
	}
	if _, err := p.Prepare(ctx, illegalNameSymbolsSQL, illegalNameSymbolsSQL); err != nil {
		return fmt.Errorf("prepare query 'IllegalNameSymbols': %w", err)
	}
	if _, err := p.Prepare(ctx, spaceAfterSQL, spaceAfterSQL); err != nil {
		return fmt.Errorf("prepare query 'SpaceAfter': %w", err)
	}
	if _, err := p.Prepare(ctx, badEnumNameSQL, badEnumNameSQL); err != nil {
		return fmt.Errorf("prepare query 'BadEnumName': %w", err)
	}
	if _, err := p.Prepare(ctx, goKeywordSQL, goKeywordSQL); err != nil {
		return fmt.Errorf("prepare query 'GoKeyword': %w", err)
	}
	return nil
}
type UnnamedEnum123 string
const (
	UnnamedEnum123InconvertibleEnumName UnnamedEnum123 = "inconvertible_enum_name"
	UnnamedEnum123UnnamedLabel1         UnnamedEnum123 = ""
	UnnamedEnum123UnnamedLabel2111      UnnamedEnum123 = "111"
	UnnamedEnum123UnnamedLabel3         UnnamedEnum123 = "!!"
)
func (u UnnamedEnum123) String() string { return string(u) }
type typeResolver struct {
	connInfo *pgtype.ConnInfo  
}
func newTypeResolver(types []pgtype.DataType) *typeResolver {
	ci := pgtype.NewConnInfo()
	for _, typ := range types {
		if txt, ok := typ.Value.(textPreferrer); ok && typ.OID != unknownOID {
			typ.Value = txt.ValueTranscoder
		}
		ci.RegisterDataType(typ)
	}
	return &typeResolver{connInfo: ci}
}
func (tr *typeResolver) findValue(name string) (uint32, pgtype.ValueTranscoder, bool) {
	typ, ok := tr.connInfo.DataTypeForName(name)
	if !ok {
		return 0, nil, false
	}
	v := pgtype.NewValue(typ.Value)
	return typ.OID, v.(pgtype.ValueTranscoder), true
}
func (tr *typeResolver) setValue(vt pgtype.ValueTranscoder, val interface{}) pgtype.ValueTranscoder {
	if err := vt.Set(val); err != nil {
		panic(fmt.Sprintf("set ValueTranscoder %T to %+v: %s", vt, val, err))
	}
	return vt
}
const backtickSQL = "SELECT '`';"
func (q *DBQuerier) Backtick(ctx context.Context) (string, error) {
	ctx = context.WithValue(ctx, "pggen_query_name", "Backtick")
	row := q.conn.QueryRow(ctx, backtickSQL)
	var item string
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("query Backtick: %w", err)
	}
	return item, nil
}
func (q *DBQuerier) BacktickBatch(batch genericBatch) {
	batch.Queue(backtickSQL)
}
func (q *DBQuerier) BacktickScan(results pgx.BatchResults) (string, error) {
	row := results.QueryRow()
	var item string
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("scan BacktickBatch row: %w", err)
	}
	return item, nil
}
const backtickQuoteBacktickSQL = "SELECT '`\"`';"
func (q *DBQuerier) BacktickQuoteBacktick(ctx context.Context) (string, error) {
	ctx = context.WithValue(ctx, "pggen_query_name", "BacktickQuoteBacktick")
	row := q.conn.QueryRow(ctx, backtickQuoteBacktickSQL)
	var item string
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("query BacktickQuoteBacktick: %w", err)
	}
	return item, nil
}
func (q *DBQuerier) BacktickQuoteBacktickBatch(batch genericBatch) {
	batch.Queue(backtickQuoteBacktickSQL)
}
func (q *DBQuerier) BacktickQuoteBacktickScan(results pgx.BatchResults) (string, error) {
	row := results.QueryRow()
	var item string
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("scan BacktickQuoteBacktickBatch row: %w", err)
	}
	return item, nil
}
const backtickNewlineSQL = "SELECT '`\n';"
func (q *DBQuerier) BacktickNewline(ctx context.Context) (string, error) {
	ctx = context.WithValue(ctx, "pggen_query_name", "BacktickNewline")
	row := q.conn.QueryRow(ctx, backtickNewlineSQL)
	var item string
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("query BacktickNewline: %w", err)
	}
	return item, nil
}
func (q *DBQuerier) BacktickNewlineBatch(batch genericBatch) {
	batch.Queue(backtickNewlineSQL)
}
func (q *DBQuerier) BacktickNewlineScan(results pgx.BatchResults) (string, error) {
	row := results.QueryRow()
	var item string
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("scan BacktickNewlineBatch row: %w", err)
	}
	return item, nil
}
const backtickDoubleQuoteSQL = "SELECT '`\"';"
func (q *DBQuerier) BacktickDoubleQuote(ctx context.Context) (string, error) {
	ctx = context.WithValue(ctx, "pggen_query_name", "BacktickDoubleQuote")
	row := q.conn.QueryRow(ctx, backtickDoubleQuoteSQL)
	var item string
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("query BacktickDoubleQuote: %w", err)
	}
	return item, nil
}
func (q *DBQuerier) BacktickDoubleQuoteBatch(batch genericBatch) {
	batch.Queue(backtickDoubleQuoteSQL)
}
func (q *DBQuerier) BacktickDoubleQuoteScan(results pgx.BatchResults) (string, error) {
	row := results.QueryRow()
	var item string
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("scan BacktickDoubleQuoteBatch row: %w", err)
	}
	return item, nil
}
const backtickBackslashNSQL = "SELECT '`\\n';"
func (q *DBQuerier) BacktickBackslashN(ctx context.Context) (string, error) {
	ctx = context.WithValue(ctx, "pggen_query_name", "BacktickBackslashN")
	row := q.conn.QueryRow(ctx, backtickBackslashNSQL)
	var item string
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("query BacktickBackslashN: %w", err)
	}
	return item, nil
}
func (q *DBQuerier) BacktickBackslashNBatch(batch genericBatch) {
	batch.Queue(backtickBackslashNSQL)
}
func (q *DBQuerier) BacktickBackslashNScan(results pgx.BatchResults) (string, error) {
	row := results.QueryRow()
	var item string
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("scan BacktickBackslashNBatch row: %w", err)
	}
	return item, nil
}
const illegalNameSymbolsSQL = "SELECT '`\\n' as \"$\", $1 as \"foo.bar!@#$%&*()\"\"--+\";"
type IllegalNameSymbolsRow struct {
	UnnamedColumn0 string `json:"$"`
	FooBar         string `json:"foo.bar!@#$%&*()\"--+"`
}
func (q *DBQuerier) IllegalNameSymbols(ctx context.Context, helloWorld string) (IllegalNameSymbolsRow, error) {
	ctx = context.WithValue(ctx, "pggen_query_name", "IllegalNameSymbols")
	row := q.conn.QueryRow(ctx, illegalNameSymbolsSQL, helloWorld)
	var item IllegalNameSymbolsRow
	if err := row.Scan(&item.UnnamedColumn0, &item.FooBar); err != nil {
		return item, fmt.Errorf("query IllegalNameSymbols: %w", err)
	}
	return item, nil
}
func (q *DBQuerier) IllegalNameSymbolsBatch(batch genericBatch, helloWorld string) {
	batch.Queue(illegalNameSymbolsSQL, helloWorld)
}
func (q *DBQuerier) IllegalNameSymbolsScan(results pgx.BatchResults) (IllegalNameSymbolsRow, error) {
	row := results.QueryRow()
	var item IllegalNameSymbolsRow
	if err := row.Scan(&item.UnnamedColumn0, &item.FooBar); err != nil {
		return item, fmt.Errorf("scan IllegalNameSymbolsBatch row: %w", err)
	}
	return item, nil
}
const spaceAfterSQL = `SELECT $1;`
func (q *DBQuerier) SpaceAfter(ctx context.Context, space string) (string, error) {
	ctx = context.WithValue(ctx, "pggen_query_name", "SpaceAfter")
	row := q.conn.QueryRow(ctx, spaceAfterSQL, space)
	var item string
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("query SpaceAfter: %w", err)
	}
	return item, nil
}
func (q *DBQuerier) SpaceAfterBatch(batch genericBatch, space string) {
	batch.Queue(spaceAfterSQL, space)
}
func (q *DBQuerier) SpaceAfterScan(results pgx.BatchResults) (string, error) {
	row := results.QueryRow()
	var item string
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("scan SpaceAfterBatch row: %w", err)
	}
	return item, nil
}
const badEnumNameSQL = `SELECT 'inconvertible_enum_name'::"123";`
func (q *DBQuerier) BadEnumName(ctx context.Context) (UnnamedEnum123, error) {
	ctx = context.WithValue(ctx, "pggen_query_name", "BadEnumName")
	row := q.conn.QueryRow(ctx, badEnumNameSQL)
	var item UnnamedEnum123
	if err := row.Scan(&item); err != nil {
		return item, fmt.Errorf("query BadEnumName: %w", err)
	}
	return item, nil
}
func (q *DBQuerier) BadEnumNameBatch(batch genericBatch) {
	batch.Queue(badEnumNameSQL)
}