Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntRevisions ¶
type EntRevisions struct {
// contains filtered or unexported fields
}
A EntRevisions provides implementation for the migrate.RevisionReadWriter interface.
func NewEntRevisions ¶
func NewEntRevisions(ac *sqlclient.Client, opts ...Option) (*EntRevisions, error)
NewEntRevisions creates a new EntRevisions with the given sqlclient.Client. It is important to call EntRevisions.Init to initialize the underlying Ent client.
func (*EntRevisions) Flush ¶ added in v0.4.2
func (r *EntRevisions) Flush(ctx context.Context) error
Flush writes the changes saved in memory to the database.
This method exists to support both execution of migration in a transaction and saving revision for SQLite flavors, since attempting to write to the database while in a transaction will fail there.
func (*EntRevisions) Init ¶
func (r *EntRevisions) Init(ctx context.Context) error
Init makes sure the revision table does exist in the connected database.
func (*EntRevisions) ReadRevisions ¶
ReadRevisions reads the revisions from the revisions table.
ReadRevisions will not return results only saved to cache.
func (*EntRevisions) WriteRevision ¶ added in v0.4.2
WriteRevision writes a revision to the revisions table.
type Option ¶ added in v0.4.2
type Option func(*EntRevisions) error
Option allows to configure EntRevisions by using functional arguments.
func WithSchema ¶ added in v0.4.2
WithSchema configures the schema to use for the revision table.