Documentation ¶
Index ¶
- Constants
- Variables
- func AtomicRequest(h http.Handler) http.Handler
- func Bootstrap(db *sql.DB) error
- func Check(err error)
- func Delete(docId int, collection string, tx *sql.Tx)
- func DropTenant(tenantId int, tx *sql.Tx)
- func EnsureCollection(name string, tx *sql.Tx)
- func EnsureGINIndex(tableName string, tx *sql.Tx)
- func EnsureSchema(name string, tx *sql.Tx)
- func EnsureTenant(tenant *Tenant, tenantInit func(tx *sql.Tx), tx *sql.Tx)
- func Find(docId int, collection string, doc interface{}, tx *sql.Tx) (found bool)
- func FindTenantByName(tenantName string, tenant *Tenant, tx *sql.Tx) (tenantId int, found bool)
- func GetTx(r *http.Request) *sql.Tx
- func Insert(doc interface{}, collection string, tx *sql.Tx) (docId int)
- func Open(connectionURL string) (*sql.DB, error)
- func Update(doc interface{}, docId int, collection string, tx *sql.Tx)
- func Use(tenantId int, tx *sql.Tx)
- func UseMaster(h http.Handler) http.Handler
- func UseTenantBySubdomain(h http.Handler) http.Handler
- type Rows
- type Tenant
Constants ¶
View Source
const MASTER = -1
Variables ¶
View Source
var DB *sql.DB
Functions ¶
func DropTenant ¶
func EnsureCollection ¶
EnsureCollection checks existance of a collection and creates it, if it is not exist.
func EnsureGINIndex ¶
EnsureGINIndex checks existance of a GIN index on doc fileld for table tableName and creates it, if it is not exist.
func EnsureSchema ¶
EnsureSchema checks existance of a schema and creates it, if it is not exist.
func FindTenantByName ¶
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.