Skip to content

Commit

Permalink
add config support for ST and BYODB
Browse files Browse the repository at this point in the history
  • Loading branch information
pivnicek committed Nov 22, 2024
1 parent c8e2b81 commit c782822
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ class Config extends BaseConfig
'account' => 'NE35810',
'region' => 'GCP_US_EAST4',
],
'coates.keboola.cloud' => [
'db_replica_prefix' => 'COATESAWSUS',
'db_prefix' => 'KBC_AWSUSE1',
'account' => 'ALB08210',
'region' => 'AWS_US_EAST_1',
],
];

private const BYODB_DATABASES = [
'coates' => [
'db_replica_prefix' => 'COATESAWSUS',
'db_prefix' => 'KEBOOLA',
'account' => 'COATES',
'region' => 'AWS_US_EAST_1',
],
];

public function getMode(): string
Expand Down Expand Up @@ -107,6 +122,7 @@ public function getSourceDatabasePrefix(): string

public function getReplicaDatabasePrefix(): string
{

$url = parse_url($this->getSourceKbcUrl());
assert($url && array_key_exists('host', $url));

Expand Down Expand Up @@ -159,4 +175,19 @@ public function isDryRun(): bool
{
return (bool) $this->getValue(['parameters', 'dryRun']);
}

public function getIncludedWorkspaceSchemas(): array
{
return $this->getArrayValue(['parameters', 'includeWorkspaceSchemas']);
}

public function getIncludedExternalSchemas(): array
{
return $this->getArrayValue(['parameters', 'includeExternalSchemas']);
}

public function getByodbSource(): bool
{
return (bool) $this->getValue(['parameters', 'sourceByodb']);
}
}
1 change: 1 addition & 0 deletions src/Configuration/ConfigDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ protected function getParametersDefinition(): ArrayNodeDefinition
->children()
->enumNode('mode')->values(['sapi', 'database'])->defaultValue('sapi')->end()
->booleanNode('dryRun')->defaultFalse()->end()
->booleanNode('isSourceByodb')->defaultFalse()->end()
->scalarNode('sourceKbcUrl')->isRequired()->cannotBeEmpty()->end()
->scalarNode('#sourceKbcToken')->isRequired()->cannotBeEmpty()->end()
->arrayNode('tables')->prototype('scalar')->end()->end()
Expand Down

0 comments on commit c782822

Please sign in to comment.