Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package
v4.7.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFactory

func RegisterFactory()

Types

type Factory

type Factory struct{}

Factory represents a PostgreSQL query builder

func (*Factory) BuildBatchInsert

func (f *Factory) BuildBatchInsert(table string, batchFields []map[string]interface{}) *define.SqlProto

BuildBatchInsert builds a batch INSERT query for PostgreSQL

func (*Factory) BuildCreateTable

func (f *Factory) BuildCreateTable(table string, modelType reflect.Type) *define.SqlProto

BuildCreateTable builds a CREATE TABLE query for PostgreSQL

func (*Factory) BuildDelete

func (f *Factory) BuildDelete(table string, conditions []*define.Condition) *define.SqlProto

BuildDelete builds a DELETE query for PostgreSQL

func (*Factory) BuildInsert

func (f *Factory) BuildInsert(table string, fields map[string]interface{}, fieldOrder []string) *define.SqlProto

BuildInsert builds an INSERT query for PostgreSQL

func (*Factory) BuildOrderBy added in v4.1.3

func (f *Factory) BuildOrderBy(orders []define.OrderBy) string

BuildOrderBy 构建排序语句

func (*Factory) BuildSelect

func (f *Factory) BuildSelect(table string, fields []string, conditions []*define.Condition, orderBy string, limit, offset int) *define.SqlProto

BuildSelect builds a SELECT query for PostgreSQL

func (*Factory) BuildUpdate

func (f *Factory) BuildUpdate(table string, fields map[string]interface{}, fieldOrder []string, conditions []*define.Condition) *define.SqlProto

BuildUpdate builds an UPDATE query for PostgreSQL

func (*Factory) Connect

func (f *Factory) Connect(dsn string) (*sql.DB, error)

func (*Factory) GetTableInfo

func (f *Factory) GetTableInfo(db *sql.DB, tableName string) (*define.TableInfo, error)

GetTableInfo 获取表信息

func (*Factory) GetTables

func (f *Factory) GetTables(db *sql.DB, pattern string) ([]string, error)

GetTables 获取符合模式的所有表

func (*Factory) GetType added in v4.1.5

func (f *Factory) GetType() string

GetType returns the database type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL