Documentation ¶
Index ¶
- func GetDropTableQuery(table metadata.GoedbTable) string
- func GetFindQuery(table metadata.GoedbTable, where string) (string, error)
- func GetFirstQuery(table metadata.GoedbTable, where string, instance interface{}) (string, error)
- func GetSQLCreate(dialect Dialect, table metadata.GoedbTable) string
- func GetSQLDelete(table metadata.GoedbTable, where string, instance interface{}) (string, error)
- func GetSQLInsert(table metadata.GoedbTable, instance interface{}) (string, error)
- func GetSQLUpdate(table metadata.GoedbTable, instance interface{}) (string, error)
- type Dialect
- type PostgresDialect
- type SQLiteDialect
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDropTableQuery ¶
func GetDropTableQuery(table metadata.GoedbTable) string
GetDropTableQuery returns a drop table query
func GetFindQuery ¶
func GetFindQuery(table metadata.GoedbTable, where string) (string, error)
GetFindQuery returns a find sql query
func GetFirstQuery ¶
func GetFirstQuery(table metadata.GoedbTable, where string, instance interface{}) (string, error)
GetFirstQuery returns a first sql query
func GetSQLCreate ¶
func GetSQLCreate(dialect Dialect, table metadata.GoedbTable) string
GetSQLCreate returns the SQL create query based on the dialect used
func GetSQLDelete ¶
func GetSQLDelete(table metadata.GoedbTable, where string, instance interface{}) (string, error)
GetSQLDelete returns a delete query
func GetSQLInsert ¶
func GetSQLInsert(table metadata.GoedbTable, instance interface{}) (string, error)
GetSQLInsert returns an insert query
func GetSQLUpdate ¶
func GetSQLUpdate(table metadata.GoedbTable, instance interface{}) (string, error)
GetSQLUpdate returns an insert query
Types ¶
type Dialect ¶
type Dialect interface {
GetSQLColumnModel(value metadata.GoedbColumn) (string, string, string, error)
}
Dialect represents a database dialect
func GetDialect ¶
GetDialect returns the dialect depending on the driver used
type PostgresDialect ¶
type PostgresDialect struct { }
PostgresDialect represents a postgresql database dialect
func (*PostgresDialect) GetSQLColumnModel ¶
func (dialect *PostgresDialect) GetSQLColumnModel(value metadata.GoedbColumn) (string, string, string, error)
GetSQLColumnModel returns the model of a column for Postgresql
type SQLiteDialect ¶
type SQLiteDialect struct { }
SQLiteDialect represents a sqlite3 database dialect
func (*SQLiteDialect) GetSQLColumnModel ¶
func (dialect *SQLiteDialect) GetSQLColumnModel(value metadata.GoedbColumn) (string, string, string, error)
GetSQLColumnModel returns the model of a column for SQLite3
Click to show internal directories.
Click to hide internal directories.