postgresql

package
v1.4.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldID        = "id"
	FieldAccountID = "accountId"
	FieldFormName  = "sb_form"
)

Variables

This section is empty.

Functions

func New

func New(db *sql.DB, pubdoc internal.PublishDocumentEvent, migPath string) internal.Persister

Types

type Document

type Document struct {
	ID        string
	AccountID string
	OwnerID   string
	Data      JSONB
	Created   time.Time
}

type FormData

type FormData struct {
	ID      string
	Name    string
	Data    JSONB
	Created time.Time
}

type JSONB

type JSONB map[string]interface{}

func (*JSONB) Scan

func (j *JSONB) Scan(value interface{}) error

func (JSONB) Value

func (j JSONB) Value() (driver.Value, error)

type PostgreSQL

type PostgreSQL struct {
	DB              *sql.DB
	PublishDocument internal.PublishDocumentEvent
}

func (*PostgreSQL) ActivateCustomer

func (pg *PostgreSQL) ActivateCustomer(customerID string, active bool) error

func (*PostgreSQL) AddFile

func (pg *PostgreSQL) AddFile(dbName string, f internal.File) (id string, err error)

func (*PostgreSQL) AddFormSubmission

func (pg *PostgreSQL) AddFormSubmission(dbName, form string, doc map[string]interface{}) error

func (*PostgreSQL) AddFunction

func (pg *PostgreSQL) AddFunction(dbName string, data internal.ExecData) (id string, err error)

func (*PostgreSQL) BulkCreateDocument

func (pg *PostgreSQL) BulkCreateDocument(auth internal.Auth, dbName, col string, docs []interface{}) error

func (*PostgreSQL) ChangeCustomerPlan added in v1.4.0

func (pg *PostgreSQL) ChangeCustomerPlan(customerID string, plan int) error

func (*PostgreSQL) CreateBase

func (pg *PostgreSQL) CreateBase(base internal.BaseConfig) (b internal.BaseConfig, err error)

func (*PostgreSQL) CreateCustomer

func (pg *PostgreSQL) CreateCustomer(customer internal.Customer) (c internal.Customer, err error)

func (*PostgreSQL) CreateDocument

func (pg *PostgreSQL) CreateDocument(auth internal.Auth, dbName, col string, doc map[string]interface{}) (inserted map[string]interface{}, err error)

func (*PostgreSQL) CreateIndex added in v1.3.0

func (pg *PostgreSQL) CreateIndex(dbName, col, field string) error

func (*PostgreSQL) CreateUserAccount

func (pg *PostgreSQL) CreateUserAccount(dbName, email string) (id string, err error)

func (*PostgreSQL) CreateUserToken

func (pg *PostgreSQL) CreateUserToken(dbName string, tok internal.Token) (id string, err error)

func (*PostgreSQL) DatabaseExists

func (pg *PostgreSQL) DatabaseExists(name string) (exists bool, err error)

func (*PostgreSQL) DeleteCustomer

func (pg *PostgreSQL) DeleteCustomer(dbName, email string) error

func (*PostgreSQL) DeleteDocument

func (pg *PostgreSQL) DeleteDocument(auth internal.Auth, dbName, col, id string) (int64, error)

func (*PostgreSQL) DeleteFile

func (pg *PostgreSQL) DeleteFile(dbName, fileID string) error

func (*PostgreSQL) DeleteFunction

