Documentation ¶
Index ¶
Constants ¶
View Source
const ( DUMP_MODE = "dumpFile" DIRECT_CONNECT_MODE = "directConnect" SESSION_FILE_MODE = "sessionFile" SCHEMA_ONLY = "Schema" DATA_ONLY = "Data" LOW_DOWNTIME_MIGRATION = "lowdt" POSTGRESQL_DIALECT = "PostgreSQL" GOOGLE_SQL_DIALECT = "Google Standard SQL" )
Variables ¶
View Source
var TABLE_STATEMENTS = []string{
`CREATE TABLE IF NOT EXISTS SchemaConversionSession (
VersionId STRING(36) NOT NULL,
PreviousVersionId ARRAY<STRING(36)>,
SessionName STRING(50) NOT NULL,
EditorName STRING(100) NOT NULL,
DatabaseType STRING(50) NOT NULL,
DatabaseName STRING(50) NOT NULL,
Dialect STRING(50) NOT NULL,
Notes ARRAY<STRING(MAX)> NOT NULL,
Tags ARRAY<STRING(20)>,
SchemaChanges STRING(MAX),
SchemaConversionObject JSON NOT NULL,
CreateTimestamp TIMESTAMP NOT NULL,
) PRIMARY KEY(VersionId)`,
`CREATE TABLE IF NOT EXISTS SMT_JOB (
JobId STRING(100) NOT NULL,
JobName STRING(100) NOT NULL,
JobType STRING(100) NOT NULL,
JobStateData JSON,
JobData JSON,
Dialect STRING(50) NOT NULL,
SpannerDatabaseName STRING(100) NOT NULL,
CreatedAt TIMESTAMP NOT NULL OPTIONS (allow_commit_timestamp=true),
UpdatedAt TIMESTAMP NOT NULL OPTIONS (allow_commit_timestamp=true),
) PRIMARY KEY(JobId)`,
`CREATE TABLE IF NOT EXISTS SMT_JOB_HISTORY (
JobId STRING(100) NOT NULL,
JobName STRING(100) NOT NULL,
JobType STRING(100) NOT NULL,
JobStateData JSON,
JobData JSON,
Dialect STRING(50) NOT NULL,
SpannerDatabaseName STRING(100) NOT NULL,
CreatedAt TIMESTAMP NOT NULL OPTIONS (allow_commit_timestamp=true),
) PRIMARY KEY(JobId, CreatedAt)`,
`CREATE TABLE IF NOT EXISTS SMT_RESOURCE (
ResourceId STRING(100) NOT NULL,
JobId STRING(100) NOT NULL,
ExternalId STRING(100),
ResourceName STRING(100) NOT NULL,
ResourceType STRING(100) NOT NULL,
ResourceStateData JSON,
ResourceData JSON,
CreatedAt TIMESTAMP NOT NULL OPTIONS (allow_commit_timestamp=true),
UpdatedAt TIMESTAMP NOT NULL OPTIONS (allow_commit_timestamp=true),
) PRIMARY KEY(ResourceId)`,
`CREATE TABLE IF NOT EXISTS SMT_RESOURCE_HISTORY (
ResourceId STRING(100) NOT NULL,
JobId STRING(100) NOT NULL,
ExternalId STRING(100),
ResourceName STRING(100) NOT NULL,
ResourceType STRING(100) NOT NULL,
ResourceStateData JSON,
ResourceData JSON,
CreatedAt TIMESTAMP NOT NULL OPTIONS (allow_commit_timestamp=true),
) PRIMARY KEY(ResourceId, CreatedAt)`,
}
Functions ¶
func CheckOrCreateMetadataDb ¶
func GetSpannerUri ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.