Documentation ¶
Overview ¶
Package db implements a Postgres client for applying, querying, and recording migrations.
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) Exec(ctx context.Context, sql string) error
- func (c *Client) GetMigrations(ctx context.Context) ([]Migration, error)
- func (c *Client) LogCompletedMigration(ctx context.Context, name string) error
- func (c *Client) TryLock(ctx context.Context) (bool, error)
- func (c *Client) Unlock(ctx context.Context) (bool, error)
- type Migration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a migration database connection.
func (*Client) Exec ¶
Exec executes the given statements against the database, and then records that the migration has been applied.
func (*Client) GetMigrations ¶
GetMigrations returns all migrations that have been applied to the database.
func (*Client) LogCompletedMigration ¶
LogCompletedMigration saves migration into the migration table.
Click to show internal directories.
Click to hide internal directories.