bundb

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2024 License: AGPL-3.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBunDBService

func NewBunDBService(ctx context.Context, state *state.State) (db.DB, error)

NewBunDBService returns a bunDB derived from the provided config, which implements the go-fed DB interface. Under the hood, it uses https://github.com/uptrace/bun to create and maintain a database connection.

Types

type DBService added in v0.5.0

DBService satisfies the DB interface

func (*DBService) DB added in v0.11.0

func (dbService *DBService) DB() *bun.DB

GetDB returns the underlying database connection pool. Should only be used in testing + exceptional circumstance.

type PostgreSQLConn added in v0.14.0

type PostgreSQLConn struct {
	// contains filtered or unexported fields
}

func (*PostgreSQLConn) Begin added in v0.14.0

func (c *PostgreSQLConn) Begin() (driver.Tx, error)

func (*PostgreSQLConn) BeginTx added in v0.14.0

func (c *PostgreSQLConn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)

func (*PostgreSQLConn) Close added in v0.14.0

func (c *PostgreSQLConn) Close() error

func (*PostgreSQLConn) Exec added in v0.14.0

func (c *PostgreSQLConn) Exec(query string, args []driver.Value) (driver.Result, error)

func (*PostgreSQLConn) ExecContext added in v0.14.0

func (c *PostgreSQLConn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error)

func (*PostgreSQLConn) Prepare added in v0.14.0

func (c *PostgreSQLConn) Prepare(query string) (driver.Stmt, error)

func (*PostgreSQLConn) PrepareContext added in v0.14.0

func (c *PostgreSQLConn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)

func (*PostgreSQLConn) Query added in v0.14.0

func (c *PostgreSQLConn) Query(query string, args []driver.Value) (driver.Rows, error)

func (*PostgreSQLConn) QueryContext added in v0.14.0

func (c *PostgreSQLConn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)

type PostgreSQLDriver added in v0.14.0

type PostgreSQLDriver struct{}

PostgreSQLDriver is our own wrapper around the pgx/stdlib.Driver{} type in order to wrap further SQL driver types with our own err processing.

func (*PostgreSQLDriver) Open added in v0.14.0

func (d *PostgreSQLDriver) Open(name string) (driver.Conn, error)

type PostgreSQLStmt added in v0.14.0

type PostgreSQLStmt struct {
	// contains filtered or unexported fields
}

func (*PostgreSQLStmt) Exec added in v0.14.0

func (stmt *PostgreSQLStmt) Exec(args []driver.Value) (driver.Result, error)

func (*PostgreSQLStmt) ExecContext added in v0.14.0

func (stmt *PostgreSQLStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)

func (*PostgreSQLStmt) Query added in v0.14.0

func (stmt *PostgreSQLStmt) Query(args []driver.Value) (driver.Rows, error)

func (*PostgreSQLStmt) QueryContext added in v0.14.0

func (stmt *PostgreSQLStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)

type PostgreSQLTx added in v0.14.0

type PostgreSQLTx struct{ driver.Tx }

func (*PostgreSQLTx) Commit added in v0.14.0

func (tx *PostgreSQLTx) Commit() error

func (*PostgreSQLTx) Rollback added in v0.14.0

func (tx *PostgreSQLTx) Rollback() error

type SQLiteConn added in v0.14.0

type SQLiteConn struct {
	// contains filtered or unexported fields
}

func (*SQLiteConn) Begin added in v0.14.0

func (c *SQLiteConn) Begin() (driver.Tx, error)

func (*SQLiteConn) BeginTx added in v0.14.0

func (c *SQLiteConn) BeginTx(ctx context.Context, opts driver.TxOptions) (tx driver.Tx, err error)

func (*SQLiteConn) Close added in v0.14.0

func (c *SQLiteConn) Close() error

func (*SQLiteConn) Exec added in v0.14.0

func (c *SQLiteConn) Exec(query string, args []driver.Value) (driver.Result, error)

func (*SQLiteConn) ExecContext added in v0.14.0

func (c *SQLiteConn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (result driver.Result, err error)

func (*SQLiteConn) Prepare added in v0.14.0

func (c *SQLiteConn) Prepare(query string) (driver.Stmt, error)

func (*SQLiteConn) PrepareContext added in v0.14.0

func (c *SQLiteConn) PrepareContext(ctx context.Context, query string) (st driver.Stmt, err error)

func (*SQLiteConn) Query added in v0.14.0

func (c *SQLiteConn) Query(query string, args []driver.Value) (driver.Rows, error)

func (*SQLiteConn) QueryContext added in v0.14.0

func (c *SQLiteConn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (rows driver.Rows, err error)

type SQLiteDriver added in v0.14.0

type SQLiteDriver struct{}

SQLiteDriver is our own wrapper around the sqlite.Driver{} type in order to wrap further SQL driver types with our own functionality, e.g. hooks, retries and err processing.

func (*SQLiteDriver) Open added in v0.14.0

func (d *SQLiteDriver) Open(name string) (driver.Conn, error)

type SQLiteStmt added in v0.14.0

type SQLiteStmt struct {
	// contains filtered or unexported fields
}

func (*SQLiteStmt) Exec added in v0.14.0

func (stmt *SQLiteStmt) Exec(args []driver.Value) (driver.Result, error)

func (*SQLiteStmt) ExecContext added in v0.14.0

func (stmt *SQLiteStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (res driver.Result, err error)

func (*SQLiteStmt) Query added in v0.14.0

func (stmt *SQLiteStmt) Query(args []driver.Value) (driver.Rows, error)

func (*SQLiteStmt) QueryContext added in v0.14.0

func (stmt *SQLiteStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (rows driver.Rows, err error)

type SQLiteTx added in v0.14.0

type SQLiteTx struct {
	context.Context
	driver.Tx
}

func (*SQLiteTx) Commit added in v0.14.0

func (tx *SQLiteTx) Commit() (err error)

func (*SQLiteTx) Rollback added in v0.14.0

func (tx *SQLiteTx) Rollback() (err error)

Directories

Path Synopsis
20211113114307_init
Package gtsmodel contains types used *internally* by GoToSocial and added/removed/selected from the database.
Package gtsmodel contains types used *internally* by GoToSocial and added/removed/selected from the database.
20220214175650_media_cleanup
Package gtsmodel contains types used *internally* by GoToSocial and added/removed/selected from the database.
Package gtsmodel contains types used *internally* by GoToSocial and added/removed/selected from the database.
20220315160814_admin_account_actions
Package gtsmodel contains types used *internally* by GoToSocial and added/removed/selected from the database.
Package gtsmodel contains types used *internally* by GoToSocial and added/removed/selected from the database.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL