Documentation ¶
Overview ¶
Package storage sets up database persistence providers.
Package storage sets up database persistence providers.
Index ¶
- func SetMySQLProvider(r *env.Runtime, s *store.Store)
- func SetPostgreSQLProvider(r *env.Runtime, s *store.Store)
- type MySQLProvider
- func (p MySQLProvider) DatabaseName() string
- func (p MySQLProvider) DriverName() string
- func (p MySQLProvider) Example() string
- func (p MySQLProvider) JSONEmpty() string
- func (p MySQLProvider) JSONGetValue(column, attribute string) string
- func (p MySQLProvider) MakeConnectionString() string
- func (p MySQLProvider) Params() map[string]string
- func (p MySQLProvider) QueryDateInterval(days int64) string
- func (p MySQLProvider) QueryGetDatabaseVersion() string
- func (p MySQLProvider) QueryGetDatabaseVersionLegacy() string
- func (p MySQLProvider) QueryMeta() string
- func (p MySQLProvider) QueryRecordVersionUpgrade(version int) string
- func (p MySQLProvider) QueryRecordVersionUpgradeLegacy(version int) string
- func (p MySQLProvider) QueryTableList() string
- func (p MySQLProvider) Type() env.StoreType
- func (p MySQLProvider) TypeVariant() env.StoreType
- func (p MySQLProvider) VerfiyCharacterCollation(charset, collation string) (charOK bool, requirements string)
- func (p MySQLProvider) VerfiyVersion(dbVersion string) (bool, string)
- type PostgreSQLProvider
- func (p PostgreSQLProvider) DatabaseName() string
- func (p PostgreSQLProvider) DriverName() string
- func (p PostgreSQLProvider) Example() string
- func (p PostgreSQLProvider) JSONEmpty() string
- func (p PostgreSQLProvider) JSONGetValue(column, attribute string) string
- func (p PostgreSQLProvider) MakeConnectionString() string
- func (p PostgreSQLProvider) Params() map[string]string
- func (p PostgreSQLProvider) QueryDateInterval(days int64) string
- func (p PostgreSQLProvider) QueryGetDatabaseVersion() string
- func (p PostgreSQLProvider) QueryGetDatabaseVersionLegacy() string
- func (p PostgreSQLProvider) QueryMeta() string
- func (p PostgreSQLProvider) QueryRecordVersionUpgrade(version int) string
- func (p PostgreSQLProvider) QueryRecordVersionUpgradeLegacy(version int) string
- func (p PostgreSQLProvider) QueryTableList() string
- func (p PostgreSQLProvider) Type() env.StoreType
- func (p PostgreSQLProvider) TypeVariant() env.StoreType
- func (p PostgreSQLProvider) VerfiyCharacterCollation(charset, collation string) (charOK bool, requirements string)
- func (p PostgreSQLProvider) VerfiyVersion(dbVersion string) (bool, string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetMySQLProvider ¶
SetMySQLProvider creates MySQL provider
Types ¶
type MySQLProvider ¶
type MySQLProvider struct { // User specified connection string. ConnectionString string // User specified db type (mysql, percona or mariadb). Variant env.StoreType }
MySQLProvider supports MySQL 5.7.x and 8.0.x versions.
func (MySQLProvider) DatabaseName ¶
func (p MySQLProvider) DatabaseName() string
DatabaseName holds the SQL database name where Documize tables live.
func (MySQLProvider) DriverName ¶
func (p MySQLProvider) DriverName() string
DriverName returns database/sql driver name.
func (MySQLProvider) Example ¶
func (p MySQLProvider) Example() string
Example holds storage provider specific connection string format. used in error messages
func (MySQLProvider) JSONEmpty ¶
func (p MySQLProvider) JSONEmpty() string
JSONEmpty returns empty SQL JSON object. Typically used as 2nd parameter to COALESCE().
func (MySQLProvider) JSONGetValue ¶
func (p MySQLProvider) JSONGetValue(column, attribute string) string
JSONGetValue returns JSON attribute selection syntax. Typically used in SELECT <my_json_field> query.
func (MySQLProvider) MakeConnectionString ¶
func (p MySQLProvider) MakeConnectionString() string
MakeConnectionString returns provider specific DB connection string complete with default parameters.
func (MySQLProvider) Params ¶
func (p MySQLProvider) Params() map[string]string
Params returns connection string parameters that must be present before connecting to DB.
func (MySQLProvider) QueryDateInterval ¶
func (p MySQLProvider) QueryDateInterval(days int64) string
QueryDateInterval returns provider specific interval style date SQL.
func (MySQLProvider) QueryGetDatabaseVersion ¶
func (p MySQLProvider) QueryGetDatabaseVersion() string
QueryGetDatabaseVersion returns the schema version number.
func (MySQLProvider) QueryGetDatabaseVersionLegacy ¶
func (p MySQLProvider) QueryGetDatabaseVersionLegacy() string
QueryGetDatabaseVersionLegacy returns the schema version number before The Great Schema Migration (v25, MySQL).
func (MySQLProvider) QueryMeta ¶
func (p MySQLProvider) QueryMeta() string
QueryMeta is how to extract version number, collation, character set from database provider.
func (MySQLProvider) QueryRecordVersionUpgrade ¶
func (p MySQLProvider) QueryRecordVersionUpgrade(version int) string
QueryRecordVersionUpgrade returns database specific insert statement that records the database version number.
func (MySQLProvider) QueryRecordVersionUpgradeLegacy ¶
func (p MySQLProvider) QueryRecordVersionUpgradeLegacy(version int) string
QueryRecordVersionUpgradeLegacy returns database specific insert statement that records the database version number.
func (MySQLProvider) QueryTableList ¶
func (p MySQLProvider) QueryTableList() string
QueryTableList returns a list tables in Documize database.
func (MySQLProvider) Type ¶
func (p MySQLProvider) Type() env.StoreType
Type returns name of provider
func (MySQLProvider) TypeVariant ¶
func (p MySQLProvider) TypeVariant() env.StoreType
TypeVariant returns databse flavor
func (MySQLProvider) VerfiyCharacterCollation ¶
func (p MySQLProvider) VerfiyCharacterCollation(charset, collation string) (charOK bool, requirements string)
VerfiyCharacterCollation needs to ensure utf8/utf8mb4.
func (MySQLProvider) VerfiyVersion ¶
func (p MySQLProvider) VerfiyVersion(dbVersion string) (bool, string)
VerfiyVersion checks to see if actual database meets minimum version requirements.“
type PostgreSQLProvider ¶
type PostgreSQLProvider struct { // User specified connection string. ConnectionString string // Unused for this provider. Variant env.StoreType }
PostgreSQLProvider supports by popular demand.
func (PostgreSQLProvider) DatabaseName ¶
func (p PostgreSQLProvider) DatabaseName() string
DatabaseName holds the SQL database name where Documize tables live.
func (PostgreSQLProvider) DriverName ¶
func (p PostgreSQLProvider) DriverName() string
DriverName returns database/sql driver name.
func (PostgreSQLProvider) Example ¶
func (p PostgreSQLProvider) Example() string
Example holds storage provider specific connection string format. used in error messages
func (PostgreSQLProvider) JSONEmpty ¶
func (p PostgreSQLProvider) JSONEmpty() string
JSONEmpty returns empty SQL JSON object. Typically used as 2nd parameter to COALESCE().
func (PostgreSQLProvider) JSONGetValue ¶
func (p PostgreSQLProvider) JSONGetValue(column, attribute string) string
JSONGetValue returns JSON attribute selection syntax. Typically used in SELECT <my_json_field> query.
func (PostgreSQLProvider) MakeConnectionString ¶
func (p PostgreSQLProvider) MakeConnectionString() string
MakeConnectionString returns provider specific DB connection string complete with default parameters.
func (PostgreSQLProvider) Params ¶
func (p PostgreSQLProvider) Params() map[string]string
Params returns connection string parameters that must be present before connecting to DB.
func (PostgreSQLProvider) QueryDateInterval ¶
func (p PostgreSQLProvider) QueryDateInterval(days int64) string
QueryDateInterval returns provider specific interval style date SQL.
func (PostgreSQLProvider) QueryGetDatabaseVersion ¶
func (p PostgreSQLProvider) QueryGetDatabaseVersion() string
QueryGetDatabaseVersion returns the schema version number.
func (PostgreSQLProvider) QueryGetDatabaseVersionLegacy ¶
func (p PostgreSQLProvider) QueryGetDatabaseVersionLegacy() string
QueryGetDatabaseVersionLegacy returns the schema version number before The Great Schema Migration (v25, MySQL).
func (PostgreSQLProvider) QueryMeta ¶
func (p PostgreSQLProvider) QueryMeta() string
QueryMeta is how to extract version number, collation, character set from database provider.
func (PostgreSQLProvider) QueryRecordVersionUpgrade ¶
func (p PostgreSQLProvider) QueryRecordVersionUpgrade(version int) string
QueryRecordVersionUpgrade returns database specific insert statement that records the database version number.
func (PostgreSQLProvider) QueryRecordVersionUpgradeLegacy ¶
func (p PostgreSQLProvider) QueryRecordVersionUpgradeLegacy(version int) string
QueryRecordVersionUpgradeLegacy returns database specific insert statement that records the database version number.
func (PostgreSQLProvider) QueryTableList ¶
func (p PostgreSQLProvider) QueryTableList() string
QueryTableList returns a list tables in Documize database.
func (PostgreSQLProvider) Type ¶
func (p PostgreSQLProvider) Type() env.StoreType
Type returns name of provider
func (PostgreSQLProvider) TypeVariant ¶
func (p PostgreSQLProvider) TypeVariant() env.StoreType
TypeVariant returns databse flavor
func (PostgreSQLProvider) VerfiyCharacterCollation ¶
func (p PostgreSQLProvider) VerfiyCharacterCollation(charset, collation string) (charOK bool, requirements string)
VerfiyCharacterCollation needs to ensure utf8.
func (PostgreSQLProvider) VerfiyVersion ¶
func (p PostgreSQLProvider) VerfiyVersion(dbVersion string) (bool, string)
VerfiyVersion checks to see if actual database meets minimum version requirements.“