Documentation ¶
Overview ¶
Package pgsql implements gdb.Driver, which supports operations for PostgreSql.
Index ¶
- func New() gdb.Driver
- type DriverPgsql
- func (d *DriverPgsql) ConvertDataForRecord(ctx context.Context, value interface{}) map[string]interface{}
- func (d *DriverPgsql) DoFilter(ctx context.Context, link gdb.Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error)
- func (d *DriverPgsql) DoInsert(ctx context.Context, link gdb.Link, table string, list gdb.List, ...) (result sql.Result, err error)
- func (d *DriverPgsql) FilteredLink() string
- func (d *DriverPgsql) GetChars() (charLeft string, charRight string)
- func (d *DriverPgsql) New(core *gdb.Core, node *gdb.ConfigNode) (gdb.DB, error)
- func (d *DriverPgsql) Open(config *gdb.ConfigNode) (db *sql.DB, err error)
- func (d *DriverPgsql) TableFields(ctx context.Context, table string, schema ...string) (fields map[string]*gdb.TableField, err error)
- func (d *DriverPgsql) Tables(ctx context.Context, schema ...string) (tables []string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DriverPgsql ¶
DriverPgsql is the driver for postgresql database.
func (*DriverPgsql) ConvertDataForRecord ¶
func (d *DriverPgsql) ConvertDataForRecord(ctx context.Context, value interface{}) map[string]interface{}
ConvertDataForRecord converting for any data that will be inserted into table/collection as a record.
func (*DriverPgsql) DoFilter ¶
func (d *DriverPgsql) DoFilter(ctx context.Context, link gdb.Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error)
DoFilter deals with the sql string before commits it to underlying sql driver.
func (*DriverPgsql) DoInsert ¶
func (d *DriverPgsql) DoInsert(ctx context.Context, link gdb.Link, table string, list gdb.List, option gdb.DoInsertOption) (result sql.Result, err error)
DoInsert is not supported in pgsql.
func (*DriverPgsql) FilteredLink ¶
func (d *DriverPgsql) FilteredLink() string
FilteredLink retrieves and returns filtered `linkInfo` that can be using for logging or tracing purpose.
func (*DriverPgsql) GetChars ¶
func (d *DriverPgsql) GetChars() (charLeft string, charRight string)
GetChars returns the security char for this type of database.
func (*DriverPgsql) New ¶
func (d *DriverPgsql) New(core *gdb.Core, node *gdb.ConfigNode) (gdb.DB, error)
New creates and returns a database object for postgresql. It implements the interface of gdb.Driver for extra database driver installation.
func (*DriverPgsql) Open ¶
func (d *DriverPgsql) Open(config *gdb.ConfigNode) (db *sql.DB, err error)
Open creates and returns an underlying sql.DB object for pgsql.
func (*DriverPgsql) TableFields ¶
func (d *DriverPgsql) TableFields(ctx context.Context, table string, schema ...string) (fields map[string]*gdb.TableField, err error)
TableFields retrieves and returns the fields' information of specified table of current schema.
Also see DriverMysql.TableFields.