Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶ added in v0.11.4
Conn wraps a pgx.Conn.
Example ¶
ctx := context.Background() conn, err := pgx.Connect(ctx, "test") if err != nil { panic(err) } // wrap *pgx.Conn instance dconn := lpgx.NewConn(conn) query := psql.Select( sm.Columns("film_id", "title", "length"), sm.From("film"), sm.WhereClause("length > ?", sq.NamedArg("length")), sm.Limit(10), ) // generate SQL string from litsql and execute it, replacing named parameters. rows, err := dconn.Query(ctx, query, sq.MapArgValues{ "length": 90, }) if err != nil { panic(err) } defer rows.Close() for rows.Next() { var film_id, length int var title string err = rows.Scan(&film_id, &title, &length) if err != nil { panic(err) } } if rows.Err() != nil { panic(err) }
Output:
type Option ¶
func WithQueryHandler ¶
type Pool ¶ added in v0.11.4
Pool wraps a pgxpool.Pool.
type PoolConn ¶ added in v0.11.5
PoolConn wraps a pgxpool.Conn.
func NewPoolConn ¶ added in v0.11.5
NewPoolConn wraps a pgxpool.Conn.
type QuerierConn ¶ added in v0.11.4
type QuerierConn = lpgxt.QuerierConn[*pgx.Conn]
type QuerierPool ¶ added in v0.11.4
type QuerierPool = lpgxt.QuerierPool
type QuerierPoolConn ¶ added in v0.11.5
type QuerierPoolConn = lpgxt.QuerierPoolConn
type QuerierStmt ¶
type QuerierStmt = lpgxt.QuerierStmt
Click to show internal directories.
Click to hide internal directories.