Documentation ¶
Index ¶
- func Close(db DB) error
- func Connect(db DB) error
- func MigrateDown(database *sql.DB, logger logger.Logger, files fs.FS)
- func MigrateFixDown(database *sql.DB, logger logger.Logger, files fs.FS, ver int)
- func MigrateFixUp(database *sql.DB, logger logger.Logger, files fs.FS, ver int)
- func MigrateUp(database *sql.DB, logger logger.Logger, files fs.FS)
- func NewPostgresDB(logger logger.Logger) (*sql.DB, error)
- type DB
- type DBLogger
- func (d DBLogger) Begin() (*sql.Tx, error)
- func (d DBLogger) Close() error
- func (d DBLogger) Exec(query string, args ...interface{}) (sql.Result, error)
- func (d DBLogger) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (d DBLogger) Ping() error
- func (d DBLogger) Prepare(query string) (*sql.Stmt, error)
- func (d DBLogger) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
- func (d DBLogger) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (d DBLogger) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (d DBLogger) QueryRow(query string, args ...interface{}) *sql.Row
- func (d DBLogger) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- type PostgresListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateFixDown ¶
Types ¶
type DB ¶
type DB interface { Close() error Ping() error Exec(query string, args ...interface{}) (sql.Result, error) Query(query string, args ...interface{}) (*sql.Rows, error) QueryRow(query string, args ...interface{}) *sql.Row Prepare(query string) (*sql.Stmt, error) Begin() (*sql.Tx, error) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) }
type DBLogger ¶
func (DBLogger) ExecContext ¶
func (DBLogger) PrepareContext ¶
func (DBLogger) QueryContext ¶
type PostgresListener ¶
type PostgresListener struct { Callbacks map[string]func(data string) Listener *pq.Listener // contains filtered or unexported fields }
func NewPostgresListner ¶
func NewPostgresListner(logger logger.Logger) *PostgresListener
func (*PostgresListener) Close ¶
func (p *PostgresListener) Close()
func (*PostgresListener) Listen ¶
func (p *PostgresListener) Listen(channel string, callback func(data string))
func (*PostgresListener) Ping ¶
func (p *PostgresListener) Ping()
func (*PostgresListener) Start ¶
func (p *PostgresListener) Start()
func (*PostgresListener) Unlisten ¶
func (p *PostgresListener) Unlisten(channel string)
Click to show internal directories.
Click to hide internal directories.