Documentation ¶
Index ¶
- Variables
- func Driver() data.Driver
- type PostgresBase
- func (base *PostgresBase) Batch(next data.BatchFunc) Res
- func (base *PostgresBase) Begin() (*sql.Tx, error)
- func (base *PostgresBase) Break(key string)
- func (base *PostgresBase) Cancel() error
- func (base *PostgresBase) Close() error
- func (base *PostgresBase) Erred() error
- func (base *PostgresBase) Model(name string) data.DataModel
- func (base *PostgresBase) Serial(key string, start, step int64) int64
- func (base *PostgresBase) Submit() error
- func (base *PostgresBase) Table(name string) data.DataTable
- func (base *PostgresBase) View(name string) data.DataView
- type PostgresConnect
- type PostgresDriver
- type PostgresExecutor
- type PostgresModel
- type PostgresTable
- type PostgresView
- func (view *PostgresView) Count(args ...Any) float64
- func (view *PostgresView) Entity(id Any) Map
- func (view *PostgresView) First(args ...Any) Map
- func (view *PostgresView) Group(field string, args ...Any) []Map
- func (view *PostgresView) Limit(offset, limit Any, args ...Any) (int64, []Map)
- func (view *PostgresView) Query(args ...Any) []Map
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DRIVERS = []string{
"postgresql", "postgres", "pgsql", "pgdb", "pg",
"cockroachdb", "cockroach", "crdb",
"timescaledb", "timescale", "tsdb",
}
)
View Source
var (
SCHEMAS = []string{
"postgresql://",
"postgres://",
"pgsql://",
"pgdb://",
"cockroachdb://",
"cockroach://",
"crdb://",
"timescale://",
"timescaledb://",
"tsdb://",
}
)
Functions ¶
Types ¶
type PostgresBase ¶
type PostgresBase struct {
// contains filtered or unexported fields
}
func (*PostgresBase) Erred ¶
func (base *PostgresBase) Erred() error
type PostgresConnect ¶
type PostgresConnect struct {
// contains filtered or unexported fields
}
数据库连接
func (*PostgresConnect) Base ¶
func (connect *PostgresConnect) Base() data.DataBase
type PostgresDriver ¶
type PostgresDriver struct{}
type PostgresExecutor ¶
type PostgresModel ¶
type PostgresModel struct {
// contains filtered or unexported fields
}
func (*PostgresModel) First ¶
func (model *PostgresModel) First(args ...Any) Map
查询单条 应该不需要用MAP,直接写SQL的
type PostgresTable ¶
type PostgresTable struct {
PostgresView
}
func (*PostgresTable) Remove ¶
func (table *PostgresTable) Remove(args ...Any) Map
逻辑删除和恢复已经抛弃 这两个功能应该是逻辑层干的事,不应和驱动混在一起 此为物理删除单条记录,并返回记录,所以要先查询单条
func (*PostgresTable) Update ¶
func (table *PostgresTable) Update(update Map, args ...Any) int64
批量更新,直接更了, 没有任何relate相关处理的
type PostgresView ¶
type PostgresView struct {
// contains filtered or unexported fields
}
func (*PostgresView) Count ¶
func (view *PostgresView) Count(args ...Any) float64
统计数量 添加函数支持 函数(字段)
func (*PostgresView) Limit ¶
func (view *PostgresView) Limit(offset, limit Any, args ...Any) (int64, []Map)
分页查询 171015更新为字段*版
Click to show internal directories.
Click to hide internal directories.