Documentation
¶
Index ¶
Constants ¶
const Version = "0.0.8"
Version indicates package version
Variables ¶
This section is empty.
Functions ¶
func NewDatabase ¶
NewDatabase creates a new instance of DALgo adapter to SQL database.
The returned dal.DB is sealed by dal.NewDB: every read-write transaction it starts hands the worker a transaction whose writes run the framework's BeforeSave validation and hooks before reaching this adapter's code.
func NewSimpleSchema ¶ added in v0.2.1
Types ¶
type DbOptions ¶ added in v0.4.2
type DbOptions struct {
ID string
PrimaryKey []string
Recordsets map[string]*Recordset
// Placeholder controls how SQL parameter markers are emitted.
// The zero value (PlaceholderQuestion) uses "?" — compatible with
// SQLite, MySQL, and most other drivers. Set to PlaceholderDollar
// for PostgreSQL, which requires "$1", "$2", … positional markers.
Placeholder PlaceholderDialect
}
DbOptions provides database sqlOptions for DALgo - // TODO: document why & how to use
func (DbOptions) GetRecordsetByKey ¶ added in v0.4.2
type PlaceholderDialect ¶ added in v0.9.0
type PlaceholderDialect int
PlaceholderDialect selects how positional SQL parameters are formatted. The zero value (PlaceholderQuestion) is backward-compatible with all drivers that accept "?" — SQLite, MySQL, etc.
const ( // PlaceholderQuestion emits "?" for every parameter (default, SQLite/MySQL style). PlaceholderQuestion PlaceholderDialect = iota // PlaceholderDollar emits "$1", "$2", … (PostgreSQL style). PlaceholderDollar )
type Recordset ¶
type Recordset struct {
// contains filtered or unexported fields
}
Recordset hold recordset settings
func NewRecordset ¶ added in v0.0.9
func NewRecordset(name string, t RecordsetType, primaryKey []dal.FieldRef) *Recordset
func (*Recordset) PrimaryKey ¶
func (*Recordset) PrimaryKeyFieldNames ¶ added in v0.0.9
func (*Recordset) Type ¶
func (v *Recordset) Type() RecordsetType
type RecordsetType ¶
type RecordsetType = int
RecordsetType defines type of a database recordset
const ( // Table identifies a table in a database Table RecordsetType = iota )