mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-19 08:28:06 +02:00
fix(setup): prompt for postgres query history
This commit is contained in:
parent
9057c222dc
commit
bc23b1a447
2 changed files with 67 additions and 6 deletions
|
|
@ -842,7 +842,7 @@ async function maybeApplyHistoricSqlConfig(input: {
|
|||
let enabled = input.args.enableQueryHistory === true;
|
||||
if (input.args.disableQueryHistory === true) {
|
||||
enabled = false;
|
||||
} else if (input.args.inputMode !== 'disabled' && input.args.enableQueryHistory !== true && dialect !== 'postgres') {
|
||||
} else if (input.args.inputMode !== 'disabled' && input.args.enableQueryHistory !== true) {
|
||||
const choice = await input.prompts.select({
|
||||
message: `Enable query-history ingest for this ${driverLabel(input.driver)} connection?`,
|
||||
options: [
|
||||
|
|
@ -855,10 +855,6 @@ async function maybeApplyHistoricSqlConfig(input: {
|
|||
enabled = choice === 'yes';
|
||||
}
|
||||
|
||||
if (dialect === 'postgres' && input.args.enableQueryHistory !== true && input.args.disableQueryHistory !== true) {
|
||||
return input.connection;
|
||||
}
|
||||
|
||||
const existingRecord = queryHistoryConfigRecord(input.connection) ?? historicSqlConfigRecord(input.connection) ?? {};
|
||||
const { dialect: _dialect, ...existing } = existingRecord;
|
||||
|
||||
|
|
@ -1474,7 +1470,11 @@ async function applyHistoricSqlConfigToExistingConnection(input: {
|
|||
args: KtxSetupDatabasesArgs;
|
||||
prompts: KtxSetupDatabasesPromptAdapter;
|
||||
}): Promise<'back' | void> {
|
||||
if (input.args.enableQueryHistory !== true && input.args.disableQueryHistory !== true) {
|
||||
if (
|
||||
input.args.inputMode === 'disabled' &&
|
||||
input.args.enableQueryHistory !== true &&
|
||||
input.args.disableQueryHistory !== true
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue