{"modulePath":"github.com/OutOfStack/game-library-auth","version":"v1.3.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package database\n\n## Functions\n\n```go\nfunc New(dsn string) (*sqlx.DB, error)\n```\nNew returns database connection\n\n```go\nfunc TxFromContext(ctx context.Context) (*sqlx.Tx, bool)\n```\nTxFromContext retrieves the transaction from context if present\n\n```go\nfunc WithTx(ctx context.Context, tx *sqlx.Tx) context.Context\n```\nWithTx adds a transaction to the context\n\n## Types\n\n```go\ntype Ex struct {\n\t// contains filtered or unexported fields\n}\n```\nEx wraps db/tx with context\n\n```go\nfunc (e *Ex) Exec(ctx context.Context, query string, args ...any) (sql.Result, error)\n```\nExec executes a query with context\n\n```go\nfunc (e *Ex) Get(ctx context.Context, dest any, query string, args ...any) error\n```\nGet retrieves a single row with context\n\n```go\ntype Executor interface {\n\tExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)\n\tGetContext(ctx context.Context, dest any, query string, args ...any) error\n}\n```\nExecutor represents database/transaction interface\n\n```go\ntype Querier interface {\n\tExec(ctx context.Context, query string, args ...any) (sql.Result, error)\n\tGet(ctx context.Context, dest any, query string, args ...any) error\n}\n```\nQuerier represents types that can execute SQL queries with context already embedded\n\n```go\nfunc NewQuerier(db Executor) Querier\n```\nNewQuerier creates a new Querier\n\n","path":"github.com/OutOfStack/game-library-auth/pkg/database","name":"database","synopsis":"","isRedistributable":true}
