Documentation
¶
Index ¶
- Constants
- func EmbellishSQLite3ConnString(connectionString string) (string, error)
- func GetConnectionString(cfg *Configuration, isReadOnly bool) string
- func IsMySQLConstraintViolation(err error) bool
- func IsPostgresConstraintViolation(err error) bool
- func IsSQLiteConstraintViolation(err error) bool
- func NewSQLError(fmtMsg string, args ...any) error
- func NewValidationError(fmtMsg string, args ...any) error
- func NewWrappedSQLError(err error) error
- func NewWrappedValidationError(err error) error
- type AWSConfig
- type Configuration
- type DBTypeConfig
- type SQLError
- type ValidationError
Constants ¶
View Source
const ( SQLiteVersionQuery = "SELECT sqlite_version()" PostgresVersionQuery = "SHOW server_version" MySQLVersionQuery = "SELECT VERSION()" )
Variables ¶
This section is empty.
Functions ¶
func EmbellishSQLite3ConnString ¶
EmbellishSQLite3ConnString adds query values supported by github.com/mattn/go-sqlite3 to enable journal mode and foreign key support. These query values MUST be part of the connection string in order to be enabled for *each* connection opened by db/sql. If the connection string is not already a file: URI, it is converted first.
func GetConnectionString ¶
func GetConnectionString(cfg *Configuration, isReadOnly bool) string
GetConnectionString returns the connection string corresponding to the database connection.
func NewSQLError ¶
func NewValidationError ¶
func NewWrappedSQLError ¶
Types ¶
type AWSConfig ¶
type Configuration ¶
type Configuration struct {
DatabaseTypeNode ast.Node `hcl:"database_type" json:"database_type"`
ConnectionString string `hcl:"connection_string" json:"connection_string"`
RoConnectionString string `hcl:"ro_connection_string" json:"ro_connection_string"`
RootCAPath string `hcl:"root_ca_path" json:"root_ca_path"`
ClientCertPath string `hcl:"client_cert_path" json:"client_cert_path"`
ClientKeyPath string `hcl:"client_key_path" json:"client_key_path"`
ConnMaxLifetime *string `hcl:"conn_max_lifetime" json:"conn_max_lifetime"`
MaxOpenConns *int `hcl:"max_open_conns" json:"max_open_conns"`
MaxIdleConns *int `hcl:"max_idle_conns" json:"max_idle_conns"`
DisableMigration bool `hcl:"disable_migration" json:"disable_migration"`
DBTypeConfig *DBTypeConfig
// Undocumented flags
LogSQL bool `hcl:"log_sql" json:"log_sql"`
}
Configuration for the sql datastore implementation. Pointer values are used to distinguish between "unset" and "zero" values.
type DBTypeConfig ¶
type ValidationError ¶
type ValidationError struct {
// contains filtered or unexported fields
}
func (*ValidationError) Error ¶
func (v *ValidationError) Error() string
func (*ValidationError) Unwrap ¶
func (v *ValidationError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.