raw.d.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { entityKind } from "../../entity.js";
  2. import { QueryPromise } from "../../query-promise.js";
  3. import type { RunnableQuery } from "../../runnable-query.js";
  4. import type { PreparedQuery } from "../../session.js";
  5. import type { SQL, SQLWrapper } from "../../sql/sql.js";
  6. import type { SQLiteAsyncDialect } from "../dialect.js";
  7. type SQLiteRawAction = 'all' | 'get' | 'values' | 'run';
  8. export interface SQLiteRawConfig {
  9. action: SQLiteRawAction;
  10. }
  11. export interface SQLiteRaw<TResult> extends QueryPromise<TResult>, RunnableQuery<TResult, 'sqlite'>, SQLWrapper {
  12. }
  13. export declare class SQLiteRaw<TResult> extends QueryPromise<TResult> implements RunnableQuery<TResult, 'sqlite'>, SQLWrapper, PreparedQuery {
  14. execute: () => Promise<TResult>;
  15. private dialect;
  16. private mapBatchResult;
  17. static readonly [entityKind]: string;
  18. readonly _: {
  19. readonly dialect: 'sqlite';
  20. readonly result: TResult;
  21. };
  22. constructor(execute: () => Promise<TResult>,
  23. /** @internal */
  24. getSQL: () => SQL, action: SQLiteRawAction, dialect: SQLiteAsyncDialect, mapBatchResult: (result: unknown) => unknown);
  25. getQuery(): {
  26. method: SQLiteRawAction;
  27. typings?: import("../../sql/sql.js").QueryTypingsValue[];
  28. sql: string;
  29. params: unknown[];
  30. };
  31. mapResult(result: unknown, isFromBatch?: boolean): unknown;
  32. _prepare(): PreparedQuery;
  33. }
  34. export {};