constants

package
v0.4.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DbConfigDefaultPostgresUrl = "postgresql://postgres:postgres@localhost:5342/postgres"

	// Self
	SelfGlobalDirName = ".dbdaddy"
	SelfDbName        = "__daddys_home"

	//  Config keys
	DbConfigDriverKey        = "connection.driver"
	DbConfigHostKey          = "connection.host"
	DbConfigPortKey          = "connection.port"
	DbConfigDbNameKey        = "connection.dbname"
	DbConfigUserKey          = "connection.user"
	DbConfigPassKey          = "connection.password"
	DbConfigCurrentBranchKey = "status.currentBranch"

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

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

	// migrations
	MigrationDir = "migrations"

	// tmp
	TmpDir          = "tmp"
	TextQueryOutput = "query.out"
	CSVQueryOutput  = "query.csv"
)
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}

Functions

func GetGlobalConfigPath

func GetGlobalConfigPath() string

func GetGlobalDirPath

func GetGlobalDirPath() string

func GetLocalConfigPath

func GetLocalConfigPath() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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