Documentation
¶
Index ¶
- Constants
- func New(db *sql.DB, pubdoc cache.PublishDocumentEvent, log *logger.Logger) database.Persister
- type Document
- type FormData
- type JSONB
- type PostgreSQL
- func (pg *PostgreSQL) ActivateTenant(tenantID string, active bool) error
- func (pg *PostgreSQL) AddFile(dbName string, f model.File) (id string, err error)
- func (pg *PostgreSQL) AddFormSubmission(dbName, form string, doc map[string]interface{}) error
- func (pg *PostgreSQL) AddFunction(dbName string, data model.ExecData) (id string, err error)
- func (pg *PostgreSQL) AddTask(dbName string, task model.Task) (id string, err error)
- func (pg *PostgreSQL) BulkCreateDocument(auth model.Auth, dbName, col string, docs []interface{}) error
- func (pg *PostgreSQL) ChangeTenantPlan(tenantID string, plan int) error
- func (pg *PostgreSQL) Count(auth model.Auth, dbName, col string, filters map[string]interface{}) (count int64, err error)
- func (pg *PostgreSQL) CreateAccount(dbName, email string) (id string, err error)
- func (pg *PostgreSQL) CreateDatabase(base model.DatabaseConfig) (b model.DatabaseConfig, err error)
- func (pg *PostgreSQL) CreateDocument(auth model.Auth, dbName, col string, doc map[string]interface{}) (inserted map[string]interface{}, err error)
- func (pg *PostgreSQL) CreateIndex(dbName, col, field string) error
- func (pg *PostgreSQL) CreateTenant(customer model.Tenant) (c model.Tenant, err error)
- func (pg *PostgreSQL) CreateUser(dbName string, tok model.User) (id string, err error)
- func (pg *PostgreSQL) DatabaseExists(name string) (exists bool, err error)
- func (pg *PostgreSQL) DeleteDocument(auth model.Auth, dbName, col, id string) (int64, error)
- func (pg *PostgreSQL) DeleteDocuments(auth model.Auth, dbName, col string, filters map[string]any) (n int64, err error)
- func (pg *PostgreSQL) DeleteFile(dbName, fileID string) error
- func (pg *PostgreSQL) DeleteFunction(dbName, name string) error
- func (sl *PostgreSQL) DeleteTask(dbName, id string) error
- func (pg *PostgreSQL) DeleteTenant(dbName, email string) error
- func (pg *PostgreSQL) EmailExists(email string) (bool, error)
- func (pg *PostgreSQL) EnableExternalLogin(tenantID string, config map[string]model.OAuthConfig) error
- func (pg *PostgreSQL) FindDatabase(baseID string) (base model.DatabaseConfig, err error)
- func (pg *PostgreSQL) FindRootUser(dbName, userID, accountID, token string) (tok model.User, err error)
- func (pg *PostgreSQL) FindTenant(tenantID string) (customer model.Tenant, err error)
- func (pg *PostgreSQL) FindUser(dbName, userID, token string) (tok model.User, err error)
- func (pg *PostgreSQL) FindUserByEmail(dbName, email string) (tok model.User, err error)
- func (pg *PostgreSQL) GetAllDatabaseSizes() error
- func (pg *PostgreSQL) GetDocumentByID(auth model.Auth, dbName, col, id string) (map[string]interface{}, error)
- func (pg *PostgreSQL) GetDocumentsByIDs(auth model.Auth, dbName, col string, ids []string) (docs []map[string]interface{}, err error)
- func (pg *PostgreSQL) GetFileByID(dbName, fileID string) (f model.File, err error)
- func (pg *PostgreSQL) GetFirstUserFromAccountID(dbName, accountID string) (tok model.User, err error)
- func (pg *PostgreSQL) GetForms(dbName string) (results []string, err error)
- func (pg *PostgreSQL) GetFunctionByID(dbName, id string) (result model.ExecData, err error)
- func (pg *PostgreSQL) GetFunctionByName(dbName, name string) (result model.ExecData, err error)
- func (pg *PostgreSQL) GetFunctionForExecution(dbName, name string) (result model.ExecData, err error)
- func (pg *PostgreSQL) GetRootForBase(dbName string) (tok model.User, err error)
- func (pg *PostgreSQL) GetTenantByStripeID(stripeID string) (cus model.Tenant, err error)
- func (pg *PostgreSQL) GetUserByID(dbName, accountID, userID string) (user model.User, err error)
- func (pg *PostgreSQL) IncrementMonthlyEmailSent(baseID string) error
- func (pg *PostgreSQL) IncrementValue(auth model.Auth, dbName, col, id, field string, n int) error
- func (pg *PostgreSQL) ListAccounts(dbName string) ([]model.Account, error)
- func (pg *PostgreSQL) ListAllFiles(dbName, accountID string) (results []model.File, err error)
- func (pg *PostgreSQL) ListCollections(dbName string) (results []string, err error)
- func (pg *PostgreSQL) ListDatabases() (results []model.DatabaseConfig, err error)
- func (pg *PostgreSQL) ListDocuments(auth model.Auth, dbName, col string, params model.ListParams) (result model.PagedResult, err error)
- func (pg *PostgreSQL) ListFormSubmissions(dbName, name string) (results []map[string]interface{}, err error)
- func (pg *PostgreSQL) ListFunctions(dbName string) (results []model.ExecData, err error)
- func (pg *PostgreSQL) ListFunctionsByTrigger(dbName, trigger string) (results []model.ExecData, err error)
- func (pg *PostgreSQL) ListTasks() (results []model.Task, err error)
- func (pg *PostgreSQL) ListTasksByBase(dbName string) (results []model.Task, err error)
- func (pg *PostgreSQL) ListUsers(dbName, accountID string) ([]model.User, error)
- func (pg *PostgreSQL) NewID() string
- func (mg *PostgreSQL) ParseQuery(clauses [][]interface{}) (map[string]interface{}, error)
- func (pg *PostgreSQL) Ping() error
- func (pg *PostgreSQL) QueryDocuments(auth model.Auth, dbName, col string, filters map[string]interface{}, ...) (result model.PagedResult, err error)
- func (pg *PostgreSQL) RanFunction(dbName, id string, rh model.ExecHistory) error
- func (pg *PostgreSQL) RemoveUser(auth model.Auth, dbName, userID string) error
- func (pg *PostgreSQL) ResetPassword(dbName, email, code, password string) error
- func (pg *PostgreSQL) SetPasswordResetCode(dbName, userID, code string) error
- func (pg *PostgreSQL) SetUserRole(dbName, email string, role int) error
- func (pg *PostgreSQL) UpdateDocument(auth model.Auth, dbName, col, id string, doc map[string]interface{}) (map[string]interface{}, error)
- func (pg *PostgreSQL) UpdateDocuments(auth model.Auth, dbName, col string, filters map[string]interface{}, ...) (n int64, err error)
- func (pg *PostgreSQL) UpdateFunction(dbName, id, code, trigger string) error
- func (pg *PostgreSQL) UserEmailExists(dbName, email string) (exists bool, err error)
- func (pg *PostgreSQL) UserSetPassword(dbName, tokenID, password string) error
- type Scanner
Constants ¶
View Source
const ( FieldID = "id" FieldAccountID = "accountId" FieldFormName = "sb_form" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PostgreSQL ¶
type PostgreSQL struct { DB *sql.DB PublishDocument cache.PublishDocumentEvent // contains filtered or unexported fields }
func (*PostgreSQL) ActivateTenant ¶ added in v1.4.1
func (pg *PostgreSQL) ActivateTenant(tenantID string, active bool) error
func (*PostgreSQL) AddFormSubmission ¶
func (pg *PostgreSQL) AddFormSubmission(dbName, form string, doc map[string]interface{}) error
func (*PostgreSQL) AddFunction ¶
func (*PostgreSQL) BulkCreateDocument ¶
func (pg *PostgreSQL) BulkCreateDocument(auth model.Auth, dbName, col string, docs []interface{}) error
func (*PostgreSQL) ChangeTenantPlan ¶ added in v1.4.1
func (pg *PostgreSQL) ChangeTenantPlan(tenantID string, plan int) error
func (*PostgreSQL) CreateAccount ¶ added in v1.4.1
func (pg *PostgreSQL) CreateAccount(dbName, email string) (id string, err error)
func (*PostgreSQL) CreateDatabase ¶ added in v1.4.1
func (pg *PostgreSQL) CreateDatabase(base model.DatabaseConfig) (b model.DatabaseConfig, err error)
func (*PostgreSQL) CreateDocument ¶
func (*PostgreSQL) CreateIndex ¶ added in v1.3.0
func (pg *PostgreSQL) CreateIndex(dbName, col, field string) error
func (*PostgreSQL) CreateTenant ¶ added in v1.4.1
func (*PostgreSQL) CreateUser ¶ added in v1.4.1
func (*PostgreSQL) DatabaseExists ¶
func (pg *PostgreSQL) DatabaseExists(name string) (exists bool, err error)
func (*PostgreSQL) DeleteDocument ¶
func (*PostgreSQL) DeleteDocuments ¶ added in v1.5.0
func (*PostgreSQL) DeleteFile ¶
func (pg *PostgreSQL) DeleteFile(dbName, fileID string) error
func (*PostgreSQL) DeleteFunction ¶
func (pg *PostgreSQL) DeleteFunction(dbName, name string) error
func (*PostgreSQL) DeleteTask ¶ added in v1.5.0
func (sl *PostgreSQL) DeleteTask(dbName, id string) error
func (*PostgreSQL) DeleteTenant ¶ added in v1.4.1
func (pg *PostgreSQL) DeleteTenant(dbName, email string) error
func (*PostgreSQL) EmailExists ¶
func (pg *PostgreSQL) EmailExists(email string) (bool, error)
func (*PostgreSQL) EnableExternalLogin ¶ added in v1.4.0
func (pg *PostgreSQL) EnableExternalLogin(tenantID string, config map[string]model.OAuthConfig) error
func (*PostgreSQL) FindDatabase ¶
func (pg *PostgreSQL) FindDatabase(baseID string) (base model.DatabaseConfig, err error)
func (*PostgreSQL) FindRootUser ¶ added in v1.4.1
func (pg *PostgreSQL) FindRootUser(dbName, userID, accountID, token string) (tok model.User, err error)
func (*PostgreSQL) FindTenant ¶ added in v1.4.1
func (pg *PostgreSQL) FindTenant(tenantID string) (customer model.Tenant, err error)
func (*PostgreSQL) FindUser ¶ added in v1.4.1
func (pg *PostgreSQL) FindUser(dbName, userID, token string) (tok model.User, err error)
func (*PostgreSQL) FindUserByEmail ¶ added in v1.4.1
func (pg *PostgreSQL) FindUserByEmail(dbName, email string) (tok model.User, err error)
func (*PostgreSQL) GetAllDatabaseSizes ¶ added in v1.4.0
func (pg *PostgreSQL) GetAllDatabaseSizes() error
func (*PostgreSQL) GetDocumentByID ¶
func (*PostgreSQL) GetDocumentsByIDs ¶ added in v1.4.2
func (*PostgreSQL) GetFileByID ¶
func (pg *PostgreSQL) GetFileByID(dbName, fileID string) (f model.File, err error)
func (*PostgreSQL) GetFirstUserFromAccountID ¶ added in v1.4.1
func (pg *PostgreSQL) GetFirstUserFromAccountID(dbName, accountID string) (tok model.User, err error)
func (*PostgreSQL) GetForms ¶
func (pg *PostgreSQL) GetForms(dbName string) (results []string, err error)
func (*PostgreSQL) GetFunctionByID ¶
func (pg *PostgreSQL) GetFunctionByID(dbName, id string) (result model.ExecData, err error)
func (*PostgreSQL) GetFunctionByName ¶
func (pg *PostgreSQL) GetFunctionByName(dbName, name string) (result model.ExecData, err error)
func (*PostgreSQL) GetFunctionForExecution ¶
func (pg *PostgreSQL) GetFunctionForExecution(dbName, name string) (result model.ExecData, err error)
func (*PostgreSQL) GetRootForBase ¶
func (pg *PostgreSQL) GetRootForBase(dbName string) (tok model.User, err error)
func (*PostgreSQL) GetTenantByStripeID ¶ added in v1.4.1
func (pg *PostgreSQL) GetTenantByStripeID(stripeID string) (cus model.Tenant, err error)
func (*PostgreSQL) GetUserByID ¶ added in v1.5.0
func (pg *PostgreSQL) GetUserByID(dbName, accountID, userID string) (user model.User, err error)
func (*PostgreSQL) IncrementMonthlyEmailSent ¶
func (pg *PostgreSQL) IncrementMonthlyEmailSent(baseID string) error
func (*PostgreSQL) IncrementValue ¶
func (*PostgreSQL) ListAccounts ¶ added in v1.5.0
func (pg *PostgreSQL) ListAccounts(dbName string) ([]model.Account, error)
func (*PostgreSQL) ListAllFiles ¶ added in v1.4.0
func (pg *PostgreSQL) ListAllFiles(dbName, accountID string) (results []model.File, err error)
func (*PostgreSQL) ListCollections ¶
func (pg *PostgreSQL) ListCollections(dbName string) (results []string, err error)
func (*PostgreSQL) ListDatabases ¶
func (pg *PostgreSQL) ListDatabases() (results []model.DatabaseConfig, err error)
func (*PostgreSQL) ListDocuments ¶
func (pg *PostgreSQL) ListDocuments(auth model.Auth, dbName, col string, params model.ListParams) (result model.PagedResult, err error)
func (*PostgreSQL) ListFormSubmissions ¶
func (pg *PostgreSQL) ListFormSubmissions(dbName, name string) (results []map[string]interface{}, err error)
func (*PostgreSQL) ListFunctions ¶
func (pg *PostgreSQL) ListFunctions(dbName string) (results []model.ExecData, err error)
func (*PostgreSQL) ListFunctionsByTrigger ¶
func (pg *PostgreSQL) ListFunctionsByTrigger(dbName, trigger string) (results []model.ExecData, err error)
func (*PostgreSQL) ListTasksByBase ¶
func (pg *PostgreSQL) ListTasksByBase(dbName string) (results []model.Task, err error)
func (*PostgreSQL) ListUsers ¶ added in v1.5.0
func (pg *PostgreSQL) ListUsers(dbName, accountID string) ([]model.User, error)
func (*PostgreSQL) NewID ¶
func (pg *PostgreSQL) NewID() string
func (*PostgreSQL) ParseQuery ¶
func (mg *PostgreSQL) ParseQuery(clauses [][]interface{}) (map[string]interface{}, error)
func (*PostgreSQL) Ping ¶
func (pg *PostgreSQL) Ping() error
func (*PostgreSQL) QueryDocuments ¶
func (pg *PostgreSQL) QueryDocuments(auth model.Auth, dbName, col string, filters map[string]interface{}, params model.ListParams) (result model.PagedResult, err error)
func (*PostgreSQL) RanFunction ¶
func (pg *PostgreSQL) RanFunction(dbName, id string, rh model.ExecHistory) error
func (*PostgreSQL) RemoveUser ¶ added in v1.5.0
func (pg *PostgreSQL) RemoveUser(auth model.Auth, dbName, userID string) error
func (*PostgreSQL) ResetPassword ¶
func (pg *PostgreSQL) ResetPassword(dbName, email, code, password string) error
func (*PostgreSQL) SetPasswordResetCode ¶
func (pg *PostgreSQL) SetPasswordResetCode(dbName, userID, code string) error
func (*PostgreSQL) SetUserRole ¶
func (pg *PostgreSQL) SetUserRole(dbName, email string, role int) error
func (*PostgreSQL) UpdateDocument ¶
func (*PostgreSQL) UpdateDocuments ¶ added in v1.4.0
func (*PostgreSQL) UpdateFunction ¶
func (pg *PostgreSQL) UpdateFunction(dbName, id, code, trigger string) error
func (*PostgreSQL) UserEmailExists ¶
func (pg *PostgreSQL) UserEmailExists(dbName, email string) (exists bool, err error)
func (*PostgreSQL) UserSetPassword ¶
func (pg *PostgreSQL) UserSetPassword(dbName, tokenID, password string) error
Click to show internal directories.
Click to hide internal directories.