Documentation
¶
Index ¶
- Variables
- func DoMigration(logger logging.Logger, dbURL, devDbURL *url.URL, DesiredURLs []*url.URL) error
- func GetDatabaseURL(env config.Env) (*url.URL, error)
- func GetDevDatabaseURL(env config.Env) (*url.URL, error)
- func GetSchemaURL() []*url.URL
- type Database
- func (db Database) Begin(ctx context.Context) (pgx.Tx, error)
- func (db Database) Exec(ctx context.Context, sql string, args ...interface{}) (pgconn.CommandTag, error)
- func (db Database) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
- func (db Database) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
- type Tx
- func (tx *Tx) Begin(ctx context.Context) (pgx.Tx, error)
- func (tx *Tx) Commit(ctx context.Context) error
- func (tx *Tx) Conn() *pgx.Conn
- func (tx *Tx) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error)
- func (tx *Tx) Exec(ctx context.Context, sql string, args ...interface{}) (pgconn.CommandTag, error)
- func (tx *Tx) LargeObjects() pgx.LargeObjects
- func (tx *Tx) Prepare(ctx context.Context, name string, sql string) (*pgconn.StatementDescription, error)
- func (tx *Tx) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
- func (tx *Tx) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
- func (tx *Tx) Rollback(ctx context.Context) error
- func (tx *Tx) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Provide(NewDatabase)
Functions ¶
func DoMigration ¶
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database structure
func NewDatabase ¶
func NewDatabase(lx fx.Lifecycle, logger logging.Logger, env config.Env) (*Database, repository.DBTX)
NewDatabase Saves a new database instance
type Tx ¶ added in v0.1.1
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) LargeObjects ¶ added in v0.1.1
func (tx *Tx) LargeObjects() pgx.LargeObjects
Click to show internal directories.
Click to hide internal directories.