Documentation
¶
Overview ¶
Package postgres wraps postgres (pq) driver as an adapter for REL.
Usage:
// open postgres connection. adapter, err := postgres.Open("postgres://postgres@localhost/rel_test?sslmode=disable") if err != nil { panic(err) } defer adapter.Close() // initialize REL's repo. repo := rel.New(adapter)
Index ¶
- Variables
- type Adapter
- func (adapter *Adapter) Begin(ctx context.Context) (rel.Adapter, error)
- func (adapter *Adapter) Insert(ctx context.Context, query rel.Query, primaryField string, ...) (interface{}, error)
- func (adapter *Adapter) InsertAll(ctx context.Context, query rel.Query, primaryField string, fields []string, ...) ([]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Config for postgres adapter. Config = sql.Config{ Placeholder: "$", EscapeChar: "\"", Ordinal: true, InsertDefaultValues: true, ErrorFunc: errorFunc, MapColumnFunc: mapColumnFunc, } )
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
Adapter definition for postgres database.
Click to show internal directories.
Click to hide internal directories.