Documentation ¶
Index ¶
- func Check(runtime *env.Runtime) bool
- func CurrentVersion(runtime *env.Runtime) (version int, err error)
- func InstallUpgrade(runtime *env.Runtime, existingDB bool) (err error)
- func RebindParams(sql string, s env.StoreType) string
- func RebindPostgreSQL(sql string) string
- type Handler
- type Script
- type Scripts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
Check that the database is configured correctly and that all the required tables exist. It must be the first function called in this package.
func CurrentVersion ¶ added in v1.71.0
CurrentVersion returns number that represents the current database version number. For example 23 represents the 23rd iteration of the database.
func InstallUpgrade ¶ added in v1.71.0
InstallUpgrade creates new database or upgrades existing database.
func RebindParams ¶ added in v1.71.0
RebindParams changes MySQL query parameter placeholder from "?" to correct value for given database provider.
MySQL uses ?, ?, ? (default for all Documize queries) PostgreSQL uses $1, $2, $3 MS SQL Server uses @p1, @p2, @p3
func RebindPostgreSQL ¶ added in v1.71.0
RebindPostgreSQL is a helper method on top of RebindParams.
Types ¶
type Handler ¶ added in v1.51.0
Handler contains the runtime information such as logging and database.
type Scripts ¶ added in v1.71.0
Scripts holds all .SQL files for all supported database providers.
func LoadScripts ¶ added in v1.71.0
LoadScripts returns .SQL scripts for supported database providers.