sql

package
v0.2.0-alpha.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 29 Imported by: 0

README

SQL Migrations

To create a new fizz migration run in the project root:

$ name=
$ soda generate fizz -c ./contrib/sql/.soda.yml -p ./persistence/sql/migrations $name $name

To create SQL migrations, target each database individually and run

$ soda generate sql -e mysql -c ./contrib/sql/.soda.yml -p ./contrib/sql/migrations [name]
$ soda generate sql -e sqlite -c ./contrib/sql/.soda.yml -p ./contrib/sql/migrations [name]
$ soda generate sql -e postgres -c ./contrib/sql/.soda.yml -p ./contrib/sql/migrations [name]
$ soda generate sql -e cockroach -c ./contrib/sql/.soda.yml -p ./contrib/sql/migrations [name]

or, alternative run

$ soda generate sql -c ./contrib/sql/.soda.yml -p ./contrib/sql/migrations 

and remove the sqlite part from the newly generated file to create a SQL migrations that works with all aforementioned databases.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithTransaction

func WithTransaction(ctx context.Context, tx *pop.Connection) context.Context

Types

type Persister

type Persister struct {
	// contains filtered or unexported fields
}

func NewPersister

func NewPersister(r persisterDependencies, conf configuration.Provider, c *pop.Connection) (*Persister, error)

func (*Persister) Add

func (p *Persister) Add(ctx context.Context, csrfToken string, errs ...error) (uuid.UUID, error)

func (*Persister) AddMessage

func (p *Persister) AddMessage(ctx context.Context, m *courier.Message) error

func (*Persister) Clear

func (p *Persister) Clear(ctx context.Context, olderThan time.Duration, force bool) (err error)

func (*Persister) Close

func (p *Persister) Close(ctx context.Context) error

func (*Persister) CreateIdentity

func (p *Persister) CreateIdentity(ctx context.Context, i *identity.Identity) error

func (*Persister) CreateLoginRequest

func (p *Persister) CreateLoginRequest(ctx context.Context, r *login.Request) error

func (*Persister) CreateRegistrationRequest

func (p *Persister) CreateRegistrationRequest(ctx context.Context, r *registration.Request) error

func (*Persister) CreateSession

func (p *Persister) CreateSession(ctx context.Context, s *session.Session) error

func (*Persister) CreateSettingsRequest

func (p *Persister) CreateSettingsRequest(ctx context.Context, r *settings.Request) error

func (Persister) CreateVerifyRequest

func (p Persister) CreateVerifyRequest(ctx context.Context, r *verify.Request) error

func (*Persister) DeleteContinuitySession

func (p *Persister) DeleteContinuitySession(ctx context.Context, id uuid.UUID) error

func (*Persister) DeleteIdentity

func (p *Persister) DeleteIdentity(ctx context.Context, id uuid.UUID) error

func (*Persister) DeleteSession

func (p *Persister) DeleteSession(ctx context.Context, sid uuid.UUID) error

func (*Persister) DeleteSessionsFor

func (p *Persister) DeleteSessionsFor(ctx context.Context, sid uuid.UUID) error

func (*Persister) FindAddressByCode

func (p *Persister) FindAddressByCode(ctx context.Context, code string) (*identity.VerifiableAddress, error)

func (*Persister) FindAddressByValue

func (p *Persister) FindAddressByValue(ctx context.Context, via identity.VerifiableAddressType, value string) (*identity.VerifiableAddress, error)

func (*Persister) FindByCredentialsIdentifier

func (p *Persister) FindByCredentialsIdentifier(ctx context.Context, ct identity.CredentialsType, match string) (*identity.Identity, *identity.Credentials, error)

func (*Persister) GetConnection

func (p *Persister) GetConnection(ctx context.Context) *pop.Connection

func (*Persister) GetContinuitySession

func (p *Persister) GetContinuitySession(ctx context.Context, id uuid.UUID) (*continuity.Container, error)

func (*Persister) GetIdentity

func (p *Persister) GetIdentity(ctx context.Context, id uuid.UUID) (*identity.Identity, error)

func (*Persister) GetIdentityConfidential

func (p *Persister) GetIdentityConfidential(ctx context.Context, id uuid.UUID) (*identity.Identity, error)

func (*Persister) GetLoginRequest

func (p *Persister) GetLoginRequest(ctx context.Context, id uuid.UUID) (*login.Request, error)

func (*Persister) GetRegistrationRequest

func (p *Persister) GetRegistrationRequest(ctx context.Context, id uuid.UUID) (*registration.Request, error)

func (*Persister) GetSession

func (p *Persister) GetSession(ctx context.Context, sid uuid.UUID) (*session.Session, error)

func (*Persister) GetSettingsRequest

func (p *Persister) GetSettingsRequest(ctx context.Context, id uuid.UUID) (*settings.Request, error)

func (Persister) GetVerifyRequest

func (p Persister) GetVerifyRequest(ctx context.Context, id uuid.UUID) (*verify.Request, error)

func (*Persister) LatestQueuedMessage

func (p *Persister) LatestQueuedMessage(ctx context.Context) (*courier.Message, error)

func (*Persister) ListIdentities

func (p *Persister) ListIdentities(ctx context.Context, limit, offset int) ([]identity.Identity, error)

func (*Persister) MarkRequestForced

func (p *Persister) MarkRequestForced(ctx context.Context, id uuid.UUID) error

func (*Persister) MigrateDown

func (p *Persister) MigrateDown(ctx context.Context, steps int) error

func (*Persister) MigrateUp

func (p *Persister) MigrateUp(ctx context.Context) error

func (*Persister) MigrationStatus

func (p *Persister) MigrationStatus(ctx context.Context, w io.Writer) error

func (*Persister) NextMessages

func (p *Persister) NextMessages(ctx context.Context, limit uint8) ([]courier.Message, error)

func (*Persister) Ping

func (p *Persister) Ping(ctx context.Context) error

func (*Persister) Read

func (*Persister) SaveContinuitySession

func (p *Persister) SaveContinuitySession(ctx context.Context, c *continuity.Container) error

func (*Persister) SetMessageStatus

func (p *Persister) SetMessageStatus(ctx context.Context, id uuid.UUID, ms courier.MessageStatus) error

func (*Persister) Transaction

func (p *Persister) Transaction(ctx context.Context, callback func(connection *pop.Connection) error) error

func (*Persister) UpdateIdentity

func (p *Persister) UpdateIdentity(ctx context.Context, i *identity.Identity) error

func (*Persister) UpdateLoginRequestMethod

func (p *Persister) UpdateLoginRequestMethod(ctx context.Context, id uuid.UUID, ct identity.CredentialsType, rm *login.RequestMethod) error

func (*Persister) UpdateRegistrationRequest

func (p *Persister) UpdateRegistrationRequest(ctx context.Context, id uuid.UUID, ct identity.CredentialsType, rm *registration.RequestMethod) error

func (*Persister) UpdateSettingsRequest

func (p *Persister) UpdateSettingsRequest(ctx context.Context, r *settings.Request) error

func (*Persister) UpdateVerifiableAddress

func (p *Persister) UpdateVerifiableAddress(ctx context.Context, address *identity.VerifiableAddress) error

func (Persister) UpdateVerifyRequest

func (p Persister) UpdateVerifyRequest(ctx context.Context, r *verify.Request) error

func (*Persister) VerifyAddress

func (p *Persister) VerifyAddress(ctx context.Context, code string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL