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 DriverDumpDirNames = map[string]string{ DbDriverPostgres: PgDumpDir, DbDriverMySQL: MySqlDumpDir, DbDriverSqlite: SqliteDumpDir, }
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.
Click to show internal directories.
Click to hide internal directories.