Documentation ¶
Index ¶
- type ManagedSql
- type PgConnector
- func (p *PgConnector) CreateSchemaIfNotExists(ctx context.Context, schema string) error
- func (p *PgConnector) GetConnection(ctx context.Context) (postgres.Connection, error)
- func (p *PgConnector) GetConnectionRaw(ctx context.Context) (*ManagedSql, error)
- func (p *PgConnector) Start(ctx context.Context) error
- func (p *PgConnector) Stop(_ context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManagedSql ¶
ManagedSql wrapper that prevents users from closing the connection
func (ManagedSql) Close ¶
func (m ManagedSql) Close() error
type PgConnector ¶
type PgConnector struct { ConnectionString string MaxOpenConnections int MaxIdleConnections int // contains filtered or unexported fields }
PgConnector the simplest PG connector implementation with sqlx Start doesn't need to be explicitly called, but it is preferred to check connections
func (*PgConnector) CreateSchemaIfNotExists ¶
func (p *PgConnector) CreateSchemaIfNotExists(ctx context.Context, schema string) error
CreateSchemaIfNotExists shorthand to create schema, if you don't want to do in manually
func (*PgConnector) GetConnection ¶
func (p *PgConnector) GetConnection(ctx context.Context) (postgres.Connection, error)
func (*PgConnector) GetConnectionRaw ¶
func (p *PgConnector) GetConnectionRaw(ctx context.Context) (*ManagedSql, error)
Click to show internal directories.
Click to hide internal directories.