query

package
v2.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatPlaceholders added in v2.0.6

func FormatPlaceholders(sql string, dialect dialect.Dialect) string

FormatPlaceholders converts ? placeholders to driver-specific format.

Types

type ConnectionInterface added in v2.0.3

type ConnectionInterface interface {
	// Dialect returns the SQL dialect for placeholder formatting and feature support
	Dialect() dialect.Dialect

	// Logger returns the logger for SQL statement tracing (may be nil)
	Logger() *slog.Logger

	// Context returns the connection context
	Context() context.Context

	// ExecuteContext runs a SQL statement
	ExecuteContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

	// QueryRowContext executes a query that returns a single row
	QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row

	// QueryRowsContext executes a query that returns multiple rows
	QueryRowsContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

	// GetTableName extracts the table name from a table object
	GetTableName(tbl interface{}) string

	// GetTableColumns extracts column references from a table object
	GetTableColumns(tbl interface{}) []*table.ColumnRef
}

ConnectionInterface defines the methods required by query builders. Builders should depend on this interface rather than directly on Engine or Connection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL