sql

package
v0.0.3-alpha.12 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

README

SQL Migrations

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

$ soda generate fizz -c ./contrib/sql/.soda.yml -p ./contrib/sql/migrations [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

This section is empty.

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, 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(c context.Context) error

func (*Persister) CreateIdentity

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

func (*Persister) CreateLoginRequest

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

func (*Persister) CreateProfileRequest

func (p *Persister) CreateProfileRequest(_ context.Context, r *profile.Request) error

func (*Persister) CreateRegistrationRequest

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

func (*Persister) CreateSession

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

func (*Persister) DeleteIdentity

func (p *Persister) DeleteIdentity(_ 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) FindByCredentialsIdentifier

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

func (*Persister) GetIdentity

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

func (*Persister) GetIdentityConfidential

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

func (*Persister) GetLoginRequest

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

func (*Persister) GetProfileRequest

func (p *Persister) GetProfileRequest(_ context.Context, id uuid.UUID) (*profile.Request, error)

func (*Persister) GetRegistrationRequest

func (p *Persister) GetRegistrationRequest(_ 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) ListIdentities

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

func (*Persister) MigrateDown

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

func (*Persister) MigrateUp

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

func (*Persister) MigrationStatus

func (p *Persister) MigrationStatus(c 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(c context.Context) error

func (*Persister) Read

func (p *Persister) Read(ctx context.Context, id uuid.UUID) ([]json.RawMessage, error)

func (*Persister) SetMessageStatus

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

func (*Persister) UpdateIdentity

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

func (*Persister) UpdateIdentityConfidential

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

func (*Persister) UpdateLoginRequest

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

func (*Persister) UpdateProfileRequest

func (p *Persister) UpdateProfileRequest(ctx context.Context, r *profile.Request) error

func (*Persister) UpdateRegistrationRequest

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

Jump to

Keyboard shortcuts

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