func (pg *PostgreSQL) DeleteFunction(dbName, name 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(customerID string, config map[string]internal.OAuthConfig) error

func (*PostgreSQL) FindAccount

func (pg *PostgreSQL) FindAccount(customerID string) (customer internal.Customer, err error)

func (*PostgreSQL) FindDatabase

func (pg *PostgreSQL) FindDatabase(baseID string) (base internal.BaseConfig, err error)

func (*PostgreSQL) FindRootToken

func (pg *PostgreSQL) FindRootToken(dbName, tokenID, accountID, token string) (tok internal.Token, err error)

func (*PostgreSQL) FindToken

func (pg *PostgreSQL) FindToken(dbName, tokenID, token string) (tok internal.Token, err error)

func (*PostgreSQL) FindTokenByEmail

func (pg *PostgreSQL) FindTokenByEmail(dbName, email string) (tok internal.Token, err error)

func (*PostgreSQL) GetAllDatabaseSizes added in v1.4.0

func (pg *PostgreSQL) GetAllDatabaseSizes() error

func (*PostgreSQL) GetCustomerByStripeID

func (pg *PostgreSQL) GetCustomerByStripeID(stripeID string) (cus internal.Customer, err error)

func (*PostgreSQL) GetDocumentByID

func (pg *PostgreSQL) GetDocumentByID(auth internal.Auth, dbName, col, id string) (map[string]interface{}, error)

func (*PostgreSQL) GetFileByID

func (pg *PostgreSQL) GetFileByID(dbName, fileID string) (f internal.File, err error)

func (*PostgreSQL) GetFirstTokenFromAccountID

func (pg *PostgreSQL) GetFirstTokenFromAccountID(dbName, accountID string) (tok internal.Token, 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 internal.ExecData, err error)

func (*PostgreSQL) GetFunctionByName

func (pg *PostgreSQL) GetFunctionByName(dbName, name string) (result internal.ExecData, err error)

func (*PostgreSQL) GetFunctionForExecution

func (pg *PostgreSQL) GetFunctionForExecution(dbName, name string) (result internal.ExecData, err error)

func (*PostgreSQL) GetRootForBase

func (pg *PostgreSQL) GetRootForBase(dbName string) (tok internal.Token, err error)

func (*PostgreSQL) IncrementMonthlyEmailSent

func (pg *PostgreSQL) IncrementMonthlyEmailSent(baseID string) error

func (*PostgreSQL) IncrementValue

func (pg *PostgreSQL) IncrementValue(auth internal.Auth, dbName, col, id, field string, n int) error

func (*PostgreSQL) ListAllFiles added in v1.4.0

func (pg *PostgreSQL) ListAllFiles(dbName, accountID string) (results []internal.File, err error)

func (*PostgreSQL) ListCollections

func (pg *PostgreSQL) ListCollections(dbName string) (results []string, err error)

func (*PostgreSQL) ListDatabases

func (pg *PostgreSQL) ListDatabases() (results []internal.BaseConfig, err error)

func (*PostgreSQL) ListDocuments

func (pg *PostgreSQL) ListDocuments(auth internal.Auth, dbName, col string, params internal.ListParams) (result internal.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 []internal.ExecData, err error)

func (*PostgreSQL) ListFunctionsByTrigger

func (pg *PostgreSQL) ListFunctionsByTrigger(dbName, trigger string) (results []internal.ExecData, err error)

func (*PostgreSQL) ListTasks

func (pg *PostgreSQL) ListTasks() (results []internal.Task, err error)

func (*PostgreSQL) ListTasksByBase

func (pg *PostgreSQL) ListTasksByBase(dbName string) (results []internal.Task, err 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 internal.Auth, dbName, col string, filters map[string]interface{}, params internal.ListParams) (result internal.PagedResult, err error)

func (*PostgreSQL) RanFunction

func (pg *PostgreSQL) RanFunction(dbName, id string, rh internal.ExecHistory) error

func (*PostgreSQL) ResetPassword

func (pg *PostgreSQL) ResetPassword(dbName, email, code, password string) error

func (*PostgreSQL) SetPasswordResetCode

func (pg *PostgreSQL) SetPasswordResetCode(dbName, tokenID, code string) error

func (*PostgreSQL) SetUserRole

func (pg *PostgreSQL) SetUserRole(dbName, email string, role int) error

func (*PostgreSQL) UpdateDocument

func (pg *PostgreSQL) UpdateDocument(auth internal.Auth, dbName, col, id string, doc map[string]interface{}) (map[string]interface{}, error)

func (*PostgreSQL) UpdateDocuments added in v1.4.0

func (pg *PostgreSQL) UpdateDocuments(auth internal.Auth, dbName, col string, filters map[string]interface{}, updateFields map[string]interface{}) (n int64, err error)

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

type Scanner

type Scanner interface {
	Scan(dest ...interface{}) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL