Documentation
¶
Index ¶
- func NewBunDBService(ctx context.Context, state *state.State) (db.DB, error)
- type DBService
- 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 ¶
type DBService struct {
db.Account
db.Admin
db.AdvancedMigration
db.Application
db.Basic
db.Conversation
db.Domain
db.Emoji
db.HeaderFilter
db.Instance
db.Interaction
db.Filter
db.List
db.Marker
db.Media
db.Mention
db.Move
db.Notification
db.Poll
db.Relationship
db.Report
db.Rule
db.ScheduledStatus
db.Search
db.Session
db.SinBinStatus
db.Status
db.StatusBookmark
db.StatusEdit
db.StatusFave
db.Tag
db.Thread
db.Timeline
db.User
db.Tombstone
db.WebPush
db.WorkerTask
// contains filtered or unexported fields
}
DBService satisfies the DB interface
type UpsertQuery ¶
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 ¶
func NewUpsert(idb bun.IDB) *UpsertQuery
func (*UpsertQuery) Column ¶
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 ¶
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) Model ¶
func (u *UpsertQuery) Model(model interface{}) *UpsertQuery
Model sets the model or models to upsert.
Source Files
¶
- account.go
- admin.go
- advancedmigration.go
- application.go
- basic.go
- bundb.go
- conversation.go
- domain.go
- domainpermissiondraft.go
- domainpermissionexclude.go
- domainpermissionsubscription.go
- driver_postgres.go
- driver_sqlite.go
- emoji.go
- filter.go
- filterkeyword.go
- filterstatus.go
- headerfilter.go
- hook.go
- instance.go
- interaction.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_mute.go
- relationship_note.go
- report.go
- rule.go
- scheduledstatus.go
- search.go
- session.go
- sinbinstatus.go
- status.go
- statusbookmark.go
- statusedit.go
- statusfave.go
- tag.go
- thread.go
- timeline.go
- tombstone.go
- upsert.go
- user.go
- util.go
- webpush.go
- workertask.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. |