Documentation
¶
Index ¶
- Variables
- type Adapter
- type Ext
- type PostgresAdapter
- func (adapter *PostgresAdapter) Close() error
- func (adapter *PostgresAdapter) Create() error
- func (adapter *PostgresAdapter) DBX() Ext
- func (adapter *PostgresAdapter) Find(ctx context.Context, dest interface{}) error
- func (adapter *PostgresAdapter) Get(ctx context.Context, dest interface{}, qstr string, args ...interface{}) error
- func (adapter *PostgresAdapter) Insert(ctx context.Context, ent interface{}) (int, error)
- func (adapter *PostgresAdapter) MultiInsert(ctx context.Context, ents []interface{}) ([]int, error)
- func (adapter *PostgresAdapter) Open() error
- func (adapter *PostgresAdapter) OpenDB() (*sqlx.DB, error)
- func (adapter *PostgresAdapter) Select(ctx context.Context, dest interface{}, qstr string, args ...interface{}) error
- func (adapter *PostgresAdapter) Sqrl() sq.StatementBuilderType
- func (adapter *PostgresAdapter) TableExists(t string) (bool, error)
- func (adapter *PostgresAdapter) Tx(cb func(Adapter) error) error
- func (adapter *PostgresAdapter) Update(ctx context.Context, ent interface{}, columns ...string) error
- type QueryLogger
Constants ¶
This section is empty.
Variables ¶
View Source
var MapperCache = tldb.MapperCache
Functions ¶
This section is empty.
Types ¶
type PostgresAdapter ¶
type PostgresAdapter struct {
DBURL string
// contains filtered or unexported fields
}
PostgresAdapter connects to a Postgres/PostGIS database.
func NewPostgresAdapterFromDBX ¶
func NewPostgresAdapterFromDBX(db Ext) *PostgresAdapter
func (*PostgresAdapter) Create ¶
func (adapter *PostgresAdapter) Create() error
Create an initial database schema.
func (*PostgresAdapter) Find ¶
func (adapter *PostgresAdapter) Find(ctx context.Context, dest interface{}) error
Find finds a single entity based on the EntityID()
func (*PostgresAdapter) Get ¶
func (adapter *PostgresAdapter) Get(ctx context.Context, dest interface{}, qstr string, args ...interface{}) error
Get wraps sqlx.Get
func (*PostgresAdapter) Insert ¶
func (adapter *PostgresAdapter) Insert(ctx context.Context, ent interface{}) (int, error)
Insert builds and executes an insert statement for the given entity.
func (*PostgresAdapter) MultiInsert ¶
func (adapter *PostgresAdapter) MultiInsert(ctx context.Context, ents []interface{}) ([]int, error)
MultiInsert builds and executes a multi-insert statement for the given entities.
func (*PostgresAdapter) OpenDB ¶ added in v1.2.0
func (adapter *PostgresAdapter) OpenDB() (*sqlx.DB, error)
func (*PostgresAdapter) Select ¶
func (adapter *PostgresAdapter) Select(ctx context.Context, dest interface{}, qstr string, args ...interface{}) error
Select wraps sqlx.Select
func (*PostgresAdapter) Sqrl ¶
func (adapter *PostgresAdapter) Sqrl() sq.StatementBuilderType
Sqrl returns a properly configured Squirrel StatementBuilder.
func (*PostgresAdapter) TableExists ¶
func (adapter *PostgresAdapter) TableExists(t string) (bool, error)
TableExists returns true if the requested table exists
type QueryLogger ¶
type QueryLogger = querylogger.QueryLogger
Click to show internal directories.
Click to hide internal directories.