Documentation ¶
Index ¶
- func DBDelete(db *sql.DB, table string, where string, args ...interface{}) (uint64, error)
- func DBInsert(db *sql.DB, table string, row map[string]interface{}) (uint64, error)
- func DBScalar(db *sql.DB, sql string, args ...interface{}) (uint64, error)
- func DBUpdate(db *sql.DB, table string, row map[string]interface{}, where string, ...) (uint64, error)
- func IsRecordNotFound(err error) bool
- type DB
- func (db *DB) Delete(table string, where string, args ...interface{}) (uint64, error)
- func (db *DB) GetPaging(pageSize uint, page uint, sql string, args ...interface{}) (*PagedRows, error)
- func (db *DB) GetRow(sql string, args ...interface{}) (Record, error)
- func (db *DB) GetRows(sqlStr string, args ...interface{}) ([]Record, error)
- func (db *DB) Insert(table string, row map[string]interface{}) (uint64, error)
- func (db *DB) ListColumns(dbname, tablename string) ([]*sql.ColumnType, error)
- func (db *DB) ListDatabases() ([]string, error)
- func (db *DB) ListTables(dbname string) ([]string, error)
- func (db *DB) Scalar(sql string, args ...interface{}) (uint64, error)
- func (db *DB) Update(table string, row map[string]interface{}, where string, args ...interface{}) (uint64, error)
- type Driver
- type DriverNotImplementedError
- type Field
- type Filter
- type ListInput
- type ListOutput
- type MysqlDriver
- func (m *MysqlDriver) ListColumns(db *sql.DB, dbname string, tablename string) ([]*sql.ColumnType, error)
- func (m *MysqlDriver) ListDatabases(db *sql.DB) ([]string, error)
- func (m *MysqlDriver) ListTables(db *sql.DB, dbname string) ([]string, error)
- func (m *MysqlDriver) Name() string
- func (m *MysqlDriver) QuoteIdentifier(v string) string
- type NoDriverError
- type PagedRows
- type Pagination
- type PostgresDriver
- func (m *PostgresDriver) ListColumns(db *sql.DB, dbname string, tablename string) ([]*sql.ColumnType, error)
- func (m *PostgresDriver) ListDatabases(db *sql.DB) ([]string, error)
- func (m *PostgresDriver) ListTables(db *sql.DB, dbname string) ([]string, error)
- func (m *PostgresDriver) Name() string
- func (m *PostgresDriver) QuoteIdentifier(v string) string
- type Record
- type RecordNotFoundError
- type Resource
- type SqlServerDriver
- func (m *SqlServerDriver) ListColumns(db *sql.DB, dbname string, tablename string) ([]*sql.ColumnType, error)
- func (m *SqlServerDriver) ListDatabases(db *sql.DB) ([]string, error)
- func (m *SqlServerDriver) ListTables(db *sql.DB, dbname string) ([]string, error)
- func (m *SqlServerDriver) Name() string
- func (m *SqlServerDriver) QuoteIdentifier(v string) string
- type Sqlite3Driver
- func (m *Sqlite3Driver) ListColumns(db *sql.DB, dbname string, tablename string) ([]*sql.ColumnType, error)
- func (m *Sqlite3Driver) ListDatabases(db *sql.DB) ([]string, error)
- func (m *Sqlite3Driver) ListTables(db *sql.DB, dbname string) ([]string, error)
- func (m *Sqlite3Driver) Name() string
- func (m *Sqlite3Driver) QuoteIdentifier(v string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRecordNotFound ¶
Types ¶
type DB ¶ added in v0.2.0
func (*DB) ListColumns ¶ added in v0.2.0
func (db *DB) ListColumns(dbname, tablename string) ([]*sql.ColumnType, error)
func (*DB) ListDatabases ¶ added in v0.2.0
type DriverNotImplementedError ¶ added in v0.2.0
type DriverNotImplementedError struct { }
func (DriverNotImplementedError) Error ¶ added in v0.2.0
func (e DriverNotImplementedError) Error() string
type ListInput ¶
type ListInput struct { Pagination Pagination `json: "pagination"` Filter Filter `json:"filter"` }
type ListOutput ¶
type ListOutput struct { Pagination List []Record `json:"list"` }
type MysqlDriver ¶ added in v0.2.0
type MysqlDriver struct{}
func (*MysqlDriver) ListColumns ¶ added in v0.2.0
func (m *MysqlDriver) ListColumns(db *sql.DB, dbname string, tablename string) ([]*sql.ColumnType, error)
func (*MysqlDriver) ListDatabases ¶ added in v0.2.0
func (m *MysqlDriver) ListDatabases(db *sql.DB) ([]string, error)
func (*MysqlDriver) ListTables ¶ added in v0.2.0
func (*MysqlDriver) Name ¶ added in v0.2.0
func (m *MysqlDriver) Name() string
func (*MysqlDriver) QuoteIdentifier ¶ added in v0.2.0
func (m *MysqlDriver) QuoteIdentifier(v string) string
type NoDriverError ¶ added in v0.2.0
type NoDriverError struct { }
func (NoDriverError) Error ¶ added in v0.2.0
func (e NoDriverError) Error() string
type PagedRows ¶
type PagedRows struct { Pagination List []Record `json:"list"` }
type Pagination ¶
type Pagination struct { PageSize uint `json:"page_size"` Page uint `json:"page"` PageTotal uint `json:"page_total"` Total uint `json:"total"` }
func NewPagination ¶
func NewPagination(pageSize, page uint) *Pagination
func (*Pagination) GetOffsetLimit ¶
func (p *Pagination) GetOffsetLimit() (uint, uint)
func (*Pagination) SetTotal ¶
func (p *Pagination) SetTotal(total uint)
func (*Pagination) Valid ¶
func (p *Pagination) Valid()
type PostgresDriver ¶ added in v0.2.0
type PostgresDriver struct { }
func (*PostgresDriver) ListColumns ¶ added in v0.2.0
func (m *PostgresDriver) ListColumns(db *sql.DB, dbname string, tablename string) ([]*sql.ColumnType, error)
func (*PostgresDriver) ListDatabases ¶ added in v0.2.0
func (m *PostgresDriver) ListDatabases(db *sql.DB) ([]string, error)
func (*PostgresDriver) ListTables ¶ added in v0.2.0
func (*PostgresDriver) Name ¶ added in v0.2.0
func (m *PostgresDriver) Name() string
func (*PostgresDriver) QuoteIdentifier ¶ added in v0.2.0
func (m *PostgresDriver) QuoteIdentifier(v string) string
type RecordNotFoundError ¶
type RecordNotFoundError struct { }
func (RecordNotFoundError) Error ¶
func (e RecordNotFoundError) Error() string
type Resource ¶
type SqlServerDriver ¶ added in v0.2.0
type SqlServerDriver struct { }
func (*SqlServerDriver) ListColumns ¶ added in v0.2.0
func (m *SqlServerDriver) ListColumns(db *sql.DB, dbname string, tablename string) ([]*sql.ColumnType, error)
func (*SqlServerDriver) ListDatabases ¶ added in v0.2.0
func (m *SqlServerDriver) ListDatabases(db *sql.DB) ([]string, error)
func (*SqlServerDriver) ListTables ¶ added in v0.2.0
func (*SqlServerDriver) Name ¶ added in v0.2.0
func (m *SqlServerDriver) Name() string
func (*SqlServerDriver) QuoteIdentifier ¶ added in v0.2.0
func (m *SqlServerDriver) QuoteIdentifier(v string) string
type Sqlite3Driver ¶ added in v0.2.0
type Sqlite3Driver struct { }
func (*Sqlite3Driver) ListColumns ¶ added in v0.2.0
func (m *Sqlite3Driver) ListColumns(db *sql.DB, dbname string, tablename string) ([]*sql.ColumnType, error)
func (*Sqlite3Driver) ListDatabases ¶ added in v0.2.0
func (m *Sqlite3Driver) ListDatabases(db *sql.DB) ([]string, error)
func (*Sqlite3Driver) ListTables ¶ added in v0.2.0
func (*Sqlite3Driver) Name ¶ added in v0.2.0
func (m *Sqlite3Driver) Name() string
func (*Sqlite3Driver) QuoteIdentifier ¶ added in v0.2.0
func (m *Sqlite3Driver) QuoteIdentifier(v string) string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.