dialect

package
v1.0.0-RC4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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

func GetDialect(driver string) Dialect

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL