package
0.63.0
Repository: https://github.com/rickb777/sqlapi.git
Documentation: pkg.go.dev

# Packages

Package constraint provides types and methods to support foreign-key relationshipd between database tables.
Package logadapter provides a logger that writes to a log.Logger log.
No description provided by the author
Package vanilla provides a re-usable table API.

# Functions

Connect opens a database connection and pings the server.
ConnectEnv connects to the PostgreSQL server using environment variables: PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE, PGCONNECT_TIMEOUT, PGSSLMODE, PGSSLKEY, PGSSLCERT, PGSSLROOTCERT.
ListTables gets all the table names in the database/schema.
MustConnect is as per Connect but with a fatal termination on error.
MustConnectEnv is as per ConnectEnv but with a fatal termination on error.
Named creates NamedArg values; it is synonymous with sql.Named().
NamedArgString converts the argument to a string of the form "name=value".
No description provided by the author
No description provided by the author
ParseEnvConfig creates connection pool config information based on environment variables: PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE, PGCONNECT_TIMEOUT, PGSSLMODE, PGSSLKEY, PGSSLCERT, PGSSLROOTCERT.
WrapDB wraps a *pgx.ConnPool as SqlDB.
WrapRows wraps a *sql.Rows result so that its data can be scanned into a series of maps, one for each row.

# Structs

CoreTable implements a Table.
RowData holds a single row result from the database.
Rows provides a tool for scanning result *sql.Rows of arbitrary or varying length.
TableName holds a two-part name.

# Interfaces

CanPostGet is implemented by value types that need a hook to run just after their data is fetched from the database.
CanPreInsert is implemented by value types that need a hook to run just before their data is inserted into the database.
CanPreUpdate is implemented by value types that need a hook to run just before their data is updated in the database.
Execer is a precis of *pgx.ConnPool and *pgx.Tx.
Getter provides the core methods for reading information from databases.
Logger provides the specialised logging operations within this API.
SqlDB is able to make queries and begin transactions.
SqlRow is a precis of *sql.Row.
SqlRows is a precis of pgx.Rows.
SqlTx is a precis of *pgx.Tx.
No description provided by the author
Table provides the generic features of each generated table handler.
TableCreator is a table with create/delete/truncate methods.
TableWithIndexes is a table creator with create/delete methods for the indexes.

# Type aliases

No description provided by the author
NamedArgList holds a slice of NamedArgs.