Documentation
¶
Overview ¶
Package ent provides an extension to the ent package for database operations.
Index ¶
- Variables
- func IsErrorCode(err error, code string) bool
- func IsErrorNotFound(err error) bool
- func WithURL() string
- type ApplyMigrationParams
- type Batch
- type DBTX
- type DeleteJobParams
- type DeleteJobParamsConverter
- type DeleteJobParamsConverterImpl
- type DeleteLockParams
- type DeleteLockParamsConverter
- type DeleteLockParamsConverterImpl
- type DeleteRevisionParams
- type DeleteRevisionParamsConverter
- type DeleteRevisionParamsConverterImpl
- type Error
- type ExecDeleteJobParams
- type ExecDeleteJobParamsConverter
- type ExecDeleteJobParamsConverterImpl
- type ExecDeleteLockParams
- type ExecDeleteLockParamsConverter
- type ExecDeleteLockParamsConverterImpl
- type ExecDeleteRevisionParams
- type ExecDeleteRevisionParamsConverter
- type ExecDeleteRevisionParamsConverterImpl
- type ExecInsertJobParams
- type ExecInsertJobParamsConverter
- type ExecInsertJobParamsConverterImpl
- type ExecInsertLockParams
- type ExecInsertLockParamsConverter
- type ExecInsertLockParamsConverterImpl
- type ExecInsertRevisionParams
- type ExecInsertRevisionParamsConverter
- type ExecInsertRevisionParamsConverterImpl
- type ExecUpdateRevisionParams
- type ExecUpdateRevisionParamsConverter
- type ExecUpdateRevisionParamsConverterImpl
- type ExecUpsertRevisionParams
- type ExecUpsertRevisionParamsConverter
- type ExecUpsertRevisionParamsConverterImpl
- type FileSystem
- type Gateway
- type GatewayOption
- type GatewayOptionFunc
- type GetJobParams
- type GetJobParamsConverter
- type GetJobParamsConverterImpl
- type GetLockParams
- type GetLockParamsConverter
- type GetLockParamsConverterImpl
- type GetRevisionParams
- type GetRevisionParamsConverter
- type GetRevisionParamsConverterImpl
- type InsertJobParams
- type InsertJobParamsConverter
- type InsertJobParamsConverterImpl
- type InsertLockParams
- type InsertLockParamsConverter
- type InsertLockParamsConverterImpl
- type InsertRevisionParams
- type InsertRevisionParamsConverter
- type InsertRevisionParamsConverterImpl
- type Job
- type JobRepository
- type ListMigrationsParams
- type ListRevisionsParams
- type Lock
- type LockMigrationParams
- type Migration
- type MigrationRepository
- func (x *MigrationRepository) ApplyMigration(ctx context.Context, params *ApplyMigrationParams) error
- func (x *MigrationRepository) ListMigrations(ctx context.Context, _ *ListMigrationsParams) (collection []*Migration, _ error)
- func (x *MigrationRepository) LockMigration(ctx context.Context, params *LockMigrationParams) error
- func (x *MigrationRepository) UnlockMigration(ctx context.Context) error
- type MigrationState
- type Querier
- type QuerierAction
- type QuerierFunc
- type Queries
- func (x *Queries) Close()
- func (q *Queries) CreateSchemaSys(ctx context.Context) error
- func (q *Queries) CreateTableJobs(ctx context.Context) error
- func (q *Queries) CreateTableLocks(ctx context.Context) error
- func (q *Queries) CreateTableRevisions(ctx context.Context) error
- func (x *Queries) Database() DBTX
- func (q *Queries) DeleteJob(ctx context.Context, arg *DeleteJobParams) (*Job, error)
- func (q *Queries) DeleteLock(ctx context.Context, arg *DeleteLockParams) (*Lock, error)
- func (q *Queries) DeleteRevision(ctx context.Context, arg *DeleteRevisionParams) (*Revision, error)
- func (q *Queries) ExecDeleteJob(ctx context.Context, arg *ExecDeleteJobParams) error
- func (q *Queries) ExecDeleteLock(ctx context.Context, arg *ExecDeleteLockParams) error
- func (q *Queries) ExecDeleteRevision(ctx context.Context, arg *ExecDeleteRevisionParams) error
- func (q *Queries) ExecInsertJob(ctx context.Context, arg *ExecInsertJobParams) error
- func (q *Queries) ExecInsertLock(ctx context.Context, arg *ExecInsertLockParams) error
- func (q *Queries) ExecInsertRevision(ctx context.Context, arg *ExecInsertRevisionParams) error
- func (q *Queries) ExecUpdateRevision(ctx context.Context, arg *ExecUpdateRevisionParams) error
- func (q *Queries) ExecUpsertRevision(ctx context.Context, arg *ExecUpsertRevisionParams) error
- func (q *Queries) GetJob(ctx context.Context, arg *GetJobParams) (*Job, error)
- func (q *Queries) GetLock(ctx context.Context, arg *GetLockParams) (*Lock, error)
- func (q *Queries) GetRevision(ctx context.Context, arg *GetRevisionParams) (*Revision, error)
- func (q *Queries) InsertJob(ctx context.Context, arg *InsertJobParams) (*Job, error)
- func (q *Queries) InsertLock(ctx context.Context, arg *InsertLockParams) (*Lock, error)
- func (q *Queries) InsertRevision(ctx context.Context, arg *InsertRevisionParams) (*Revision, error)
- func (q *Queries) ListRevisions(ctx context.Context, arg *ListRevisionsParams) ([]*Revision, error)
- func (x *Queries) Ping(ctx context.Context) error
- func (x *Queries) RunInTx(ctx context.Context, action QuerierAction) (err error)
- func (q *Queries) UpdateRevision(ctx context.Context, arg *UpdateRevisionParams) (*Revision, error)
- func (q *Queries) UpsertRevision(ctx context.Context, arg *UpsertRevisionParams) (*Revision, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Revision
- type UpdateRevisionParams
- type UpdateRevisionParamsConverter
- type UpdateRevisionParamsConverterImpl
- type UpsertRevisionParams
- type UpsertRevisionParamsConverter
- type UpsertRevisionParamsConverterImpl
- type WaitJobParams
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTooManyRows occurs when more rows than expected are returned. ErrTooManyRows = pgx.ErrTooManyRows // ErrNoRows occurs when rows are expected but none are returned. ErrNoRows = pgx.ErrNoRows )
var ErrCodeUniqueViolation = pgerrcode.UniqueViolation
var MigrationLock = uuid.NewMD5(uuid.NameSpaceOID, []byte("aurora_schema_migrations"))
MigrationLock is a UUID used to identify the migration lock in the database.
Functions ¶
func IsErrorCode ¶
IsErrorCode reports whether the error is a PostgreSQL error with the given code.
func IsErrorNotFound ¶
IsErrorNotFound reports whether the error is a "not found" error.
Types ¶
type ApplyMigrationParams ¶
type ApplyMigrationParams struct {
// Migration contains the parameters for executing a migration.
Migration *Migration
}
ApplyMigrationParams represents the parameters for executing a revision.
type Batch ¶
type Batch struct {
Results pgx.BatchResults
Total int
}
Batch represents a batch of results.
type DeleteJobParams ¶
type DeleteJobParams struct {
JobID string `db:"job_id" json:"job_id"`
}
func (*DeleteJobParams) SetJob ¶
func (x *DeleteJobParams) SetJob(entity *Job)
SetJob sets the params from the entity.
type DeleteJobParamsConverter ¶
type DeleteJobParamsConverter interface {
// goverter:update target
SetFromJob(target *DeleteJobParams, source *Job)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type DeleteJobParamsConverterImpl ¶
type DeleteJobParamsConverterImpl struct{}
func (*DeleteJobParamsConverterImpl) SetFromJob ¶
func (c *DeleteJobParamsConverterImpl) SetFromJob(target *DeleteJobParams, source *Job)
type DeleteLockParams ¶
type DeleteLockParams struct {
ID string `db:"id" json:"id"`
}
func (*DeleteLockParams) SetLock ¶
func (x *DeleteLockParams) SetLock(entity *Lock)
SetLock sets the params from the entity.
type DeleteLockParamsConverter ¶
type DeleteLockParamsConverter interface {
// goverter:update target
SetFromLock(target *DeleteLockParams, source *Lock)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type DeleteLockParamsConverterImpl ¶
type DeleteLockParamsConverterImpl struct{}
func (*DeleteLockParamsConverterImpl) SetFromLock ¶
func (c *DeleteLockParamsConverterImpl) SetFromLock(target *DeleteLockParams, source *Lock)
type DeleteRevisionParams ¶
type DeleteRevisionParams struct {
ID string `db:"id" json:"id"`
}
func (*DeleteRevisionParams) SetRevision ¶
func (x *DeleteRevisionParams) SetRevision(entity *Revision)
SetRevision sets the params from the entity.
type DeleteRevisionParamsConverter ¶
type DeleteRevisionParamsConverter interface {
// goverter:update target
SetFromRevision(target *DeleteRevisionParams, source *Revision)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type DeleteRevisionParamsConverterImpl ¶
type DeleteRevisionParamsConverterImpl struct{}
func (*DeleteRevisionParamsConverterImpl) SetFromRevision ¶
func (c *DeleteRevisionParamsConverterImpl) SetFromRevision(target *DeleteRevisionParams, source *Revision)
type ExecDeleteJobParams ¶
type ExecDeleteJobParams struct {
JobID string `db:"job_id" json:"job_id"`
}
func (*ExecDeleteJobParams) SetJob ¶
func (x *ExecDeleteJobParams) SetJob(entity *Job)
SetJob sets the params from the entity.
type ExecDeleteJobParamsConverter ¶
type ExecDeleteJobParamsConverter interface {
// goverter:update target
SetFromJob(target *ExecDeleteJobParams, source *Job)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type ExecDeleteJobParamsConverterImpl ¶
type ExecDeleteJobParamsConverterImpl struct{}
func (*ExecDeleteJobParamsConverterImpl) SetFromJob ¶
func (c *ExecDeleteJobParamsConverterImpl) SetFromJob(target *ExecDeleteJobParams, source *Job)
type ExecDeleteLockParams ¶
type ExecDeleteLockParams struct {
ID string `db:"id" json:"id"`
}
func (*ExecDeleteLockParams) SetLock ¶
func (x *ExecDeleteLockParams) SetLock(entity *Lock)
SetLock sets the params from the entity.
type ExecDeleteLockParamsConverter ¶
type ExecDeleteLockParamsConverter interface {
// goverter:update target
SetFromLock(target *ExecDeleteLockParams, source *Lock)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type ExecDeleteLockParamsConverterImpl ¶
type ExecDeleteLockParamsConverterImpl struct{}
func (*ExecDeleteLockParamsConverterImpl) SetFromLock ¶
func (c *ExecDeleteLockParamsConverterImpl) SetFromLock(target *ExecDeleteLockParams, source *Lock)
type ExecDeleteRevisionParams ¶
type ExecDeleteRevisionParams struct {
ID string `db:"id" json:"id"`
}
func (*ExecDeleteRevisionParams) SetRevision ¶
func (x *ExecDeleteRevisionParams) SetRevision(entity *Revision)
SetRevision sets the params from the entity.
type ExecDeleteRevisionParamsConverter ¶
type ExecDeleteRevisionParamsConverter interface {
// goverter:update target
SetFromRevision(target *ExecDeleteRevisionParams, source *Revision)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type ExecDeleteRevisionParamsConverterImpl ¶
type ExecDeleteRevisionParamsConverterImpl struct{}
func (*ExecDeleteRevisionParamsConverterImpl) SetFromRevision ¶
func (c *ExecDeleteRevisionParamsConverterImpl) SetFromRevision(target *ExecDeleteRevisionParams, source *Revision)
type ExecInsertJobParams ¶
type ExecInsertJobParams struct {
JobID string `db:"job_id" json:"job_id"`
Status string `db:"status" json:"status"`
Details *string `db:"details" json:"details"`
}
func (*ExecInsertJobParams) SetJob ¶
func (x *ExecInsertJobParams) SetJob(entity *Job)
SetJob sets the params from the entity.
type ExecInsertJobParamsConverter ¶
type ExecInsertJobParamsConverter interface {
// goverter:update target
SetFromJob(target *ExecInsertJobParams, source *Job)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type ExecInsertJobParamsConverterImpl ¶
type ExecInsertJobParamsConverterImpl struct{}
func (*ExecInsertJobParamsConverterImpl) SetFromJob ¶
func (c *ExecInsertJobParamsConverterImpl) SetFromJob(target *ExecInsertJobParams, source *Job)
type ExecInsertLockParams ¶
type ExecInsertLockParams struct {
ID string `db:"id" json:"id"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
}
func (*ExecInsertLockParams) SetLock ¶
func (x *ExecInsertLockParams) SetLock(entity *Lock)
SetLock sets the params from the entity.
type ExecInsertLockParamsConverter ¶
type ExecInsertLockParamsConverter interface {
// goverter:update target
SetFromLock(target *ExecInsertLockParams, source *Lock)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type ExecInsertLockParamsConverterImpl ¶
type ExecInsertLockParamsConverterImpl struct{}
func (*ExecInsertLockParamsConverterImpl) SetFromLock ¶
func (c *ExecInsertLockParamsConverterImpl) SetFromLock(target *ExecInsertLockParams, source *Lock)
type ExecInsertRevisionParams ¶
type ExecInsertRevisionParams struct {
ID string `db:"id" json:"id"`
Description string `db:"description" json:"description"`
Total int `db:"total" json:"total"`
Count int `db:"count" json:"count"`
Error *string `db:"error" json:"error"`
ErrorStmt *string `db:"error_stmt" json:"error_stmt"`
ExecutedAt time.Time `db:"executed_at" json:"executed_at"`
ExecutionTime time.Duration `db:"execution_time" json:"execution_time"`
}
func (*ExecInsertRevisionParams) SetRevision ¶
func (x *ExecInsertRevisionParams) SetRevision(entity *Revision)
SetRevision sets the params from the entity.
type ExecInsertRevisionParamsConverter ¶
type ExecInsertRevisionParamsConverter interface {
// goverter:update target
SetFromRevision(target *ExecInsertRevisionParams, source *Revision)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type ExecInsertRevisionParamsConverterImpl ¶
type ExecInsertRevisionParamsConverterImpl struct{}
func (*ExecInsertRevisionParamsConverterImpl) SetFromRevision ¶
func (c *ExecInsertRevisionParamsConverterImpl) SetFromRevision(target *ExecInsertRevisionParams, source *Revision)
type ExecUpdateRevisionParams ¶
type ExecUpdateRevisionParams struct {
UpdateMask []string `db:"update_mask" json:"update_mask"`
Description string `db:"description" json:"description"`
Total int `db:"total" json:"total"`
Count int `db:"count" json:"count"`
Error *string `db:"error" json:"error"`
ErrorStmt *string `db:"error_stmt" json:"error_stmt"`
ExecutedAt time.Time `db:"executed_at" json:"executed_at"`
ExecutionTime time.Duration `db:"execution_time" json:"execution_time"`
ID string `db:"id" json:"id"`
}
func (*ExecUpdateRevisionParams) SetRevision ¶
func (x *ExecUpdateRevisionParams) SetRevision(entity *Revision)
SetRevision sets the params from the entity.
type ExecUpdateRevisionParamsConverter ¶
type ExecUpdateRevisionParamsConverter interface {
// goverter:update target
// goverter:ignore UpdateMask
SetFromRevision(target *ExecUpdateRevisionParams, source *Revision)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type ExecUpdateRevisionParamsConverterImpl ¶
type ExecUpdateRevisionParamsConverterImpl struct{}
func (*ExecUpdateRevisionParamsConverterImpl) SetFromRevision ¶
func (c *ExecUpdateRevisionParamsConverterImpl) SetFromRevision(target *ExecUpdateRevisionParams, source *Revision)
type ExecUpsertRevisionParams ¶
type ExecUpsertRevisionParams struct {
ID string `db:"id" json:"id"`
Description string `db:"description" json:"description"`
Total int `db:"total" json:"total"`
Count int `db:"count" json:"count"`
Error *string `db:"error" json:"error"`
ErrorStmt *string `db:"error_stmt" json:"error_stmt"`
ExecutedAt time.Time `db:"executed_at" json:"executed_at"`
ExecutionTime time.Duration `db:"execution_time" json:"execution_time"`
}
func (*ExecUpsertRevisionParams) SetRevision ¶
func (x *ExecUpsertRevisionParams) SetRevision(entity *Revision)
SetRevision sets the params from the entity.
type ExecUpsertRevisionParamsConverter ¶
type ExecUpsertRevisionParamsConverter interface {
// goverter:update target
SetFromRevision(target *ExecUpsertRevisionParams, source *Revision)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type ExecUpsertRevisionParamsConverterImpl ¶
type ExecUpsertRevisionParamsConverterImpl struct{}
func (*ExecUpsertRevisionParamsConverterImpl) SetFromRevision ¶
func (c *ExecUpsertRevisionParamsConverterImpl) SetFromRevision(target *ExecUpsertRevisionParams, source *Revision)
type FileSystem ¶
FileSystem represents a filesystem that supports globbing and reading files.
type Gateway ¶
type Gateway interface {
// inherit from Querier
Querier
// Database returns the underlying transaction interface.
Database() DBTX
// RunInTx runs the given function in a transaction.
RunInTx(context.Context, QuerierAction) error
// Ping verifies a connection to the database is still alive.
Ping(context.Context) error
// Close closes the connection to the database.
Close()
}
Gateway represents the database gateway.
type GatewayOption ¶
GatewayOption represents a gateway option.
type GatewayOptionFunc ¶
GatewayOptionFunc is a function that applies a GatewayOption.
type GetJobParams ¶
type GetJobParams struct {
JobID string `db:"job_id" json:"job_id"`
}
func (*GetJobParams) SetJob ¶
func (x *GetJobParams) SetJob(entity *Job)
SetJob sets the params from the entity.
type GetJobParamsConverter ¶
type GetJobParamsConverter interface {
// goverter:update target
SetFromJob(target *GetJobParams, source *Job)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type GetJobParamsConverterImpl ¶
type GetJobParamsConverterImpl struct{}
func (*GetJobParamsConverterImpl) SetFromJob ¶
func (c *GetJobParamsConverterImpl) SetFromJob(target *GetJobParams, source *Job)
type GetLockParams ¶
type GetLockParams struct {
ID string `db:"id" json:"id"`
}
func (*GetLockParams) SetLock ¶
func (x *GetLockParams) SetLock(entity *Lock)
SetLock sets the params from the entity.
type GetLockParamsConverter ¶
type GetLockParamsConverter interface {
// goverter:update target
SetFromLock(target *GetLockParams, source *Lock)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type GetLockParamsConverterImpl ¶
type GetLockParamsConverterImpl struct{}
func (*GetLockParamsConverterImpl) SetFromLock ¶
func (c *GetLockParamsConverterImpl) SetFromLock(target *GetLockParams, source *Lock)
type GetRevisionParams ¶
type GetRevisionParams struct {
ID string `db:"id" json:"id"`
}
func (*GetRevisionParams) SetRevision ¶
func (x *GetRevisionParams) SetRevision(entity *Revision)
SetRevision sets the params from the entity.
type GetRevisionParamsConverter ¶
type GetRevisionParamsConverter interface {
// goverter:update target
SetFromRevision(target *GetRevisionParams, source *Revision)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type GetRevisionParamsConverterImpl ¶
type GetRevisionParamsConverterImpl struct{}
func (*GetRevisionParamsConverterImpl) SetFromRevision ¶
func (c *GetRevisionParamsConverterImpl) SetFromRevision(target *GetRevisionParams, source *Revision)
type InsertJobParams ¶
type InsertJobParams struct {
JobID string `db:"job_id" json:"job_id"`
Status string `db:"status" json:"status"`
Details *string `db:"details" json:"details"`
}
func (*InsertJobParams) SetJob ¶
func (x *InsertJobParams) SetJob(entity *Job)
SetJob sets the params from the entity.
type InsertJobParamsConverter ¶
type InsertJobParamsConverter interface {
// goverter:update target
SetFromJob(target *InsertJobParams, source *Job)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type InsertJobParamsConverterImpl ¶
type InsertJobParamsConverterImpl struct{}
func (*InsertJobParamsConverterImpl) SetFromJob ¶
func (c *InsertJobParamsConverterImpl) SetFromJob(target *InsertJobParams, source *Job)
type InsertLockParams ¶
type InsertLockParams struct {
ID string `db:"id" json:"id"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
}
func (*InsertLockParams) SetLock ¶
func (x *InsertLockParams) SetLock(entity *Lock)
SetLock sets the params from the entity.
type InsertLockParamsConverter ¶
type InsertLockParamsConverter interface {
// goverter:update target
SetFromLock(target *InsertLockParams, source *Lock)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type InsertLockParamsConverterImpl ¶
type InsertLockParamsConverterImpl struct{}
func (*InsertLockParamsConverterImpl) SetFromLock ¶
func (c *InsertLockParamsConverterImpl) SetFromLock(target *InsertLockParams, source *Lock)
type InsertRevisionParams ¶
type InsertRevisionParams struct {
ID string `db:"id" json:"id"`
Description string `db:"description" json:"description"`
Total int `db:"total" json:"total"`
Count int `db:"count" json:"count"`
Error *string `db:"error" json:"error"`
ErrorStmt *string `db:"error_stmt" json:"error_stmt"`
ExecutedAt time.Time `db:"executed_at" json:"executed_at"`
ExecutionTime time.Duration `db:"execution_time" json:"execution_time"`
}
func (*InsertRevisionParams) SetRevision ¶
func (x *InsertRevisionParams) SetRevision(entity *Revision)
SetRevision sets the params from the entity.
type InsertRevisionParamsConverter ¶
type InsertRevisionParamsConverter interface {
// goverter:update target
SetFromRevision(target *InsertRevisionParams, source *Revision)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type InsertRevisionParamsConverterImpl ¶
type InsertRevisionParamsConverterImpl struct{}
func (*InsertRevisionParamsConverterImpl) SetFromRevision ¶
func (c *InsertRevisionParamsConverterImpl) SetFromRevision(target *InsertRevisionParams, source *Revision)
type JobRepository ¶
type JobRepository struct {
Gateway Gateway
}
JobRepository provides methods to interact with the Job entity.
func (*JobRepository) WaitJob ¶
func (x *JobRepository) WaitJob(ctx context.Context, params *WaitJobParams) (*Job, error)
WaitJob waits for a job to complete and returns the job details.
type ListMigrationsParams ¶
type ListMigrationsParams struct{}
ListMigrationsParams represents the parameters for listing migrations.
type ListRevisionsParams ¶
type LockMigrationParams ¶
type LockMigrationParams struct {
// Timeout is the maximum time to wait for the lock.
Timeout time.Duration
}
LockMigrationParams represents the parameters for locking a revision.
type MigrationRepository ¶
type MigrationRepository struct {
// Gateway represents the database gateway.
Gateway Gateway
// FileSystem is the filesystem where the revision files are located.
FileSystem fs.FS
}
MigrationRepository represents a repository for managing revisions.
func (*MigrationRepository) ApplyMigration ¶
func (x *MigrationRepository) ApplyMigration(ctx context.Context, params *ApplyMigrationParams) error
ApplyMigration executes a revision.
func (*MigrationRepository) ListMigrations ¶
func (x *MigrationRepository) ListMigrations(ctx context.Context, _ *ListMigrationsParams) (collection []*Migration, _ error)
ListMigrations lists all revisions in the repository.
func (*MigrationRepository) LockMigration ¶
func (x *MigrationRepository) LockMigration(ctx context.Context, params *LockMigrationParams) error
LockMigration locks a revision for exclusive access.
func (*MigrationRepository) UnlockMigration ¶
func (x *MigrationRepository) UnlockMigration(ctx context.Context) error
UnlockMigration unlocks the revision after exclusive access.
type MigrationState ¶
type MigrationState struct {
Next *Revision
Current *Revision
Pending []*Revision
Executed []*Revision
}
MigrationState represents the state of a migration operation.
type Querier ¶
type Querier interface {
// The schema 'sys' is created to hold system-related tables.
CreateSchemaSys(ctx context.Context) error
// Creates a table named 'sys.jobs' with the following columns:
// The table 'sys.jobs' is created to track jobs in the system.
CreateTableJobs(ctx context.Context) error
// Creates a table named 'aurora_schema_locks' with the following columns:
CreateTableLocks(ctx context.Context) error
// Creates a table named 'aurora_schema_revisions' with the following columns:
CreateTableRevisions(ctx context.Context) error
// Deletes a row from the table 'sys.jobs' with option ':one'
DeleteJob(ctx context.Context, arg *DeleteJobParams) (*Job, error)
// Deletes a row from the table 'aurora_schema_locks' with option ':one'
DeleteLock(ctx context.Context, arg *DeleteLockParams) (*Lock, error)
// Deletes a row from the table 'aurora_schema_revisions' with option ':one'
DeleteRevision(ctx context.Context, arg *DeleteRevisionParams) (*Revision, error)
// Deletes a row from the table 'sys.jobs' with option ':exec'
ExecDeleteJob(ctx context.Context, arg *ExecDeleteJobParams) error
// Deletes a row from the table 'aurora_schema_locks' with option ':exec'
ExecDeleteLock(ctx context.Context, arg *ExecDeleteLockParams) error
// Deletes a row from the table 'aurora_schema_revisions' with option ':exec'
ExecDeleteRevision(ctx context.Context, arg *ExecDeleteRevisionParams) error
// Inserts a row into the table 'sys.jobs' with option ':exec'
ExecInsertJob(ctx context.Context, arg *ExecInsertJobParams) error
// Inserts a row into the table 'aurora_schema_locks' with option ':exec'
ExecInsertLock(ctx context.Context, arg *ExecInsertLockParams) error
// Inserts a row into the table 'aurora_schema_revisions' with option ':exec'
ExecInsertRevision(ctx context.Context, arg *ExecInsertRevisionParams) error
// Updates a row in the table 'revision' with option ':exec'
ExecUpdateRevision(ctx context.Context, arg *ExecUpdateRevisionParams) error
// Upserts a row into the table 'aurora_schema_revisions' with option ':exec'
ExecUpsertRevision(ctx context.Context, arg *ExecUpsertRevisionParams) error
// Retrieves a row from the table 'sys.jobs' with option ':one'
GetJob(ctx context.Context, arg *GetJobParams) (*Job, error)
// Retrieves a row from the table 'aurora_schema_locks' with option ':one'
GetLock(ctx context.Context, arg *GetLockParams) (*Lock, error)
// Retrieves a row from the table 'aurora_schema_revisions' with option ':one'
GetRevision(ctx context.Context, arg *GetRevisionParams) (*Revision, error)
// Inserts a row into the table 'sys.jobs' with option ':one'
InsertJob(ctx context.Context, arg *InsertJobParams) (*Job, error)
// Inserts a row into the table 'aurora_schema_locks' with option ':one'
InsertLock(ctx context.Context, arg *InsertLockParams) (*Lock, error)
// Inserts a row into the table 'aurora_schema_revisions' with option ':one'
InsertRevision(ctx context.Context, arg *InsertRevisionParams) (*Revision, error)
// Retrieves a list of rows from the table 'aurora_schema_revisions' with option ':many'
ListRevisions(ctx context.Context, arg *ListRevisionsParams) ([]*Revision, error)
// Updates a row in the table 'revision' with option ':one'
UpdateRevision(ctx context.Context, arg *UpdateRevisionParams) (*Revision, error)
// Upserts a row into the table 'aurora_schema_revisions' with option ':one'
UpsertRevision(ctx context.Context, arg *UpsertRevisionParams) (*Revision, error)
}
type QuerierAction ¶
QuerierAction represents a query action.
func NewQueryPipeline ¶
func NewQueryPipeline(collection ...QuerierFunc) QuerierAction
NewQueryPipeline returns a new QuerierFunc that runs the given steps.
type QuerierFunc ¶
QuerierFunc is a function that runs a query.
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateSchemaSys ¶
The schema 'sys' is created to hold system-related tables.
func (*Queries) CreateTableJobs ¶
Creates a table named 'sys.jobs' with the following columns: The table 'sys.jobs' is created to track jobs in the system.
func (*Queries) CreateTableLocks ¶
Creates a table named 'aurora_schema_locks' with the following columns:
func (*Queries) CreateTableRevisions ¶
Creates a table named 'aurora_schema_revisions' with the following columns:
func (*Queries) DeleteLock ¶
Deletes a row from the table 'aurora_schema_locks' with option ':one'
func (*Queries) DeleteRevision ¶
Deletes a row from the table 'aurora_schema_revisions' with option ':one'
func (*Queries) ExecDeleteJob ¶
func (q *Queries) ExecDeleteJob(ctx context.Context, arg *ExecDeleteJobParams) error
Deletes a row from the table 'sys.jobs' with option ':exec'
func (*Queries) ExecDeleteLock ¶
func (q *Queries) ExecDeleteLock(ctx context.Context, arg *ExecDeleteLockParams) error
Deletes a row from the table 'aurora_schema_locks' with option ':exec'
func (*Queries) ExecDeleteRevision ¶
func (q *Queries) ExecDeleteRevision(ctx context.Context, arg *ExecDeleteRevisionParams) error
Deletes a row from the table 'aurora_schema_revisions' with option ':exec'
func (*Queries) ExecInsertJob ¶
func (q *Queries) ExecInsertJob(ctx context.Context, arg *ExecInsertJobParams) error
Inserts a row into the table 'sys.jobs' with option ':exec'
func (*Queries) ExecInsertLock ¶
func (q *Queries) ExecInsertLock(ctx context.Context, arg *ExecInsertLockParams) error
Inserts a row into the table 'aurora_schema_locks' with option ':exec'
func (*Queries) ExecInsertRevision ¶
func (q *Queries) ExecInsertRevision(ctx context.Context, arg *ExecInsertRevisionParams) error
Inserts a row into the table 'aurora_schema_revisions' with option ':exec'
func (*Queries) ExecUpdateRevision ¶
func (q *Queries) ExecUpdateRevision(ctx context.Context, arg *ExecUpdateRevisionParams) error
Updates a row in the table 'revision' with option ':exec'
func (*Queries) ExecUpsertRevision ¶
func (q *Queries) ExecUpsertRevision(ctx context.Context, arg *ExecUpsertRevisionParams) error
Upserts a row into the table 'aurora_schema_revisions' with option ':exec'
func (*Queries) GetRevision ¶
Retrieves a row from the table 'aurora_schema_revisions' with option ':one'
func (*Queries) InsertLock ¶
Inserts a row into the table 'aurora_schema_locks' with option ':one'
func (*Queries) InsertRevision ¶
Inserts a row into the table 'aurora_schema_revisions' with option ':one'
func (*Queries) ListRevisions ¶
Retrieves a list of rows from the table 'aurora_schema_revisions' with option ':many'
func (*Queries) RunInTx ¶
func (x *Queries) RunInTx(ctx context.Context, action QuerierAction) (err error)
RunInTx runs the given function in a transaction.
func (*Queries) UpdateRevision ¶
Updates a row in the table 'revision' with option ':one'
func (*Queries) UpsertRevision ¶
Upserts a row into the table 'aurora_schema_revisions' with option ':one'
type Revision ¶
type Revision struct {
ID string `db:"id" json:"id"`
Description string `db:"description" json:"description"`
Total int `db:"total" json:"total"`
Count int `db:"count" json:"count"`
Error *string `db:"error" json:"error"`
ErrorStmt *string `db:"error_stmt" json:"error_stmt"`
ExecutedAt time.Time `db:"executed_at" json:"executed_at"`
ExecutionTime time.Duration `db:"execution_time" json:"execution_time"`
}
type UpdateRevisionParams ¶
type UpdateRevisionParams struct {
UpdateMask []string `db:"update_mask" json:"update_mask"`
Description string `db:"description" json:"description"`
Total int `db:"total" json:"total"`
Count int `db:"count" json:"count"`
Error *string `db:"error" json:"error"`
ErrorStmt *string `db:"error_stmt" json:"error_stmt"`
ExecutedAt time.Time `db:"executed_at" json:"executed_at"`
ExecutionTime time.Duration `db:"execution_time" json:"execution_time"`
ID string `db:"id" json:"id"`
}
func (*UpdateRevisionParams) SetRevision ¶
func (x *UpdateRevisionParams) SetRevision(entity *Revision)
SetRevision sets the params from the entity.
type UpdateRevisionParamsConverter ¶
type UpdateRevisionParamsConverter interface {
// goverter:update target
// goverter:ignore UpdateMask
SetFromRevision(target *UpdateRevisionParams, source *Revision)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type UpdateRevisionParamsConverterImpl ¶
type UpdateRevisionParamsConverterImpl struct{}
func (*UpdateRevisionParamsConverterImpl) SetFromRevision ¶
func (c *UpdateRevisionParamsConverterImpl) SetFromRevision(target *UpdateRevisionParams, source *Revision)
type UpsertRevisionParams ¶
type UpsertRevisionParams struct {
ID string `db:"id" json:"id"`
Description string `db:"description" json:"description"`
Total int `db:"total" json:"total"`
Count int `db:"count" json:"count"`
Error *string `db:"error" json:"error"`
ErrorStmt *string `db:"error_stmt" json:"error_stmt"`
ExecutedAt time.Time `db:"executed_at" json:"executed_at"`
ExecutionTime time.Duration `db:"execution_time" json:"execution_time"`
}
func (*UpsertRevisionParams) SetRevision ¶
func (x *UpsertRevisionParams) SetRevision(entity *Revision)
SetRevision sets the params from the entity.
type UpsertRevisionParamsConverter ¶
type UpsertRevisionParamsConverter interface {
// goverter:update target
SetFromRevision(target *UpsertRevisionParams, source *Revision)
}
goverter:converter goverter:skipCopySameType yes goverter:output:file models_conv_gen.go goverter:output:package github.com/aws-contrib/aws-aurora/internal/database/ent
type UpsertRevisionParamsConverterImpl ¶
type UpsertRevisionParamsConverterImpl struct{}
func (*UpsertRevisionParamsConverterImpl) SetFromRevision ¶
func (c *UpsertRevisionParamsConverterImpl) SetFromRevision(target *UpsertRevisionParams, source *Revision)
type WaitJobParams ¶
type WaitJobParams struct {
// Job is the job to wait for.
JobID string
}
WaitJobParams is the parameters for the WaitJob method.