@carllee1983/dbcli 1.41.0 → 1.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.d.ts CHANGED
@@ -250,6 +250,7 @@ interface QueryableAdapter {
250
250
  execute<T>(query: string, params?: unknown[], options?: {
251
251
  limit?: number;
252
252
  noLimit?: boolean;
253
+ projection?: Record<string, 0 | 1>;
253
254
  }): Promise<ExecutionResult<T>>;
254
255
  /**
255
256
  * List all collections in the connected database
@@ -493,6 +494,12 @@ interface DbcliConfig {
493
494
  metadata?: Metadata;
494
495
  blacklist?: BlacklistConfig;
495
496
  }
497
+ interface AppliedLimitMetadata {
498
+ /** True only when the caller fetched and removed an additional row. */
499
+ truncated: boolean;
500
+ /** User-facing row limit, never the internal lookahead size. */
501
+ limitApplied: number;
502
+ }
496
503
  type SqlStatementType = "SELECT" | "INSERT" | "UPDATE" | "DELETE" | "UNKNOWN";
497
504
  interface QueryMetadata {
498
505
  /** SQL statement type (SELECT, INSERT, UPDATE, DELETE) */
@@ -534,6 +541,8 @@ export interface QueryResult<T> {
534
541
  executionTimeMs?: number;
535
542
  /** Optional: metadata about query type and affected rows */
536
543
  metadata?: QueryMetadata;
544
+ /** Internal row-limit proof, mapped into public JSON metadata by the formatter. */
545
+ appliedLimit?: AppliedLimitMetadata;
537
546
  }
538
547
  /**
539
548
  * Manager class for loading and querying blacklist rules.
@@ -2554,6 +2563,13 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2554
2563
  schemas?: Record<string, Record<string, any>> | undefined;
2555
2564
  }>;
2556
2565
  export type DbcliConfigV2 = z.infer<typeof DbcliConfigV2Schema>;
2566
+ type FieldSelection = {
2567
+ mode: "include";
2568
+ paths: readonly string[];
2569
+ } | {
2570
+ mode: "exclude";
2571
+ paths: readonly string[];
2572
+ };
2557
2573
  /**
2558
2574
  * QueryExecutor class for executing SQL queries with permission checks
2559
2575
  */
@@ -2563,9 +2579,14 @@ export declare class QueryExecutor {
2563
2579
  private blacklistValidator?;
2564
2580
  private config?;
2565
2581
  private options;
2582
+ private pendingDiagnostics;
2566
2583
  constructor(adapter: DatabaseAdapter, permission: Permission, blacklistValidator?: BlacklistValidator | undefined, config?: DbcliConfig$1 | undefined, options?: {
2567
2584
  config?: string;
2585
+ connectionName?: string;
2586
+ recovery?: boolean;
2587
+ deferDiagnostics?: boolean;
2568
2588
  });
2589
+ takeDiagnostics(): string[];
2569
2590
  /**
2570
2591
  * Execute a SQL query with permission enforcement and error handling
2571
2592
  *
@@ -2579,6 +2600,8 @@ export declare class QueryExecutor {
2579
2600
  execute(sql: string, options?: {
2580
2601
  autoLimit?: boolean;
2581
2602
  limitValue?: number;
2603
+ detectTruncation?: boolean;
2604
+ fieldSelection?: FieldSelection;
2582
2605
  }): Promise<QueryResult<Record<string, unknown>>>;
2583
2606
  }
2584
2607
  /**