Documentation
¶
Index ¶
Constants ¶
View Source
const ( // LatestMigrationVersion is the latest migration version of the // database. This is used to implement downgrade protection for the // daemon. // // NOTE: This MUST be updated when a new migration is added. LatestMigrationVersion = 2 )
Variables ¶
View Source
var ( FaradayMigrationSet = sqldb.MigrationSet{ TrackingTableName: pgx.DefaultMigrationsTable, SQLFileDirectory: "sqlc/migrations", SQLFiles: sqlSchemas, LatestMigrationVersion: LatestMigrationVersion, Descriptors: MakeMigrationDescriptors(), MakeProgrammaticMigrations: func( db *sqldb.BaseDB, ) (map[uint]migrate.ProgrammaticMigrEntry, error) { return make(map[uint]migrate.ProgrammaticMigrEntry), nil }, } FaradayMigrationSets = []sqldb.MigrationSet{FaradayMigrationSet} )
Functions ¶
func MakeMigrationDescriptors ¶
func MakeMigrationDescriptors() []sqldb.MigrationDescriptor
MakeMigrationDescriptors returns the ordered migration descriptors for faraday's SQL schema. Both migrations are schema-only, so neither carries a programmatic migration step.
func NewTestPostgresDB ¶
func NewTestPostgresDB(t testing.TB) *sqldb.PostgresStore
NewTestPostgresDB is a helper function that creates a Postgres database for testing.
Types ¶
type QueriesTxOptions ¶
type QueriesTxOptions struct {
// contains filtered or unexported fields
}
QueriesTxOptions defines the set of db txn options the SQLQueries understands.
func NewQueryReadTx ¶
func NewQueryReadTx() QueriesTxOptions
NewQueryReadTx creates a new read transaction option set.
func (*QueriesTxOptions) ReadOnly ¶
func (a *QueriesTxOptions) ReadOnly() bool
ReadOnly returns true if the transaction should be read only.
NOTE: This implements the TxOptions.
type SqliteConfig ¶
type SqliteConfig struct {
// SkipMigrations if true, then all the tables will be created on start
// up if they don't already exist.
SkipMigrations bool `long:"skipmigrations" description:"Skip applying migrations on startup."`
// SkipMigrationDbBackup if true, then a backup of the database will not
// be created before applying migrations.
SkipMigrationDbBackup bool `long:"skipmigrationdbbackup" description:"Skip creating a backup of the database before applying migrations."`
// DatabaseFileName is the full file path where the database file can be
// found.
DatabaseFileName string `long:"dbfile" description:"The full path to the database."`
}
SqliteConfig holds all the config arguments needed to interact with our sqlite DB.
nolint: lll
Source Files
¶
Click to show internal directories.
Click to hide internal directories.