mirror of
https://github.com/Kaelio/ktx.git
synced 2026-07-25 12:01:03 +02:00
refactor(mongo-query): forward the query input without re-listing fields
Now that KtxMongoQueryArgs extends KtxMongoQueryInput and the runner takes
that type, pass the args/input object straight through instead of rebuilding
it field by field. assertSafeConnectionId returns its input verbatim, so the
`{ ...input, connectionId }` spread was re-asserting an equal value.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ga2tvQ2YCEphmY8HM5Guzq
This commit is contained in:
parent
0e2e6c7d90
commit
bcfd562f18
2 changed files with 2 additions and 8 deletions
|
|
@ -16,7 +16,7 @@ export async function runMongoQuery(
|
|||
`Connection "${connectionId}" driver "${connector.driver}" is not a MongoDB connection; mongo_query serves mongodb connections only.`,
|
||||
);
|
||||
}
|
||||
return await connector.executeQuery({ ...input, connectionId }, { runId: 'mongo-query' });
|
||||
return await connector.executeQuery(input, { runId: 'mongo-query' });
|
||||
} finally {
|
||||
await connector?.cleanup?.();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,13 +42,7 @@ export async function runKtxMongoQuery(
|
|||
demoConnection = isDemoConnection(args.connectionId, connection);
|
||||
|
||||
const createScanConnector = deps.createScanConnector ?? createKtxCliScanConnector;
|
||||
const result = await runMongoQuery((connectionId) => createScanConnector(project!, connectionId), {
|
||||
connectionId: args.connectionId,
|
||||
collection: args.collection,
|
||||
database: args.database,
|
||||
pipeline: args.pipeline,
|
||||
limit: args.limit,
|
||||
});
|
||||
const result = await runMongoQuery((connectionId) => createScanConnector(project!, connectionId), args);
|
||||
|
||||
const output: KtxResultTable = {
|
||||
connectionId: args.connectionId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue