mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-19 08:28:06 +02:00
fix: write canonical historic sql setup filters
This commit is contained in:
parent
fc1fdb6bc9
commit
9fb98e3c32
2 changed files with 42 additions and 6 deletions
|
|
@ -665,12 +665,13 @@ async function maybeApplyHistoricSqlConfig(input: {
|
|||
return { ...input.connection, historicSql: { ...existing, enabled: false, dialect } };
|
||||
}
|
||||
|
||||
const common = {
|
||||
const common: Record<string, unknown> = {
|
||||
...existing,
|
||||
enabled: true,
|
||||
dialect,
|
||||
serviceAccountUserPatterns: input.args.historicSqlServiceAccountPatterns ?? [],
|
||||
filters: historicSqlFiltersForSetup(input.args.historicSqlServiceAccountPatterns),
|
||||
};
|
||||
delete common.serviceAccountUserPatterns;
|
||||
|
||||
if (dialect === 'postgres') {
|
||||
return {
|
||||
|
|
@ -692,6 +693,21 @@ async function maybeApplyHistoricSqlConfig(input: {
|
|||
};
|
||||
}
|
||||
|
||||
function historicSqlFiltersForSetup(patterns: string[] | undefined) {
|
||||
const serviceAccountPatterns = patterns ?? [];
|
||||
return {
|
||||
dropTrivialProbes: true,
|
||||
...(serviceAccountPatterns.length > 0
|
||||
? {
|
||||
serviceAccounts: {
|
||||
patterns: serviceAccountPatterns,
|
||||
mode: 'exclude' as const,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
}
|
||||
|
||||
async function defaultTestConnection(projectDir: string, connectionId: string, io: KtxCliIo): Promise<number> {
|
||||
return await runKtxConnection({ command: 'test', projectDir, connectionId }, io);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue