Documentation
¶
Overview ¶
Package adapters contains database specific code, mainly in sub-packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface {
// DriverName must return the driver name to be used with sql.Open()
DriverName() string
// Quote must return an SQL identifier (table name, column name) quoted,
// ie : "foo" for SQLite or Postgresql, `foo` for MySQL, [foo] for SQLServer.
Quote(string) string
}
Adapter interface is the minimal implementation for an adapter.
type InsertReturningSuffixer ¶
InsertReturningSuffixer is an interface wrapping the optional InsertReturningSuffix method.
InsertReturningSuffix get a list of columns and returns a suffix to be added to the sql statement by the caller, allowing it to retrieve the values of those columns. It is intended to replace the use of LastInsertId() when the driver does not support it, or if there are more 'automatic' fields initialized by the database.
type LimitBuilder ¶
LimitBuilder is an interface wrapping the optional BuildLimit method.
BuildLimit get an integer and returns a string containing a LIMIT sql clause or its equivalent for the adapter, and an array of sql arguments.
type LimitOffsetOrderer ¶
type LimitOffsetOrderer interface {
IsOffsetFirst() bool
}
LimitOffsetOrderer is an interface wrapping the optional IsOffsetFirst method.
The IsOffsetFirst returns true is the OFFSET clause has to precede the LIMIT clause. By default the LIMIT is before the OFFSET.
type OffsetBuilder ¶
OffsetBuilder is an interface wrapping the optional BuildOffset method.
BuildOffset get an integer and returns a string containing an OFFSET sql clause or its equivalent for the adapter, and an array of sql arguments.
type PlaceholdersReplacer ¶
PlaceholdersReplacer is an interface wrapping the optional ReplacePlaceholders method.
ReplacePlaceholders changes all given placeholders in given sql query with the placeholder used by the database targeted by the adapter.