Versions in this module Expand all Collapse all v0 v0.16.0 Apr 28, 2023 Changes in this version + const MaxExpandDepth + type Dao struct + AfterCreateFunc func(eventDao *Dao, m models.Model) + AfterDeleteFunc func(eventDao *Dao, m models.Model) + AfterUpdateFunc func(eventDao *Dao, m models.Model) + BeforeCreateFunc func(eventDao *Dao, m models.Model) error + BeforeDeleteFunc func(eventDao *Dao, m models.Model) error + BeforeUpdateFunc func(eventDao *Dao, m models.Model) error + MaxLockRetries int + ModelQueryTimeout time.Duration + func New(db dbx.Builder) *Dao + func NewMultiDB(concurrentDB, nonconcurrentDB dbx.Builder) *Dao + func (dao *Dao) AdminQuery() *dbx.SelectQuery + func (dao *Dao) Clone() *Dao + func (dao *Dao) CollectionQuery() *dbx.SelectQuery + func (dao *Dao) ConcurrentDB() dbx.Builder + func (dao *Dao) CreateViewSchema(selectQuery string) (schema.Schema, error) + func (dao *Dao) DB() dbx.Builder + func (dao *Dao) Delete(m models.Model) error + func (dao *Dao) DeleteAdmin(admin *models.Admin) error + func (dao *Dao) DeleteCollection(collection *models.Collection) error + func (dao *Dao) DeleteExternalAuth(model *models.ExternalAuth) error + func (dao *Dao) DeleteOldRequests(createdBefore time.Time) error + func (dao *Dao) DeleteParam(param *models.Param) error + func (dao *Dao) DeleteRecord(record *models.Record) error + func (dao *Dao) DeleteTable(tableName string) error + func (dao *Dao) DeleteView(name string) error + func (dao *Dao) ExpandRecord(record *models.Record, expands []string, fetchFunc ExpandFetchFunc) map[string]error + func (dao *Dao) ExpandRecords(records []*models.Record, expands []string, fetchFunc ExpandFetchFunc) map[string]error + func (dao *Dao) ExternalAuthQuery() *dbx.SelectQuery + func (dao *Dao) FindAdminByEmail(email string) (*models.Admin, error) + func (dao *Dao) FindAdminById(id string) (*models.Admin, error) + func (dao *Dao) FindAdminByToken(token string, baseTokenKey string) (*models.Admin, error) + func (dao *Dao) FindAllExternalAuthsByRecord(authRecord *models.Record) ([]*models.ExternalAuth, error) + func (dao *Dao) FindAuthRecordByEmail(collectionNameOrId string, email string) (*models.Record, error) + func (dao *Dao) FindAuthRecordByToken(token string, baseTokenKey string) (*models.Record, error) + func (dao *Dao) FindAuthRecordByUsername(collectionNameOrId string, username string) (*models.Record, error) + func (dao *Dao) FindById(m models.Model, id string) error + func (dao *Dao) FindCollectionByNameOrId(nameOrId string) (*models.Collection, error) + func (dao *Dao) FindCollectionReferences(collection *models.Collection, excludeIds ...string) (map[*models.Collection][]*schema.SchemaField, error) + func (dao *Dao) FindCollectionsByType(collectionType string) ([]*models.Collection, error) + func (dao *Dao) FindExternalAuthByProvider(provider, providerId string) (*models.ExternalAuth, error) + func (dao *Dao) FindExternalAuthByRecordAndProvider(authRecord *models.Record, provider string) (*models.ExternalAuth, error) + func (dao *Dao) FindFirstRecordByData(collectionNameOrId string, key string, value any) (*models.Record, error) + func (dao *Dao) FindParamByKey(key string) (*models.Param, error) + func (dao *Dao) FindRecordById(collectionNameOrId string, recordId string, ...) (*models.Record, error) + func (dao *Dao) FindRecordByViewFile(viewCollectionNameOrId string, fileFieldName string, filename string) (*models.Record, error) + func (dao *Dao) FindRecordsByExpr(collectionNameOrId string, exprs ...dbx.Expression) ([]*models.Record, error) + func (dao *Dao) FindRecordsByIds(collectionNameOrId string, recordIds []string, ...) ([]*models.Record, error) + func (dao *Dao) FindRequestById(id string) (*models.Request, error) + func (dao *Dao) FindSettings(optEncryptionKey ...string) (*settings.Settings, error) + func (dao *Dao) HasTable(tableName string) bool + func (dao *Dao) ImportCollections(importedCollections []*models.Collection, deleteMissing bool, ...) error + func (dao *Dao) IsAdminEmailUnique(email string, excludeIds ...string) bool + func (dao *Dao) IsCollectionNameUnique(name string, excludeIds ...string) bool + func (dao *Dao) IsRecordValueUnique(collectionNameOrId string, key string, value any, excludeIds ...string) bool + func (dao *Dao) ModelQuery(m models.Model) *dbx.SelectQuery + func (dao *Dao) NonconcurrentDB() dbx.Builder + func (dao *Dao) ParamQuery() *dbx.SelectQuery + func (dao *Dao) RecordQuery(collection *models.Collection) *dbx.SelectQuery + func (dao *Dao) RequestQuery() *dbx.SelectQuery + func (dao *Dao) RequestsStats(expr dbx.Expression) ([]*RequestsStatsItem, error) + func (dao *Dao) RunInTransaction(fn func(txDao *Dao) error) error + func (dao *Dao) Save(m models.Model) error + func (dao *Dao) SaveAdmin(admin *models.Admin) error + func (dao *Dao) SaveCollection(collection *models.Collection) error + func (dao *Dao) SaveExternalAuth(model *models.ExternalAuth) error + func (dao *Dao) SaveParam(key string, value any, optEncryptionKey ...string) error + func (dao *Dao) SaveRecord(record *models.Record) error + func (dao *Dao) SaveRequest(request *models.Request) error + func (dao *Dao) SaveSettings(newSettings *settings.Settings, optEncryptionKey ...string) error + func (dao *Dao) SaveView(name string, selectQuery string) error + func (dao *Dao) SuggestUniqueAuthRecordUsername(collectionNameOrId string, baseUsername string, excludeIds ...string) string + func (dao *Dao) SyncRecordTableSchema(newCollection *models.Collection, oldCollection *models.Collection) error + func (dao *Dao) TableColumns(tableName string) ([]string, error) + func (dao *Dao) TableIndexes(tableName string) (map[string]string, error) + func (dao *Dao) TableInfo(tableName string) ([]*models.TableInfoRow, error) + func (dao *Dao) TotalAdmins() (int, error) + func (dao *Dao) Vacuum() error + type ExpandFetchFunc func(relCollection *models.Collection, relIds []string) ([]*models.Record, error) + type RequestsStatsItem struct + Date types.DateTime + Total int