Help us shape the future of Go! Take the 2026 Go Developer Survey

constants

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Self
	SelfConfigDirName  = ".dbdaddy"
	SelfConfigFileName = "dbdaddy.config.json"
	SelfDbName         = "__daddys_home"

	//  Config keys
	DbConfigOriginsKey       = "origins"
	DbConfigConnSubkey       = "connection"
	DbConfigDriverKey        = DbConfigConnSubkey + ".driver"
	DbConfigHostKey          = DbConfigConnSubkey + ".host"
	DbConfigPortKey          = DbConfigConnSubkey + ".port"
	DbConfigDbNameKey        = DbConfigConnSubkey + ".dbname"
	DbConfigUserKey          = DbConfigConnSubkey + ".user"
	DbConfigPassKey          = DbConfigConnSubkey + ".password"
	DbConfigParamsKey        = DbConfigConnSubkey + ".params"
	DbConfigCurrentBranchKey = "status.currentBranch"

	// Config possible driver values
	DbDriverPostgres = "postgres"
	DbDriverMySQL    = "mysql"
	DbDriverSqlite   = "sqlite"

	// dumps
	PgDumpDir     = "pg_dumps"
	MySqlDumpDir  = "mysql_dumps"
	SqliteDumpDir = "sqlite_dumps"

	// project
	ScriptsDirName = "scripts"
	SchemaDirName  = "schema"

	// tmp
	TmpDir          = "tmp"
	TextQueryOutput = "query.out"
	CSVQueryOutput  = "query.csv"

	// misc
	SoftDeleteSuffix = "__DELETED"
)
View Source
const (
	TableTypeBaseTable = "BASE TABLE"
	TableTypeView      = "VIEW"
)
View Source
const (
	MigDirStateFile        = "state.json"
	MigDirActiveSignalFile = "active"
	MigDirInfoFile         = "info.md"
	MigDirUpSqlFile        = "up.sql"
	MigDirDownSqlFile      = "down.sql"
)

migration dir files e.g. "migrations/dbname/version_string/*"

View Source
const (
	MigActionCreateTable = "CREATE_TABLE"
	MigActionDropTable   = "DROP_TABLE"

	MigActionCreateCol = "CREATE_COLUMN"
	MigActionDropCol   = "DROP_COLUMN"

	MigActionCreateType = "CREATE_TYPE"
	MigActionDropType   = "DROP_TYPE"

	MigActionCreateConstraint = "CREATE_CONSTRAINT"
	MigActionDropConstraint   = "DROP_CONSTRAINT"

	MigActionCreateView = "CREATE_VIEW"
	MigActionDropView   = "DROP_VIEW"
)

DEPRECATED

View Source
const (
	PgBigInt            = "bigint"
	PgBigSerial         = "bigserial"
	PgBit               = "bit"
	PgBitVarying        = "bit varying"
	PgBoolean           = "boolean"
	PgBox               = "box"
	PgBytea             = "bytea"
	PgCharacter         = "character"
	PgCharacterVarying  = "character varying"
	PgCidr              = "cidr"
	PgCircle            = "circle"
	PgDate              = "date"
	PgDoublePrecision   = "double precision"
	PgInet              = "inet"
	PgInteger           = "integer"
	PgInterval          = "interval"
	PgJSON              = "json"
	PgJSONB             = "jsonb"
	PgLine              = "line"
	PgLseg              = "lseg"
	PgMacaddr           = "macaddr"
	PgMacaddr8          = "macaddr8"
	PgMoney             = "money"
	PgNumeric           = "numeric"
	PgPath              = "path"
	PgPgLsn             = "pg_lsn"
	PgPgSnapshot        = "pg_snapshot"
	PgPoint             = "point"
	PgPolygon           = "polygon"
	PgReal              = "real"
	PgSmallInt          = "smallint"
	PgSmallSerial       = "smallserial"
	PgSerial            = "serial"
	PgText              = "text"
	PgTime              = "time"
	PgTimeWithTimeZone  = "time with time zone"
	PgTimestamp         = "timestamp"
	PgTimestampWithZone = "timestamp with time zone"
	PgTsquery           = "tsquery"
	PgTsvector          = "tsvector"
	PgTxidSnapshot      = "txid_snapshot"
	PgUUID              = "uuid"
	PgXML               = "xml"
)
View Source
const (
	MigDirName = "migrations"
)

collection of migrations for each db

View Source
const (
	MigFileIndentation = "    "
)

Default SQL migration file indentation

Variables

View Source
var PgDataTypes = []string{
	"bigint",
	"bigserial",
	"bit",
	"bit varying",
	"boolean",
	"box",
	"bytea",
	"character",
	"character varying",
	"cidr",
	"circle",
	"date",
	"double precision",
	"inet",
	"integer",
	"interval",
	"json",
	"jsonb",
	"line",
	"lseg",
	"macaddr",
	"macaddr8",
	"money",
	"numeric",
	"path",
	"pg_lsn",
	"pg_snapshot",
	"point",
	"polygon",
	"real",
	"smallint",
	"smallserial",
	"serial",
	"text",
	"time",
	"time with time zone",
	"timestamp",
	"timestamp with time zone",
	"tsquery",
	"tsvector",
	"txid_snapshot",
	"uuid",
	"xml",
}
View Source
var SupportedDrivers = []string{DbDriverPostgres, DbDriverMySQL}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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