Documentation ¶
Index ¶
- type DBConn
- type DBOption
- type DBOptions
- type MongoDB
- func (m *MongoDB) Connect(ctx context.Context) (err error)
- func (m *MongoDB) Disconnect(ctx context.Context) error
- func (m *MongoDB) HasSchemas(ctx context.Context) (bool, error)
- func (m *MongoDB) LogChanges(ctx context.Context, query string, args ...any) (tag pgconn.CommandTag, err error)
- func (m *MongoDB) RunDDL(ctx context.Context, ddl string) error
- type PostgresDB
- func (p *PostgresDB) Connect(ctx context.Context) (err error)
- func (p *PostgresDB) Disconnect(ctx context.Context) error
- func (p *PostgresDB) GetInstalledSchemaVersion(ctx context.Context) (version string, err error)
- func (p *PostgresDB) HasMetadataSchema(ctx context.Context) (has bool, err error)
- func (p *PostgresDB) HasSchemas(ctx context.Context) (bool, error)
- func (p *PostgresDB) LogChanges(ctx context.Context, query string, args ...any) (tag pgconn.CommandTag, err error)
- func (p *PostgresDB) RunDDL(ctx context.Context, ddl string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBOptions ¶
type DBOptions struct { Name string // the name of the database used in a DSN ID string // the identifier used for logs, recording migration activity, etc. Port string // the port used to connect to User string // the user to authenticate as Password string // the password to authenticate with Host string // the database hostname/URL TLSConfig *tls.Config // the certificates used to authenticate with Schemas []string // a list of schema names }
DBOptions repesent a series of details about a given database instance
func (*DBOptions) GetMigrationKey ¶
GetMigrationKey returns a key name used for writing back successful migration state to some other database
type MongoDB ¶
func NewMongoDB ¶
func (*MongoDB) LogChanges ¶
func (m *MongoDB) LogChanges(ctx context.Context, query string, args ...any) (tag pgconn.CommandTag, err error)
LogChanges is a stub so that MongoDB can satisfy DBConn
type PostgresDB ¶
type PostgresDB struct { *DBOptions Conn *pgx.Conn }
func NewPostgresDB ¶
func NewPostgresDB(opts ...DBOption) (*PostgresDB, error)
func (*PostgresDB) Disconnect ¶
func (p *PostgresDB) Disconnect(ctx context.Context) error
func (*PostgresDB) GetInstalledSchemaVersion ¶
func (p *PostgresDB) GetInstalledSchemaVersion(ctx context.Context) (version string, err error)
func (*PostgresDB) HasMetadataSchema ¶
func (p *PostgresDB) HasMetadataSchema(ctx context.Context) (has bool, err error)
func (*PostgresDB) HasSchemas ¶
func (p *PostgresDB) HasSchemas(ctx context.Context) (bool, error)
func (*PostgresDB) LogChanges ¶
func (p *PostgresDB) LogChanges(ctx context.Context, query string, args ...any) (tag pgconn.CommandTag, err error)
LogChanges
Click to show internal directories.
Click to hide internal directories.