Documentation ¶
Index ¶
- func NewBunDBService(ctx context.Context) (db.DB, error)
- type DBConn
- func (conn *DBConn) Exists(ctx context.Context, query *bun.SelectQuery) (bool, db.Error)
- func (conn *DBConn) NotExists(ctx context.Context, query *bun.SelectQuery) (bool, db.Error)
- func (conn *DBConn) ProcessError(err error) db.Error
- func (conn *DBConn) RunInTx(ctx context.Context, fn func(bun.Tx) error) db.Error
- type DBService
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 DBConn ¶
type DBConn struct { *bun.DB // DB is the underlying bun.DB connection // contains filtered or unexported fields }
DBConn wrapps a bun.DB conn to provide SQL-type specific additional functionality
func WrapDBConn ¶
WrapDBConn wraps a bun DB connection to provide our own error processing dependent on DB dialect.
func (*DBConn) Exists ¶
Exists checks the results of a SelectQuery for the existence of the data in question, masking ErrNoEntries errors
func (*DBConn) ProcessError ¶
ProcessError processes an error to replace any known values with our own db.Error types, making it easier to catch specific situations (e.g. no rows, already exists, etc)
type DBService ¶ added in v0.5.0
type DBService struct { db.Account db.Admin db.Basic db.Domain db.Emoji db.Instance db.Media db.Mention db.Notification db.Relationship db.Session db.Status db.Timeline // contains filtered or unexported fields }
DBService satisfies the DB interface
Source Files ¶
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. |