Documentation ¶
Index ¶
- Constants
- type EntRevisions
- func (r *EntRevisions) Ident() *migrate.TableIdent
- func (r *EntRevisions) Migrate(ctx context.Context) error
- func (r *EntRevisions) ReadRevision(ctx context.Context, v string) (*migrate.Revision, error)
- func (r *EntRevisions) ReadRevisions(ctx context.Context) ([]*migrate.Revision, error)
- func (r *EntRevisions) WriteRevision(ctx context.Context, rev *migrate.Revision) error
- type Option
Constants ¶
const DefaultRevisionSchema = "atlas_schema_revisions"
DefaultRevisionSchema is the default schema for storing revisions table.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntRevisions ¶
type EntRevisions struct {
// contains filtered or unexported fields
}
EntRevisions provides implementation for the migrate.RevisionReadWriter interface.
func NewEntRevisions ¶
func NewEntRevisions(ctx context.Context, ac *sqlclient.Client, opts ...Option) (*EntRevisions, error)
NewEntRevisions creates a new EntRevisions with the given sqlclient.Client.
func (*EntRevisions) Ident ¶ added in v0.6.0
func (r *EntRevisions) Ident() *migrate.TableIdent
Ident returns the table identifier.
func (*EntRevisions) Migrate ¶ added in v0.6.4
func (r *EntRevisions) Migrate(ctx context.Context) error
Migrate attempts to create / update the revisions table. This is separated since Ent attempts to wrap the migration execution in a transaction and assumes the underlying connection is of type *sql.DB, which is not true for actually reading and writing revisions.
func (*EntRevisions) ReadRevision ¶ added in v0.6.0
ReadRevision reads a revision from the revisions table.
ReadRevision will not return results only saved in cache.
func (*EntRevisions) ReadRevisions ¶
ReadRevisions reads the revisions from the revisions table.
ReadRevisions will not return results only saved to cache.
func (*EntRevisions) WriteRevision ¶
WriteRevision writes a revision to the revisions table.
type Option ¶
type Option func(*EntRevisions) error
Option allows to configure EntRevisions by using functional arguments.
func WithSchema ¶
WithSchema configures the schema to use for the revision table.