Versions in this module Expand all Collapse all v1 v1.2.1 Nov 19, 2013 Changes in this version + func SelectFloat(e SqlExecutor, query string, args ...interface{}) (float64, error) + func SelectInt(e SqlExecutor, query string, args ...interface{}) (int64, error) + func SelectNullFloat(e SqlExecutor, query string, args ...interface{}) (sql.NullFloat64, error) + func SelectNullInt(e SqlExecutor, query string, args ...interface{}) (sql.NullInt64, error) + func SelectNullStr(e SqlExecutor, query string, args ...interface{}) (sql.NullString, error) + func SelectOne(m *DbMap, e SqlExecutor, holder interface{}, query string, args ...interface{}) error + func SelectStr(e SqlExecutor, query string, args ...interface{}) (string, error) + type ColumnMap struct + ColumnName string + MaxSize int + Transient bool + Unique bool + func (c *ColumnMap) Rename(colname string) *ColumnMap + func (c *ColumnMap) SetMaxSize(size int) *ColumnMap + func (c *ColumnMap) SetNotNull(nn bool) *ColumnMap + func (c *ColumnMap) SetTransient(b bool) *ColumnMap + func (c *ColumnMap) SetUnique(b bool) *ColumnMap + type CustomScanner struct + Binder func(holder interface{}, target interface{}) error + Holder interface{} + Target interface{} + func (me CustomScanner) Bind() error + type DbMap struct + Db *sql.DB + Dialect Dialect + TypeConverter TypeConverter + func (m *DbMap) AddTable(i interface{}) *TableMap + func (m *DbMap) AddTableWithName(i interface{}, name string) *TableMap + func (m *DbMap) Begin() (*Transaction, error) + func (m *DbMap) CreateTables() error + func (m *DbMap) CreateTablesIfNotExists() error + func (m *DbMap) Delete(list ...interface{}) (int64, error) + func (m *DbMap) DropTables() error + func (m *DbMap) DropTablesIfExists() error + func (m *DbMap) Exec(query string, args ...interface{}) (sql.Result, error) + func (m *DbMap) Get(i interface{}, keys ...interface{}) (interface{}, error) + func (m *DbMap) Insert(list ...interface{}) error + func (m *DbMap) Select(i interface{}, query string, args ...interface{}) ([]interface{}, error) + func (m *DbMap) SelectFloat(query string, args ...interface{}) (float64, error) + func (m *DbMap) SelectInt(query string, args ...interface{}) (int64, error) + func (m *DbMap) SelectNullFloat(query string, args ...interface{}) (sql.NullFloat64, error) + func (m *DbMap) SelectNullInt(query string, args ...interface{}) (sql.NullInt64, error) + func (m *DbMap) SelectNullStr(query string, args ...interface{}) (sql.NullString, error) + func (m *DbMap) SelectOne(holder interface{}, query string, args ...interface{}) error + func (m *DbMap) SelectStr(query string, args ...interface{}) (string, error) + func (m *DbMap) TraceOff() + func (m *DbMap) TraceOn(prefix string, logger *log.Logger) + func (m *DbMap) TruncateTables() error + func (m *DbMap) Update(list ...interface{}) (int64, error) + type Dialect interface + AutoIncrBindValue func() string + AutoIncrInsertSuffix func(col *ColumnMap) string + AutoIncrStr func() string + BindVar func(i int) string + CreateTableSuffix func() string + InsertAutoIncr func(exec SqlExecutor, insertSql string, params ...interface{}) (int64, error) + QuoteField func(field string) string + ToSqlType func(val reflect.Type, maxsize int, isAutoIncr bool) string + TruncateClause func() string + type MySQLDialect struct + Encoding string + Engine string + func (d MySQLDialect) QuoteField(f string) string + func (m MySQLDialect) AutoIncrBindValue() string + func (m MySQLDialect) AutoIncrInsertSuffix(col *ColumnMap) string + func (m MySQLDialect) AutoIncrStr() string + func (m MySQLDialect) BindVar(i int) string + func (m MySQLDialect) CreateTableSuffix() string + func (m MySQLDialect) InsertAutoIncr(exec SqlExecutor, insertSql string, params ...interface{}) (int64, error) + func (m MySQLDialect) ToSqlType(val reflect.Type, maxsize int, isAutoIncr bool) string + func (m MySQLDialect) TruncateClause() string + type OptimisticLockError struct + Keys []interface{} + LocalVersion int64 + RowExists bool + TableName string + func (e OptimisticLockError) Error() string + type PostgresDialect struct + func (d PostgresDialect) AutoIncrBindValue() string + func (d PostgresDialect) AutoIncrInsertSuffix(col *ColumnMap) string + func (d PostgresDialect) AutoIncrStr() string + func (d PostgresDialect) BindVar(i int) string + func (d PostgresDialect) CreateTableSuffix() string + func (d PostgresDialect) InsertAutoIncr(exec SqlExecutor, insertSql string, params ...interface{}) (int64, error) + func (d PostgresDialect) QuoteField(f string) string + func (d PostgresDialect) ToSqlType(val reflect.Type, maxsize int, isAutoIncr bool) string + func (d PostgresDialect) TruncateClause() string + type SqlExecutor interface + Delete func(list ...interface{}) (int64, error) + Exec func(query string, args ...interface{}) (sql.Result, error) + Get func(i interface{}, keys ...interface{}) (interface{}, error) + Insert func(list ...interface{}) error + Select func(i interface{}, query string, args ...interface{}) ([]interface{}, error) + SelectFloat func(query string, args ...interface{}) (float64, error) + SelectInt func(query string, args ...interface{}) (int64, error) + SelectNullFloat func(query string, args ...interface{}) (sql.NullFloat64, error) + SelectNullInt func(query string, args ...interface{}) (sql.NullInt64, error) + SelectNullStr func(query string, args ...interface{}) (sql.NullString, error) + SelectOne func(holder interface{}, query string, args ...interface{}) error + SelectStr func(query string, args ...interface{}) (string, error) + Update func(list ...interface{}) (int64, error) + type SqliteDialect struct + func (d SqliteDialect) AutoIncrBindValue() string + func (d SqliteDialect) AutoIncrInsertSuffix(col *ColumnMap) string + func (d SqliteDialect) AutoIncrStr() string + func (d SqliteDialect) BindVar(i int) string + func (d SqliteDialect) CreateTableSuffix() string + func (d SqliteDialect) InsertAutoIncr(exec SqlExecutor, insertSql string, params ...interface{}) (int64, error) + func (d SqliteDialect) QuoteField(f string) string + func (d SqliteDialect) ToSqlType(val reflect.Type, maxsize int, isAutoIncr bool) string + func (d SqliteDialect) TruncateClause() string + type TableMap struct + TableName string + func (t *TableMap) ColMap(field string) *ColumnMap + func (t *TableMap) ResetSql() + func (t *TableMap) SetKeys(isAutoIncr bool, fieldNames ...string) *TableMap + func (t *TableMap) SetVersionCol(field string) *ColumnMap + type Transaction struct + func (t *Transaction) Commit() error + func (t *Transaction) Delete(list ...interface{}) (int64, error) + func (t *Transaction) Exec(query string, args ...interface{}) (sql.Result, error) + func (t *Transaction) Get(i interface{}, keys ...interface{}) (interface{}, error) + func (t *Transaction) Insert(list ...interface{}) error + func (t *Transaction) ReleaseSavepoint(savepoint string) error + func (t *Transaction) Rollback() error + func (t *Transaction) RollbackToSavepoint(savepoint string) error + func (t *Transaction) Savepoint(name string) error + func (t *Transaction) Select(i interface{}, query string, args ...interface{}) ([]interface{}, error) + func (t *Transaction) SelectFloat(query string, args ...interface{}) (float64, error) + func (t *Transaction) SelectInt(query string, args ...interface{}) (int64, error) + func (t *Transaction) SelectNullFloat(query string, args ...interface{}) (sql.NullFloat64, error) + func (t *Transaction) SelectNullInt(query string, args ...interface{}) (sql.NullInt64, error) + func (t *Transaction) SelectNullStr(query string, args ...interface{}) (sql.NullString, error) + func (t *Transaction) SelectOne(holder interface{}, query string, args ...interface{}) error + func (t *Transaction) SelectStr(query string, args ...interface{}) (string, error) + func (t *Transaction) Update(list ...interface{}) (int64, error) + type TypeConverter interface + FromDb func(target interface{}) (CustomScanner, bool) + ToDb func(val interface{}) (interface{}, error)