Documentation ¶
Index ¶
- Constants
- func Open(flavor string, args ...interface{}) (db *sqlx.DB, err error)
- type BaseFlavor
- func (bf *BaseFlavor) AlterSequenceStart(name string, start int) error
- func (bf *BaseFlavor) AlterTables(i ...interface{}) error
- func (bf *BaseFlavor) BoolToDBBool(b bool) *int
- func (bf *BaseFlavor) BuildComponents(inf *CrudInfo) error
- func (bf *BaseFlavor) Close() error
- func (bf *BaseFlavor) CreateForeignKey(i interface{}, ft, rt, ff, rf string) error
- func (bf *BaseFlavor) CreateIndex(in string, index IndexInfo) error
- func (bf *BaseFlavor) CreateSequence(sn string, start int)
- func (bf *BaseFlavor) CreateTables(i ...interface{}) error
- func (bf *BaseFlavor) DBBoolToBool(i interface{}) bool
- func (bf *BaseFlavor) DBLog(b bool)
- func (bf *BaseFlavor) Delete(ent interface{}) error
- func (bf *BaseFlavor) DestructiveResetTables(i ...interface{}) error
- func (bf *BaseFlavor) DropForeignKey(i interface{}, ft, fkn string) error
- func (bf *BaseFlavor) DropIndex(tn string, in string) error
- func (bf *BaseFlavor) DropSequence(sn string) error
- func (bf *BaseFlavor) DropTables(i ...interface{}) error
- func (bf *BaseFlavor) Exec(queryString string, args ...interface{}) (sql.Result, error)
- func (bf *BaseFlavor) ExecuteQuery(queryString string, qParams ...interface{}) (*sql.Rows, error)
- func (bf *BaseFlavor) ExecuteQueryRow(queryString string, qParams ...interface{}) *sql.Row
- func (bf *BaseFlavor) ExecuteQueryRowx(queryString string, qParams ...interface{}) *sqlx.Row
- func (bf *BaseFlavor) ExecuteQueryx(queryString string, qParams ...interface{}) (*sqlx.Rows, error)
- func (bf *BaseFlavor) ExistsColumn(tn string, cn string) bool
- func (bf *BaseFlavor) ExistsForeignKeyByFields(i interface{}, ft, rt, ff, rf string) (bool, error)
- func (bf *BaseFlavor) ExistsForeignKeyByName(i interface{}, fkn string) (bool, error)
- func (bf *BaseFlavor) ExistsIndex(tn string, in string) bool
- func (bf *BaseFlavor) ExistsSequence(sn string) bool
- func (bf *BaseFlavor) ExistsTable(tn string) bool
- func (bf *BaseFlavor) Get(dst interface{}, queryString string, args ...interface{}) error
- func (bf *BaseFlavor) GetDB() *sqlx.DB
- func (bf *BaseFlavor) GetDBDriverName() string
- func (bf *BaseFlavor) GetDBName() (dbName string)
- func (bf *BaseFlavor) GetDBQuote() string
- func (bf *BaseFlavor) GetEntities(ents interface{}) (interface{}, error)
- func (bf *BaseFlavor) GetEntities2(ge GetEnt) error
- func (bf *BaseFlavor) GetEntities4(ents interface{})
- func (bf *BaseFlavor) GetEntitiesCP(ents interface{}, pList []GetParam, cmdMap map[string]interface{}) (result uint64, err error)
- func (bf *BaseFlavor) GetEntitiesWithCommands(ents interface{}, pList []GetParam, cmdMap map[string]interface{}) (interface{}, error)
- func (bf *BaseFlavor) GetEntity(ent interface{}) error
- func (bf *BaseFlavor) GetNextSequenceValue(name string) (int, error)
- func (bf *BaseFlavor) GetRelations(tn string) []string
- func (bf *BaseFlavor) IsDBLog() bool
- func (bf *BaseFlavor) IsLog() bool
- func (bf *BaseFlavor) Log(b bool)
- func (bf *BaseFlavor) ProcessSchema(schema string)
- func (bf *BaseFlavor) ProcessSchemaList(sList []string)
- func (bf *BaseFlavor) ProcessTransaction(tList []string) error
- func (bf *BaseFlavor) QsLog(queryString string, qParams ...interface{})
- func (bf *BaseFlavor) Select(dst interface{}, queryString string, args ...interface{}) error
- func (bf *BaseFlavor) SetDB(db *sqlx.DB)
- func (bf *BaseFlavor) SetMaxIdleConns(n int)
- func (bf *BaseFlavor) SetMaxOpenConns(n int)
- func (bf *BaseFlavor) TimeToFormattedString(i interface{}) string
- type ColComponents
- type CrudInfo
- type FKeyInfo
- type ForeignKeyBuffer
- type GetEnt
- type GetParam
- type HDBFlavor
- func (hf *HDBFlavor) AlterTables(i ...interface{}) error
- func (hf *HDBFlavor) Create(ent interface{}) error
- func (hf *HDBFlavor) CreateSequence(sn string, start int)
- func (hf *HDBFlavor) CreateTables(i ...interface{}) error
- func (hf *HDBFlavor) DestructiveResetTables(i ...interface{}) error
- func (hf *HDBFlavor) DropIndex(tn string, in string) error
- func (hf *HDBFlavor) DropSequence(sn string) error
- func (hf *HDBFlavor) DropTables(i ...interface{}) error
- func (hf *HDBFlavor) ExistsColumn(tn string, cn string) bool
- func (hf *HDBFlavor) ExistsForeignKeyByFields(i interface{}, ft, rt, ff, rf string) (bool, error)
- func (hf *HDBFlavor) ExistsForeignKeyByName(i interface{}, fkn string) (bool, error)
- func (hf *HDBFlavor) ExistsIndex(tn string, in string) bool
- func (hf *HDBFlavor) ExistsSequence(sn string) bool
- func (hf *HDBFlavor) ExistsTable(tn string) bool
- func (hf *HDBFlavor) GetDBName() (dbName string)
- func (hf *HDBFlavor) GetNextSequenceValue(name string) (int, error)
- func (hf *HDBFlavor) Update(ent interface{}) error
- type IndexInfo
- type MSSQLFlavor
- func (msf *MSSQLFlavor) AlterSequenceStart(name string, start int) error
- func (msf *MSSQLFlavor) AlterTables(i ...interface{}) error
- func (msf *MSSQLFlavor) Create(ent interface{}) error
- func (msf *MSSQLFlavor) CreateTables(i ...interface{}) error
- func (msf *MSSQLFlavor) DestructiveResetTables(i ...interface{}) error
- func (msf *MSSQLFlavor) DropIndex(tn string, in string) error
- func (msf *MSSQLFlavor) DropTables(i ...interface{}) error
- func (msf *MSSQLFlavor) ExistsColumn(tn string, cn string) bool
- func (msf *MSSQLFlavor) ExistsForeignKeyByFields(i interface{}, ft, rt, ff, rf string) (bool, error)
- func (msf *MSSQLFlavor) ExistsForeignKeyByName(i interface{}, fkn string) (bool, error)
- func (msf *MSSQLFlavor) ExistsIndex(tn string, in string) bool
- func (msf *MSSQLFlavor) ExistsTable(tn string) bool
- func (msf *MSSQLFlavor) GetDBName() (dbName string)
- func (msf *MSSQLFlavor) GetEntitiesCP(ents interface{}, pList []GetParam, cmdMap map[string]interface{}) (result uint64, err error)
- func (msf *MSSQLFlavor) GetEntitiesWithCommands(ents interface{}, pList []GetParam, cmdMap map[string]interface{}) (interface{}, error)
- func (msf *MSSQLFlavor) GetNextSequenceValue(name string) (int, error)
- func (msf *MSSQLFlavor) Update(ent interface{}) error
- type MySQLFlavor
- func (myf *MySQLFlavor) AlterSequenceStart(name string, start int) error
- func (myf *MySQLFlavor) AlterTables(i ...interface{}) error
- func (myf *MySQLFlavor) Create(ent interface{}) error
- func (myf *MySQLFlavor) CreateTables(i ...interface{}) error
- func (myf *MySQLFlavor) DestructiveResetTables(i ...interface{}) error
- func (myf *MySQLFlavor) DropForeignKey(i interface{}, ft, fkn string) error
- func (myf *MySQLFlavor) DropIndex(tn string, in string) error
- func (myf *MySQLFlavor) ExistsForeignKeyByFields(i interface{}, ft, rt, ff, rf string) (bool, error)
- func (myf *MySQLFlavor) ExistsForeignKeyByName(i interface{}, fkn string) (bool, error)
- func (myf *MySQLFlavor) GetNextSequenceValue(name string) (int, error)
- func (myf *MySQLFlavor) Update(ent interface{}) error
- type PostgresFlavor
- func (pf *PostgresFlavor) AlterSequenceStart(sn string, start int) error
- func (pf *PostgresFlavor) AlterTables(i ...interface{}) error
- func (pf *PostgresFlavor) Create(ent interface{}) error
- func (pf *PostgresFlavor) CreateSequence(sn string, start int)
- func (pf *PostgresFlavor) CreateTables(i ...interface{}) error
- func (pf *PostgresFlavor) DestructiveResetTables(i ...interface{}) error
- func (pf *PostgresFlavor) DropIndex(tn string, in string) error
- func (pf *PostgresFlavor) DropTables(i ...interface{}) error
- func (pf *PostgresFlavor) ExistsColumn(tn string, cn string) bool
- func (pf *PostgresFlavor) ExistsForeignKeyByFields(i interface{}, ft, rt, ff, rf string) (bool, error)
- func (pf *PostgresFlavor) ExistsForeignKeyByName(i interface{}, fkn string) (bool, error)
- func (pf *PostgresFlavor) ExistsIndex(tn string, in string) bool
- func (pf *PostgresFlavor) ExistsSequence(sn string) bool
- func (pf *PostgresFlavor) ExistsTable(tn string) bool
- func (pf *PostgresFlavor) GetDBName() (dbName string)
- func (pf *PostgresFlavor) GetNextSequenceValue(name string) (int, error)
- func (pf *PostgresFlavor) Update(ent interface{}) error
- type PublicDB
- type SQLiteFlavor
- func (slf *SQLiteFlavor) AlterSequenceStart(name string, start int) error
- func (slf *SQLiteFlavor) AlterTables(i ...interface{}) error
- func (slf *SQLiteFlavor) Create(ent interface{}) error
- func (slf *SQLiteFlavor) CreateForeignKey(i interface{}, ft, rt, ff, rf string) error
- func (slf *SQLiteFlavor) CreateTables(i ...interface{}) error
- func (slf *SQLiteFlavor) DestructiveResetTables(i ...interface{}) error
- func (slf *SQLiteFlavor) DropForeignKey(i interface{}, ft, fkn string) error
- func (slf *SQLiteFlavor) DropIndex(tn string, in string) error
- func (slf *SQLiteFlavor) DropTables(i ...interface{}) error
- func (slf *SQLiteFlavor) ExistsColumn(tn string, cn string) bool
- func (slf *SQLiteFlavor) ExistsForeignKeyByFields(i interface{}, ft, rt, ff, rf string) (bool, error)
- func (slf *SQLiteFlavor) ExistsForeignKeyByName(i interface{}, fkn string) (bool, error)
- func (slf *SQLiteFlavor) ExistsIndex(tn string, in string) bool
- func (slf *SQLiteFlavor) ExistsTable(tn string) bool
- func (slf *SQLiteFlavor) GetDBName() (dbName string)
- func (slf *SQLiteFlavor) GetNextSequenceValue(name string) (int, error)
- func (slf *SQLiteFlavor) Update(ent interface{}) error
- type Sqac
- type TblComponents
Constants ¶
const CBackTick = "`"
const CDblQuote = "\""
const CTick = "'"
CTick CBackTick and CDblQuote specify the quote style for for db field encapsulation in CREATE and ALTER table schemas
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseFlavor ¶
type BaseFlavor struct { PublicDB // contains filtered or unexported fields }
BaseFlavor is a supporting struct for interface PublicDB
func (*BaseFlavor) AlterSequenceStart ¶
func (bf *BaseFlavor) AlterSequenceStart(name string, start int) error
AlterSequenceStart may be used to make changes to the start value of the named sequence, autoincrement or identity field depending on the manner in which the currently connected database flavour handles key generation.
func (*BaseFlavor) AlterTables ¶
func (bf *BaseFlavor) AlterTables(i ...interface{}) error
AlterTables alters tables on the db based on the provided list of go struct definitions.
func (*BaseFlavor) BoolToDBBool ¶
func (bf *BaseFlavor) BoolToDBBool(b bool) *int
BoolToDBBool converts a go-bool value into the DB bool representation. called for DB's that do not support a true/false boolean type.
func (*BaseFlavor) BuildComponents ¶
func (bf *BaseFlavor) BuildComponents(inf *CrudInfo) error
BuildComponents is used by each flavor to assemble the struct (entity) data for CRUD operations. There is some redundancy in the structure for now, as it has recently been migrated into BaseFlavor.
func (*BaseFlavor) CreateForeignKey ¶
func (bf *BaseFlavor) CreateForeignKey(i interface{}, ft, rt, ff, rf string) error
CreateForeignKey creates a foreign-key on an existing column.
func (*BaseFlavor) CreateIndex ¶
func (bf *BaseFlavor) CreateIndex(in string, index IndexInfo) error
CreateIndex creates the index contained in the incoming IndexInfo structure. indexes will be created as non-unique by default, and in multi-field situations, the fields will added to the index in the order they are contained in the IndexInfo.[]IndexFields slice.
func (*BaseFlavor) CreateSequence ¶
func (bf *BaseFlavor) CreateSequence(sn string, start int)
CreateSequence may be used to create a new sequence on the currently connected database.
func (*BaseFlavor) CreateTables ¶
func (bf *BaseFlavor) CreateTables(i ...interface{}) error
CreateTables creates tables on the db based on the provided list of go struct definitions.
func (*BaseFlavor) DBBoolToBool ¶
func (bf *BaseFlavor) DBBoolToBool(i interface{}) bool
DBBoolToBool converts from the DB representation of a bool into the go-bool type. The is called for DB's that do not support a true/false boolean type.
func (*BaseFlavor) DBLog ¶
func (bf *BaseFlavor) DBLog(b bool)
DBLog sets the db-access-logging status
func (*BaseFlavor) Delete ¶
func (bf *BaseFlavor) Delete(ent interface{}) error
Delete - CRUD Delete an existing entity (single-row) on the database using the full-key
func (*BaseFlavor) DestructiveResetTables ¶
func (bf *BaseFlavor) DestructiveResetTables(i ...interface{}) error
DestructiveResetTables drops tables on the db if they exist, as well as any related objects such as sequences. this is useful if you wish to regenerated your table and the number-range used by an auto-incementing primary key.
func (*BaseFlavor) DropForeignKey ¶
func (bf *BaseFlavor) DropForeignKey(i interface{}, ft, fkn string) error
DropForeignKey drops a foreign-key on an existing column
func (*BaseFlavor) DropIndex ¶
func (bf *BaseFlavor) DropIndex(tn string, in string) error
DropIndex drops the specfied index on the connected database.
func (*BaseFlavor) DropSequence ¶
func (bf *BaseFlavor) DropSequence(sn string) error
DropSequence may be used to drop the named sequence on the currently connected database. This is probably not needed, as we are now creating sequences on postgres in a more correct manner. select pg_get_serial_sequence('public.some_table', 'some_column');
func (*BaseFlavor) DropTables ¶
func (bf *BaseFlavor) DropTables(i ...interface{}) error
DropTables drops tables on the db if they exist, based on the provided list of go struct definitions.
func (*BaseFlavor) Exec ¶
func (bf *BaseFlavor) Exec(queryString string, args ...interface{}) (sql.Result, error)
Exec runs the queryString against the connected db
func (*BaseFlavor) ExecuteQuery ¶
func (bf *BaseFlavor) ExecuteQuery(queryString string, qParams ...interface{}) (*sql.Rows, error)
ExecuteQuery processes the multi-row query contained in queryString against the connected DB using sql/database.
func (*BaseFlavor) ExecuteQueryRow ¶
func (bf *BaseFlavor) ExecuteQueryRow(queryString string, qParams ...interface{}) *sql.Row
ExecuteQueryRow processes the single-row query contained in queryString against the connected DB using sql/database.
func (*BaseFlavor) ExecuteQueryRowx ¶
func (bf *BaseFlavor) ExecuteQueryRowx(queryString string, qParams ...interface{}) *sqlx.Row
ExecuteQueryRowx processes the single-row query contained in queryString against the connected DB using sqlx.
func (*BaseFlavor) ExecuteQueryx ¶
func (bf *BaseFlavor) ExecuteQueryx(queryString string, qParams ...interface{}) (*sqlx.Rows, error)
ExecuteQueryx processes the multi-row query contained in queryString against the connected DB using sqlx.
func (*BaseFlavor) ExistsColumn ¶
func (bf *BaseFlavor) ExistsColumn(tn string, cn string) bool
ExistsColumn checks the currently connected database and returns true if the named table-column is found to exist. this checks the column name only, not the column data-type or properties.
func (*BaseFlavor) ExistsForeignKeyByFields ¶
func (bf *BaseFlavor) ExistsForeignKeyByFields(i interface{}, ft, rt, ff, rf string) (bool, error)
ExistsForeignKeyByFields checks to see if a foreign-key exists between the named tables and fields.
func (*BaseFlavor) ExistsForeignKeyByName ¶
func (bf *BaseFlavor) ExistsForeignKeyByName(i interface{}, fkn string) (bool, error)
ExistsForeignKeyByName checks to see if the named foreign-key exists on the table corresponding to provided sqac model (i).
func (*BaseFlavor) ExistsIndex ¶
func (bf *BaseFlavor) ExistsIndex(tn string, in string) bool
ExistsIndex checks the connected database for the presence of the specified index.
func (*BaseFlavor) ExistsSequence ¶
func (bf *BaseFlavor) ExistsSequence(sn string) bool
ExistsSequence checks for the presence of the named sequence on the currently connected database.
func (*BaseFlavor) ExistsTable ¶
func (bf *BaseFlavor) ExistsTable(tn string) bool
ExistsTable checks the currently connected database and returns true if the named table is found to exist.
func (*BaseFlavor) Get ¶
func (bf *BaseFlavor) Get(dst interface{}, queryString string, args ...interface{}) error
Get reads a single row into the dst interface. This calls sqlx.Get(...)
func (*BaseFlavor) GetDB ¶
func (bf *BaseFlavor) GetDB() *sqlx.DB
GetDB returns a *sqlx.DB pointer if one has been set in the db-flavor environment.
func (*BaseFlavor) GetDBDriverName ¶
func (bf *BaseFlavor) GetDBDriverName() string
GetDBDriverName returns the name of the current db-driver
func (*BaseFlavor) GetDBName ¶
func (bf *BaseFlavor) GetDBName() (dbName string)
GetDBName returns the name of the currently connected db
func (*BaseFlavor) GetDBQuote ¶
func (bf *BaseFlavor) GetDBQuote() string
GetDBQuote reports the quoting preference for db-query construction. this does not refer to quoted strings, but rather to the older(?) style of quoting table field-names in query-strings such as: SELECT "f1" FROM "t1" WHERE "v1" = <some_criteria>. in practice, it seems you can get away without quoting, but it is a nod to backward compatibility for existing db installs. ' vs ` vs " for example
func (*BaseFlavor) GetEntities ¶
func (bf *BaseFlavor) GetEntities(ents interface{}) (interface{}, error)
GetEntities is experimental - use GetEntitiesWithCommands.
func (*BaseFlavor) GetEntities2 ¶
func (bf *BaseFlavor) GetEntities2(ge GetEnt) error
GetEntities2 attempts to retrieve all entities based on the internal implementation of interface GetEnt. GetEnt exposes a single method (Exec(handle PublicDB)error) to execute the request. All this because go can only go so far with meta-type programming in go before being buried in reflection. ge allows you to pass a sqac handle into the method so you can code directly against the desired struct/table with no reflection. GetEntities2 has been replaced by GetEntitiesWithCommands, but can be used if you want a clean looking API that is pretty quick (very light use of reflection). That said, it is a --dirty-- way of doing things.
func (*BaseFlavor) GetEntities4 ¶
func (bf *BaseFlavor) GetEntities4(ents interface{})
GetEntities4 is experimental - use GetEntitiesCP.
This method uses alot of reflection to permit the retrieval of the equivalent of []interface{} where interface{} can be taken to mean Model{}. This can be used, but may prove to be a slow way of doing things. A quick internet search on []interface{} will turn up all sorts of acrimony. Notice that the method signature is still interface{}? Not very transparent.
func (*BaseFlavor) GetEntitiesCP ¶
func (bf *BaseFlavor) GetEntitiesCP(ents interface{}, pList []GetParam, cmdMap map[string]interface{}) (result uint64, err error)
GetEntitiesCP uses alot of reflection to permit the retrieval of the equivalent of []interface{} where interface{} can be taken to mean Model{}. This is the Get method that is preferred, as the caller can simply pass a pointer to a slice of the requested table-type in the ents parameter, then read the resulting slice directly in their program following method execution. Each DB needs slightly different handling due to differences in OFFSET / LIMIT / TOP support. This is a mostly common version, but MSSQL has its own specific implementation due to some extra differences in transact-SQL.
func (*BaseFlavor) GetEntitiesWithCommands ¶
func (bf *BaseFlavor) GetEntitiesWithCommands(ents interface{}, pList []GetParam, cmdMap map[string]interface{}) (interface{}, error)
GetEntitiesWithCommands - it is recommended to use GetEntitiesCP instead of this method This method can be used as a get for lists of entities. Each DB needs slightly different handling due to differences in OFFSET / LIMIT / TOP support. This is a mostly common version, but MSSQL has its own specific implementation due to some extra differences in transact-SQL. This method still requires that the caller perform a type-assertion on the returned interface{} ([]interface{}) parameter.
func (*BaseFlavor) GetEntity ¶
func (bf *BaseFlavor) GetEntity(ent interface{}) error
GetEntity - CRUD GetEntity gets an existing entity from the db using the primary key definition. It is expected that ID will have been populated in the body by the caller.
func (*BaseFlavor) GetNextSequenceValue ¶
func (bf *BaseFlavor) GetNextSequenceValue(name string) (int, error)
GetNextSequenceValue returns the next value of the named or derived sequence, auto-increment or identity field depending on which db-system is presently being used.
func (*BaseFlavor) GetRelations ¶
func (bf *BaseFlavor) GetRelations(tn string) []string
GetRelations is designed to take a tablename and use it to determine a list of related objects. this is just an idea, and the functionality will reqiure more than the return of a []string.
func (*BaseFlavor) IsDBLog ¶
func (bf *BaseFlavor) IsDBLog() bool
IsDBLog reports whether db-access-logging is active
func (*BaseFlavor) IsLog ¶
func (bf *BaseFlavor) IsLog() bool
IsLog reports whether logging is active
func (*BaseFlavor) ProcessSchema ¶
func (bf *BaseFlavor) ProcessSchema(schema string)
ProcessSchema processes the schema against the connected DB.
func (*BaseFlavor) ProcessSchemaList ¶
func (bf *BaseFlavor) ProcessSchemaList(sList []string)
ProcessSchemaList processes the schemas contained in sList in the order in which they were provided. Schemas are executed against the connected DB. DEPRECATED: USER ProcessTransactionList
func (*BaseFlavor) ProcessTransaction ¶
func (bf *BaseFlavor) ProcessTransaction(tList []string) error
ProcessTransaction processes the list of commands as a transaction. If any of the commands encounter an error, the transaction will be cancelled via a Rollback and the error message will be returned to the caller. It is assumed that tList contains bound queryStrings.
func (*BaseFlavor) QsLog ¶
func (bf *BaseFlavor) QsLog(queryString string, qParams ...interface{})
QsLog is used to log SQL statements to stdout. Statements are text approximations of what was sent to the database. For the most part they should be correct, but quoting around parameter values is rudimentary.
func (*BaseFlavor) Select ¶
func (bf *BaseFlavor) Select(dst interface{}, queryString string, args ...interface{}) error
Select reads some rows into the dst interface. This calls sqlx.Select(...)
func (*BaseFlavor) SetDB ¶
func (bf *BaseFlavor) SetDB(db *sqlx.DB)
SetDB sets the sqlx.DB connection in the db-flavor environment.
func (*BaseFlavor) SetMaxIdleConns ¶
func (bf *BaseFlavor) SetMaxIdleConns(n int)
SetMaxIdleConns calls sqlx.SetMaxIdleConns
func (*BaseFlavor) SetMaxOpenConns ¶
func (bf *BaseFlavor) SetMaxOpenConns(n int)
SetMaxOpenConns calls sqlx.SetMaxOpenConns
func (*BaseFlavor) TimeToFormattedString ¶
func (bf *BaseFlavor) TimeToFormattedString(i interface{}) string
TimeToFormattedString is used to format the provided time.Time or *time.Time value in the string format required for the connected db insert or update operation. This method is called from within the CRUD ops for each db flavor, and could be added to the flavor-specific Query / Exec methods at some point.
type ColComponents ¶
type ColComponents struct {
// contains filtered or unexported fields
}
ColComponents is used to capture the field properties from sqac: tags during table creation and table alteration activities.
type CrudInfo ¶
type CrudInfo struct {
// contains filtered or unexported fields
}
CrudInfo contains information used to perform CRUD activities. Pre-call and post-call organization and formatting. v = Value (underlying struct of interface ptr ent)
type FKeyInfo ¶
type FKeyInfo struct { FromTable string FromField string RefTable string RefField string FKeyName string }
FKeyInfo holds foreign-key defs read from the sqac:"fkey" tags sqac:"fkey:ref_table(ref_field)"
type ForeignKeyBuffer ¶
type ForeignKeyBuffer struct {
// contains filtered or unexported fields
}
ForeignKeyBuffer is used to hold deferred foreign-key information pending the creation of all tables submitted in a CreateTable(...) or AlterTable(...) call.
type GetEnt ¶
GetEnt interface is provided for retrieval of slices containing arbitrary structs. Exec accepts a handle to a PublicDB interface, thereby providing access to the DB sqac is connected to. it is up to the caller to code the underlying value / code. As awful as this seems, it eliminates the need to abuse reflection or unsafe pointers to achieve the goal of a general CRUD API.
type HDBFlavor ¶
type HDBFlavor struct {
BaseFlavor
}
HDBFlavor is a SAP Hana-specific implementation, where the Hana DB is approached as a traditional SQL-92 compliant database. As such, some of the nice HDB things are left out. Methods defined in the PublicDB interface of struct-type BaseFlavor are called by default for HDBFlavor. If the method as it exists in the BaseFlavor implementation is not compatible with the schema-syntax required by HDB, the method in question may be overridden. Overriding (redefining) a BaseFlavor method may be accomplished through the addition of a matching method signature and implementation on the HDBFlavor struct-type.
func (*HDBFlavor) AlterTables ¶
AlterTables alters tables on the HDB database referenced by hf.DB.
func (*HDBFlavor) CreateSequence ¶
CreateSequence is used to create a sequence for use with HDB Identity columns.
func (*HDBFlavor) CreateTables ¶
CreateTables creates tables on the hdb database referenced by hf.DB.
func (*HDBFlavor) DestructiveResetTables ¶
DestructiveResetTables drops tables on the HDB db if they exist, as well as any related objects such as sequences. this is useful if you wish to regenerated your table and the number-range used by an auto-incementing primary key.
func (*HDBFlavor) DropSequence ¶
DropSequence is used to drop an existing sequence in HDB.
func (*HDBFlavor) DropTables ¶
DropTables drops tables on the db if they exist, based on the provided list of go struct definitions.
func (*HDBFlavor) ExistsColumn ¶
ExistsColumn checks the currently connected database and returns true if the named table-column is found to exist. this checks the column name only, not the column data-type or properties.
func (*HDBFlavor) ExistsForeignKeyByFields ¶
ExistsForeignKeyByFields checks to see if a foreign-key exists between the named tables and fields.
func (*HDBFlavor) ExistsForeignKeyByName ¶
ExistsForeignKeyByName checks to see if the named foreign-key exists on the table corresponding to provided sqac model (i).
func (*HDBFlavor) ExistsIndex ¶
ExistsIndex checks the connected database for the presence of the specified index.
func (*HDBFlavor) ExistsSequence ¶
ExistsSequence is used to check for the existence of the named sequence in HDB.
func (*HDBFlavor) ExistsTable ¶
ExistsTable checks the currently connected database and returns true if the named table is found to exist.
func (*HDBFlavor) GetNextSequenceValue ¶
GetNextSequenceValue is used primarily for testing. It returns the next value of the named HDB identity (auto-increment) field in the named table. this is not a reliable way to get the inserted id in a multi-transaction environment.
type MSSQLFlavor ¶
type MSSQLFlavor struct {
BaseFlavor
}
MSSQLFlavor is a MSSQL-specific implementation. Methods defined in the PublicDB interface of struct-type BaseFlavor are called by default for MSSQLFlavor. If the method as it exists in the BaseFlavor implementation is not compatible with the schema-syntax required by MSSQL, the method in question may be overridden. Overriding (redefining) a BaseFlavor method may be accomplished through the addition of a matching method signature and implementation on the MSSQLFlavor struct-type.
func (*MSSQLFlavor) AlterSequenceStart ¶
func (msf *MSSQLFlavor) AlterSequenceStart(name string, start int) error
AlterSequenceStart may be used to make changes to the start value of the named identity-field on the currently connected MSSQL database.
func (*MSSQLFlavor) AlterTables ¶
func (msf *MSSQLFlavor) AlterTables(i ...interface{}) error
AlterTables alters tables on the MSSQL database referenced by msf.DB.
func (*MSSQLFlavor) Create ¶
func (msf *MSSQLFlavor) Create(ent interface{}) error
Create the entity (single-row) on the database
func (*MSSQLFlavor) CreateTables ¶
func (msf *MSSQLFlavor) CreateTables(i ...interface{}) error
CreateTables creates tables on the mysql database referenced by msf.DB.
func (*MSSQLFlavor) DestructiveResetTables ¶
func (msf *MSSQLFlavor) DestructiveResetTables(i ...interface{}) error
DestructiveResetTables drops tables on the MSSQL db if they exist, as well as any related objects such as sequences. this is useful if you wish to regenerated your table and the number-range used by an auto-incementing primary key.
func (*MSSQLFlavor) DropIndex ¶
func (msf *MSSQLFlavor) DropIndex(tn string, in string) error
DropIndex drops the specfied index on the connected database.
func (*MSSQLFlavor) DropTables ¶
func (msf *MSSQLFlavor) DropTables(i ...interface{}) error
DropTables drops tables on the db if they exist, based on the provided list of go struct definitions.
func (*MSSQLFlavor) ExistsColumn ¶
func (msf *MSSQLFlavor) ExistsColumn(tn string, cn string) bool
ExistsColumn checks the currently connected database and returns true if the named table-column is found to exist. this checks the column name only, not the column data-type or properties.
func (*MSSQLFlavor) ExistsForeignKeyByFields ¶
func (msf *MSSQLFlavor) ExistsForeignKeyByFields(i interface{}, ft, rt, ff, rf string) (bool, error)
ExistsForeignKeyByFields checks to see if a foreign-key exists between the named tables and fields.
func (*MSSQLFlavor) ExistsForeignKeyByName ¶
func (msf *MSSQLFlavor) ExistsForeignKeyByName(i interface{}, fkn string) (bool, error)
ExistsForeignKeyByName checks to see if the named foreign-key exists on the table corresponding to provided sqac model (i).
func (*MSSQLFlavor) ExistsIndex ¶
func (msf *MSSQLFlavor) ExistsIndex(tn string, in string) bool
ExistsIndex checks the connected database for the presence of the specified index.
func (*MSSQLFlavor) ExistsTable ¶
func (msf *MSSQLFlavor) ExistsTable(tn string) bool
ExistsTable checks the currently connected database and returns true if the named table is found to exist.
func (*MSSQLFlavor) GetDBName ¶
func (msf *MSSQLFlavor) GetDBName() (dbName string)
GetDBName returns the name of the currently connected db
func (*MSSQLFlavor) GetEntitiesCP ¶
func (msf *MSSQLFlavor) GetEntitiesCP(ents interface{}, pList []GetParam, cmdMap map[string]interface{}) (result uint64, err error)
GetEntitiesCP is a parameterized get. See the BaseFlavor implementation for more info.
func (*MSSQLFlavor) GetEntitiesWithCommands ¶
func (msf *MSSQLFlavor) GetEntitiesWithCommands(ents interface{}, pList []GetParam, cmdMap map[string]interface{}) (interface{}, error)
GetEntitiesWithCommands is a parameterized get. See the BaseFlavor implementation for more info.
func (*MSSQLFlavor) GetNextSequenceValue ¶
func (msf *MSSQLFlavor) GetNextSequenceValue(name string) (int, error)
GetNextSequenceValue is used primarily for testing. It returns the current value of the MSSQL identity (auto-increment) field for the named table.
func (*MSSQLFlavor) Update ¶
func (msf *MSSQLFlavor) Update(ent interface{}) error
Update an existing entity (single-row) on the database
type MySQLFlavor ¶
type MySQLFlavor struct {
BaseFlavor
}
MySQLFlavor is a MySQL-specific implementation. Methods defined in the PublicDB interface of struct-type BaseFlavor are called by default for MySQLFlavor. If the method as it exists in the BaseFlavor implementation is not compatible with the schema-syntax required by MySQL, the method in question may be overridden. Overriding (redefining) a BaseFlavor method may be accomplished through the addition of a matching method signature and implementation on the MySQLFlavor struct-type.
func (*MySQLFlavor) AlterSequenceStart ¶
func (myf *MySQLFlavor) AlterSequenceStart(name string, start int) error
AlterSequenceStart may be used to make changes to the start value of the named auto_increment field in the MySQL database. Note that this is intended to deal with auto-incrementing primary keys only. It is possible in MySQL to setup a non-primary-key field as auto_increment as follows:
ALTER TABLE users ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT, ADD INDEX (id); This is not presently supported.
func (*MySQLFlavor) AlterTables ¶
func (myf *MySQLFlavor) AlterTables(i ...interface{}) error
AlterTables alters tables on the MySQL database referenced by myf.DB.
func (*MySQLFlavor) Create ¶
func (myf *MySQLFlavor) Create(ent interface{}) error
Create the entity (single-row) on the database
func (*MySQLFlavor) CreateTables ¶
func (myf *MySQLFlavor) CreateTables(i ...interface{}) error
CreateTables creates tables on the mysql database referenced by myf.DB.
func (*MySQLFlavor) DestructiveResetTables ¶
func (myf *MySQLFlavor) DestructiveResetTables(i ...interface{}) error
DestructiveResetTables drops tables on the MySQL db if they exist, as well as any related objects such as sequences. this is useful if you wish to regenerated your table and the number-range used by an auto-incementing primary key.
func (*MySQLFlavor) DropForeignKey ¶
func (myf *MySQLFlavor) DropForeignKey(i interface{}, ft, fkn string) error
DropForeignKey drops a foreign-key on an existing column
func (*MySQLFlavor) DropIndex ¶
func (myf *MySQLFlavor) DropIndex(tn string, in string) error
DropIndex drops the specfied index on the connected database.
func (*MySQLFlavor) ExistsForeignKeyByFields ¶
func (myf *MySQLFlavor) ExistsForeignKeyByFields(i interface{}, ft, rt, ff, rf string) (bool, error)
ExistsForeignKeyByFields checks to see if a foreign-key exists between the named tables and fields.
func (*MySQLFlavor) ExistsForeignKeyByName ¶
func (myf *MySQLFlavor) ExistsForeignKeyByName(i interface{}, fkn string) (bool, error)
ExistsForeignKeyByName checks to see if the named foreign-key exists on the table corresponding to provided sqac model (i).
func (*MySQLFlavor) GetNextSequenceValue ¶
func (myf *MySQLFlavor) GetNextSequenceValue(name string) (int, error)
GetNextSequenceValue is used primarily for testing. It returns the current value of the MySQL auto-increment field for the named table.
func (*MySQLFlavor) Update ¶
func (myf *MySQLFlavor) Update(ent interface{}) error
Update an existing entity (single-row) on the database
type PostgresFlavor ¶
type PostgresFlavor struct {
BaseFlavor
}
PostgresFlavor is a postgres-specific implementation. Methods defined in the PublicDB interface of struct-type BaseFlavor are called by default for PostgresFlavor. If the method as it exists in the BaseFlavor implementation is not compatible with the schema-syntax required by Postgres, the method in question may be overridden. Overriding (redefining) a BaseFlavor method may be accomplished through the addition of a matching method signature and implementation on the PostgresFlavor struct-type.
func (*PostgresFlavor) AlterSequenceStart ¶
func (pf *PostgresFlavor) AlterSequenceStart(sn string, start int) error
AlterSequenceStart adjusts the starting value of the named sequence. This should be called very carefully, preferably only at the time that the table/sequence is created on the db. There are no safeguards here.
func (*PostgresFlavor) AlterTables ¶
func (pf *PostgresFlavor) AlterTables(i ...interface{}) error
AlterTables alters tables on the Postgres database referenced by pf.DB.
func (*PostgresFlavor) Create ¶
func (pf *PostgresFlavor) Create(ent interface{}) error
Create the entity (single-row) on the database
func (*PostgresFlavor) CreateSequence ¶
func (pf *PostgresFlavor) CreateSequence(sn string, start int)
CreateSequence creates the required sequence on the connected Postgres database in the public schema. Panics on error.
func (*PostgresFlavor) CreateTables ¶
func (pf *PostgresFlavor) CreateTables(i ...interface{}) error
CreateTables creates tables on the postgres database referenced by pf.DB.
func (*PostgresFlavor) DestructiveResetTables ¶
func (pf *PostgresFlavor) DestructiveResetTables(i ...interface{}) error
DestructiveResetTables drops tables on the db if they exist, as well as any related objects such as sequences. this is useful if you wish to regenerated your table and the number-range used by an auto-incementing primary key.
func (*PostgresFlavor) DropIndex ¶
func (pf *PostgresFlavor) DropIndex(tn string, in string) error
DropIndex drops the specfied index on the connected Postgres database. tn is ignored for Postgres.
func (*PostgresFlavor) DropTables ¶
func (pf *PostgresFlavor) DropTables(i ...interface{}) error
DropTables drops tables on the postgres database referenced by pf.DB.
func (*PostgresFlavor) ExistsColumn ¶
func (pf *PostgresFlavor) ExistsColumn(tn string, cn string) bool
ExistsColumn checks for the existence of the specified table-column checking for the column name. this is rather incomplete, but in many cases where there is a type-discrepancy it is necessary to drop and recreate the column - or the entire table if a key is involved. consider also that pg requies autoincrement fields to be specified as 'serial' or 'bigserial', but then goes on to report them as 'integer' in the actual db-scema.
func (*PostgresFlavor) ExistsForeignKeyByFields ¶
func (pf *PostgresFlavor) ExistsForeignKeyByFields(i interface{}, ft, rt, ff, rf string) (bool, error)
ExistsForeignKeyByFields checks to see if a foreign-key exists between the named tables and fields.
func (*PostgresFlavor) ExistsForeignKeyByName ¶
func (pf *PostgresFlavor) ExistsForeignKeyByName(i interface{}, fkn string) (bool, error)
ExistsForeignKeyByName checks to see if the named foreign-key exists on the table corresponding to provided sqac model (i).
func (*PostgresFlavor) ExistsIndex ¶
func (pf *PostgresFlavor) ExistsIndex(tn string, in string) bool
ExistsIndex checks the connected Postgres database for the presence of the specified index - assuming that the index-type has not been adjusted...
func (*PostgresFlavor) ExistsSequence ¶
func (pf *PostgresFlavor) ExistsSequence(sn string) bool
ExistsSequence checks the public schema of the connected Postgres DB for the existence of the provided sequence name.
func (*PostgresFlavor) ExistsTable ¶
func (pf *PostgresFlavor) ExistsTable(tn string) bool
ExistsTable checks the public schema of the connected Postgres DB for the existence of the provided table name. Note that the use of to_regclass(<obj_name>) checks for the existence of *any* object in the public schema that has that name. If obj/name consistency is maintained, this approach is fine.
func (*PostgresFlavor) GetDBName ¶
func (pf *PostgresFlavor) GetDBName() (dbName string)
GetDBName returns the name of the currently connected db
func (*PostgresFlavor) GetNextSequenceValue ¶
func (pf *PostgresFlavor) GetNextSequenceValue(name string) (int, error)
GetNextSequenceValue is used primarily for testing. It returns the current value of the sequence assigned to the primary-key of the of the named Postgres table. Although it is possible to assign Postgres sequences to non-primary-key fields (composite key gen), sqac handle auto-increment as a primary-key constraint only.
func (*PostgresFlavor) Update ¶
func (pf *PostgresFlavor) Update(ent interface{}) error
Update an existing entity (single-row) on the database
type PublicDB ¶
type PublicDB interface { // postgres, sqlite, mariadb, hdb, hana etc. GetDBDriverName() string // activate / check logging Log(b bool) IsLog() bool DBLog(b bool) IsDBLog() bool // set the *sqlx.DB handle for the PublicDB interface SetDB(db *sqlx.DB) GetDB() *sqlx.DB // GetDBName reports the name of the currently connected db for // information_schema access. File-based databases like // sqlite report the name as the absolute path to the location // of their database file. GetDBName() string // GetDBQuote reports the quoting preference for db-query construction. // ' vs ` vs " for example GetDBQuote() string // Close the db-connection Close() error // set / get the max idle sqlx db-connections and max open sqlx db-connections SetMaxIdleConns(n int) SetMaxOpenConns(n int) GetRelations(tn string) []string // i=db/sqac tagged go struct-type CreateTables(i ...interface{}) error DropTables(i ...interface{}) error AlterTables(i ...interface{}) error DestructiveResetTables(i ...interface{}) error ExistsTable(tn string) bool // tn=tableName, cn=columnName ExistsColumn(tn string, cn string) bool // tn=tableName, in=indexName CreateIndex(in string, index IndexInfo) error DropIndex(tn string, in string) error ExistsIndex(tn string, in string) bool // sn=sequenceName, start=start-value, name is used to hold // the name of the sequence, autoincrement or identity // field name. the use of name depends on which db system // has been connected. CreateSequence(sn string, start int) AlterSequenceStart(name string, start int) error GetNextSequenceValue(name string) (int, error) // select pg_get_serial_sequence('public.some_table', 'some_column'); DropSequence(sn string) error ExistsSequence(sn string) bool // CreateForeignKey(Entity{}, foreignkeytable, reftable, fkfield, reffield) // &Entity{} (i) is only needed for SQLite - okay to pass nil in other cases. CreateForeignKey(i interface{}, ft, rt, ff, rf string) error DropForeignKey(i interface{}, ft, fkn string) error ExistsForeignKeyByName(i interface{}, fkn string) (bool, error) ExistsForeignKeyByFields(i interface{}, ft, rt, ff, rf string) (bool, error) // process DDL/DML commands ProcessSchema(schema string) ProcessSchemaList(sList []string) ProcessTransaction(tList []string) error // sql package access ExecuteQueryRow(queryString string, qParams ...interface{}) *sql.Row ExecuteQuery(queryString string, qParams ...interface{}) (*sql.Rows, error) Exec(queryString string, args ...interface{}) (sql.Result, error) // sqlx package access ExecuteQueryRowx(queryString string, qParams ...interface{}) *sqlx.Row ExecuteQueryx(queryString string, qParams ...interface{}) (*sqlx.Rows, error) Get(dst interface{}, queryString string, args ...interface{}) error Select(dst interface{}, queryString string, args ...interface{}) error // Boolean conversions BoolToDBBool(b bool) *int DBBoolToBool(interface{}) bool TimeToFormattedString(i interface{}) string // CRUD ops Create(ent interface{}) error Update(ent interface{}) error Delete(ent interface{}) error // (id uint) error GetEntity(ent interface{}) error // pass ptr to type containing key information GetEntities(ents interface{}) (interface{}, error) GetEntities2(ge GetEnt) error GetEntities4(ents interface{}) GetEntitiesCP(ents interface{}, pList []GetParam, cmdMap map[string]interface{}) (uint64, error) GetEntitiesWithCommands(ents interface{}, pList []GetParam, cmdMap map[string]interface{}) (interface{}, error) }
PublicDB exposes functions for db related operations.
type SQLiteFlavor ¶
type SQLiteFlavor struct {
BaseFlavor
}
SQLiteFlavor is a sqlite3-specific implementation. Methods defined in the PublicDB interface of struct-type BaseFlavor are called by default for SQLiteFlavor. If the method as it exists in the BaseFlavor implementation is not compatible with the schema-syntax required by SQLite, the method in question may be overridden. Overriding (redefining) a BaseFlavor method may be accomplished through the addition of a matching method signature and implementation on the SQLiteFlavor struct-type.
func (*SQLiteFlavor) AlterSequenceStart ¶
func (slf *SQLiteFlavor) AlterSequenceStart(name string, start int) error
AlterSequenceStart may be used to make changes to the start value of the auto-increment field on the currently connected SQLite database file. This method is intended to be called at the time of table-creation, as updating the current value of the SQLite auto-increment may cause unanticipated difficulties if the target table already contains records.
func (*SQLiteFlavor) AlterTables ¶
func (slf *SQLiteFlavor) AlterTables(i ...interface{}) error
AlterTables alters tables on the SQLite database referenced by slf.DB.
func (*SQLiteFlavor) Create ¶
func (slf *SQLiteFlavor) Create(ent interface{}) error
Create the entity (single-row) on the database
func (*SQLiteFlavor) CreateForeignKey ¶
func (slf *SQLiteFlavor) CreateForeignKey(i interface{}, ft, rt, ff, rf string) error
CreateForeignKey creates a foreign key on an existing column in the database table specified by the i / ft parameter. SQLite does not support the addition of a foreign-key via ALTER TABLE, so the existing table has to be copied to a backup, and a new table created (hence parameter i) with the foreign-key constraint in the CREATE TABLE ... command. Foreign-key constraints are temporarily disabled on the db for the duration of the transaction processing. THIS SHOULD NOT BE CALLED DIRECTLY. IT IS FAR SAFER IN THE SQLITE CASE TO UPDATE THE SQAC-TAGS ON THE TABLE'S MODEL.
func (*SQLiteFlavor) CreateTables ¶
func (slf *SQLiteFlavor) CreateTables(i ...interface{}) error
CreateTables creates tables on the sqlite3 database referenced by slf.DB.
func (*SQLiteFlavor) DestructiveResetTables ¶
func (slf *SQLiteFlavor) DestructiveResetTables(i ...interface{}) error
DestructiveResetTables drops tables on the SQLite db file if they exist, as well as any related objects such as sequences. this is useful if you wish to regenerated your table and the number-range used by an auto-incementing primary key.
func (*SQLiteFlavor) DropForeignKey ¶
func (slf *SQLiteFlavor) DropForeignKey(i interface{}, ft, fkn string) error
DropForeignKey drops a foreign-key on an existing column. Since SQLite does not support the addition or deletion of foreign-key relationships on existing tables, the existing table is copied to a backup table, dropped and then recreated using the sqac model information contained in (i). It follows that in order for a foreign-key to be dropped, it must be removed from the sqac tag in the model definition.
func (*SQLiteFlavor) DropIndex ¶
func (slf *SQLiteFlavor) DropIndex(tn string, in string) error
DropIndex drops the specfied index on the connected SQLite database. SQLite does not require the table name to drop an index, but it is provided in order to comply with the PublicDB interface definition.
func (*SQLiteFlavor) DropTables ¶
func (slf *SQLiteFlavor) DropTables(i ...interface{}) error
DropTables drops tables on the SQLite db if they exist, based on the provided list of go struct definitions.
func (*SQLiteFlavor) ExistsColumn ¶
func (slf *SQLiteFlavor) ExistsColumn(tn string, cn string) bool
ExistsColumn checks the current SQLite database file and returns true if the named table-column is found to exist. this checks the column name only, not the column data-type or properties.
func (*SQLiteFlavor) ExistsForeignKeyByFields ¶
func (slf *SQLiteFlavor) ExistsForeignKeyByFields(i interface{}, ft, rt, ff, rf string) (bool, error)
ExistsForeignKeyByFields checks to see if a foreign-key exists between the named tables and fields.
func (*SQLiteFlavor) ExistsForeignKeyByName ¶
func (slf *SQLiteFlavor) ExistsForeignKeyByName(i interface{}, fkn string) (bool, error)
ExistsForeignKeyByName checks to see if the named foreign-key exists on the table corresponding to provided sqac model (i).
func (*SQLiteFlavor) ExistsIndex ¶
func (slf *SQLiteFlavor) ExistsIndex(tn string, in string) bool
ExistsIndex checks the connected SQLite database for the presence of the specified index. This method is typically not required for SQLite, as the 'IF EXISTS' syntax is widely supported.
func (*SQLiteFlavor) ExistsTable ¶
func (slf *SQLiteFlavor) ExistsTable(tn string) bool
ExistsTable checks that the specified table exists in the SQLite database file.
func (*SQLiteFlavor) GetDBName ¶
func (slf *SQLiteFlavor) GetDBName() (dbName string)
GetDBName returns the name of the currently connected db
func (*SQLiteFlavor) GetNextSequenceValue ¶
func (slf *SQLiteFlavor) GetNextSequenceValue(name string) (int, error)
GetNextSequenceValue is used primarily for testing. It returns the current value of the SQLite auto-increment field for the named table.
func (*SQLiteFlavor) Update ¶
func (slf *SQLiteFlavor) Update(ent interface{}) error
Update an existing entity (single-row) on the database
type Sqac ¶
type Sqac struct {
Hndl PublicDB
}
Sqac is the main access structure for the sqac library.
type TblComponents ¶
type TblComponents struct {
// contains filtered or unexported fields
}
TblComponents is used as a collector structure for internal table create / alter processing.
func (*TblComponents) Log ¶
func (tc *TblComponents) Log()
Log dumps all of the raw table components to stdout is called for CreateTable and AlterTable operations if the main sqac logging has been activated via BaseFlavor.Log(true).