Documentation ¶
Index ¶
- func NewPGDialect(ctx context.Context, dsn string) (dialect.Dialect, error)
- type PGDialect
- func (d *PGDialect) BulkInsert(ctx context.Context, table dialect.Table, data []map[string]interface{}) error
- func (d *PGDialect) Close(ctx context.Context) error
- func (d *PGDialect) Columns(ctx context.Context, tableName string) ([]dialect.Column, error)
- func (d *PGDialect) ForeignKeys(ctx context.Context, tableName string) (dialect.ForeignKeys, error)
- func (d *PGDialect) PrimaryKeyConstraint(ctx context.Context, tableName string) (string, error)
- func (d *PGDialect) PrimaryKeys(ctx context.Context, tableName string) ([]dialect.PrimaryKey, error)
- func (d *PGDialect) ReferenceKeys(ctx context.Context, tableName string) (dialect.ReferenceKeys, error)
- func (d *PGDialect) ResultSet(ctx context.Context, query string, args ...interface{}) ([]map[string]interface{}, error)
- func (d *PGDialect) Table(ctx context.Context, tableName string) (dialect.Table, error)
- func (d *PGDialect) Tables(ctx context.Context) (dialect.Tables, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PGDialect ¶
type PGDialect struct {
// contains filtered or unexported fields
}
PGDialect manages a connection with PostgreSQL.
func (*PGDialect) BulkInsert ¶
func (d *PGDialect) BulkInsert(ctx context.Context, table dialect.Table, data []map[string]interface{}) error
BulkInsert inserts multiple data a single database transaction. It disables triggers to avoid conflicts on foreign constraints.
func (*PGDialect) ForeignKeys ¶
ForeignKeys returns the foreign keys of a table.
func (*PGDialect) PrimaryKeyConstraint ¶
PrimaryKeyConstraint returns the primary key constraint of a table.
func (*PGDialect) PrimaryKeys ¶
func (d *PGDialect) PrimaryKeys(ctx context.Context, tableName string) ([]dialect.PrimaryKey, error)
PrimaryKeys returns primary keys of a table.
func (*PGDialect) ReferenceKeys ¶
func (d *PGDialect) ReferenceKeys(ctx context.Context, tableName string) (dialect.ReferenceKeys, error)
ReferenceKeys returns the "Referenced by" constraints of a table.
func (*PGDialect) ResultSet ¶
func (d *PGDialect) ResultSet(ctx context.Context, query string, args ...interface{}) ([]map[string]interface{}, error)
ResultSet executes a query and converts Rows in map[string]interface{}.
Click to show internal directories.
Click to hide internal directories.