Documentation ¶
Overview ¶
Package sqlexec provides primitives and functions to work with raw SQL statements and pre-defined SQL Scripts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PathDriver ¶
PathDriver returns the driver name from a given path
Types ¶
type FileSystem ¶
type FileSystem = parcello.FileSystem
FileSystem provides with primitives to work with the underlying file system
type Generator ¶
type Generator struct { // FileSystem represents the project directory file system. FileSystem FileSystem }
Generator generates a new command.
type Provider ¶
type Provider struct { // DriverName is the current SQL driver DriverName string // contains filtered or unexported fields }
Provider loads SQL sqlexecs and provides all SQL statements as commands.
func (*Provider) Query ¶
Query returns a query statement for given name and parameters. The operation can err if the command cannot be found.
func (*Provider) ReadDir ¶
func (p *Provider) ReadDir(fs FileSystem) error
ReadDir loads all sqlexec commands from a given directory. Note that all sqlexecs should have .sql extension.
type Rows ¶
Rows is a wrapper around sql.Rows which caches costly reflect operations during a looped StructScan.
type Runner ¶
type Runner struct { // FileSystem represents the project directory file system. FileSystem FileSystem // DB is a client to underlying database. DB *sqlx.DB }
Runner runs a SQL statement for given command name and parameters.