Documentation ¶
Index ¶
- func NewBunDBService(ctx context.Context, state *state.State) (db.DB, error)
- type DBService
- type PostgreSQLConn
- func (c *PostgreSQLConn) Begin() (driver.Tx, error)
- func (c *PostgreSQLConn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)
- func (c *PostgreSQLConn) Close() error
- func (c *PostgreSQLConn) Exec(query string, args []driver.Value) (driver.Result, error)
- func (c *PostgreSQLConn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error)
- func (c *PostgreSQLConn) Prepare(query string) (driver.Stmt, error)
- func (c *PostgreSQLConn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)
- func (c *PostgreSQLConn) Query(query string, args []driver.Value) (driver.Rows, error)
- func (c *PostgreSQLConn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)
- type PostgreSQLDriver
- type PostgreSQLStmt
- func (stmt *PostgreSQLStmt) Exec(args []driver.Value) (driver.Result, error)
- func (stmt *PostgreSQLStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)
- func (stmt *PostgreSQLStmt) Query(args []driver.Value) (driver.Rows, error)
- func (stmt *PostgreSQLStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)
- type PostgreSQLTx
- type SQLiteConn
- func (c *SQLiteConn) Begin() (driver.Tx, error)
- func (c *SQLiteConn) BeginTx(ctx context.Context, opts driver.TxOptions) (tx driver.Tx, err error)
- func (c *SQLiteConn) Close() error
- func (c *SQLiteConn) Exec(query string, args []driver.Value) (driver.Result, error)
- func (c *SQLiteConn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (result driver.Result, err error)
- func (c *SQLiteConn) Prepare(query string) (driver.Stmt, error)
- func (c *SQLiteConn) PrepareContext(ctx context.Context, query string) (st driver.Stmt, err error)
- func (c *SQLiteConn) Query(query string, args []driver.Value) (driver.Rows, error)
- func (c *SQLiteConn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (rows driver.Rows, err error)
- type SQLiteDriver
- type SQLiteStmt
- func (stmt *SQLiteStmt) Exec(args []driver.Value) (driver.Result, error)
- func (stmt *SQLiteStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (res driver.Result, err error)
- func (stmt *SQLiteStmt) Query(args []driver.Value) (driver.Rows, error)
- func (stmt *SQLiteStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (rows driver.Rows, err error)
- type SQLiteTx
- type UpsertQuery
- func (u *UpsertQuery) Column(columns ...string) *UpsertQuery
- func (u *UpsertQuery) Constraint(constraints ...string) *UpsertQuery
- func (u *UpsertQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (u *UpsertQuery) Model(model interface{}) *UpsertQuery
- func (u *UpsertQuery) Scan(ctx context.Context, dest ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBunDBService ¶
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
type DBService struct { db.Account db.Admin db.Application db.Basic db.Domain db.Emoji db.HeaderFilter db.Instance db.Filter db.List db.Marker db.Media db.Mention db.Move db.Notification db.Poll db.Relationship db.Report db.Rule db.Search db.Session db.Status db.StatusBookmark db.StatusFave db.Tag db.Thread db.Timeline db.User db.Tombstone // contains filtered or unexported fields }
DBService satisfies the DB interface
type PostgreSQLConn ¶ added in v0.14.0
type PostgreSQLConn struct {
// contains filtered or unexported fields
}
func (*PostgreSQLConn) Close ¶ added in v0.14.0
func (c *PostgreSQLConn) Close() 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 (*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.
type PostgreSQLStmt ¶ added in v0.14.0
type PostgreSQLStmt struct {
// contains filtered or unexported fields
}
func (*PostgreSQLStmt) ExecContext ¶ added in v0.14.0
func (stmt *PostgreSQLStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, 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
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) Close ¶ added in v0.14.0
func (c *SQLiteConn) Close() 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 (*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.
type SQLiteStmt ¶ added in v0.14.0
type SQLiteStmt struct {
// contains filtered or unexported fields
}
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) QueryContext ¶ added in v0.14.0
func (stmt *SQLiteStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (rows driver.Rows, err error)
type UpsertQuery ¶ added in v0.15.0
type UpsertQuery struct {
// contains filtered or unexported fields
}
UpsertQuery is a wrapper around an insert query that can update if an insert fails. Doesn't implement the full set of Bun query methods, but we can add more if we need them. See https://bun.uptrace.dev/guide/query-insert.html#upsert
func NewUpsert ¶ added in v0.15.0
func NewUpsert(idb bun.IDB) *UpsertQuery
func (*UpsertQuery) Column ¶ added in v0.15.0
func (u *UpsertQuery) Column(columns ...string) *UpsertQuery
Column sets the columns to update if an insert does't happen. If empty, all columns not being used for constraints will be updated. Cannot overlap with Constraint.
func (*UpsertQuery) Constraint ¶ added in v0.15.0
func (u *UpsertQuery) Constraint(constraints ...string) *UpsertQuery
Constraint sets the columns or indexes that are used to check for conflicts. This is required.
func (*UpsertQuery) Exec ¶ added in v0.15.0
Exec builds a Bun insert query from the upsert query, and executes it.
func (*UpsertQuery) Model ¶ added in v0.15.0
func (u *UpsertQuery) Model(model interface{}) *UpsertQuery
Model sets the model or models to upsert.
Source Files ¶
- account.go
- admin.go
- application.go
- basic.go
- bundb.go
- domain.go
- drivers.go
- emoji.go
- errors.go
- filter.go
- filterkeyword.go
- filterstatus.go
- headerfilter.go
- hook.go
- instance.go
- list.go
- marker.go
- media.go
- mention.go
- move.go
- notification.go
- poll.go
- relationship.go
- relationship_block.go
- relationship_follow.go
- relationship_follow_req.go
- relationship_note.go
- report.go
- rule.go
- search.go
- session.go
- status.go
- statusbookmark.go
- statusfave.go
- tag.go
- thread.go
- timeline.go
- tombstone.go
- upsert.go
- user.go
- util.go
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. |