rado 0.2.33 → 0.2.35

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/README.md CHANGED
@@ -3,8 +3,6 @@
3
3
  Fully typed, lightweight TypeScript query builder.
4
4
  Currently focused on SQLite.
5
5
 
6
- <pre>npm install <a href="https://www.npmjs.com/package/rado">rado</a></pre>
7
-
8
6
  - Definition via TypeScript types
9
7
  - Composable queries
10
8
  - Aggregate rows in selects
@@ -12,6 +10,8 @@ Currently focused on SQLite.
12
10
  - No code generation step
13
11
  - No dependencies
14
12
 
13
+ <pre>npm install <a href="https://www.npmjs.com/package/rado">rado</a></pre>
14
+
15
15
  ## Queries
16
16
 
17
17
  #### Where
@@ -1,3 +1,4 @@
1
+ import type { Column } from './Column.js';
1
2
  import type { Expr } from './Expr.js';
2
3
  import type { Select, SelectFirst } from './query/Select.js';
3
4
  type SelectionBase = unknown | (() => any) | Expr<any> | Select<any> | SelectFirst<any>;
@@ -11,7 +12,7 @@ export declare namespace Selection {
11
12
  [TableType](): infer K;
12
13
  } ? K : T extends {
13
14
  [CursorType](): infer K;
14
- } ? K : T extends Expr<infer K> ? K : T extends Record<string, Selection> ? {
15
+ } ? K : T extends Expr<infer K> ? K : T extends Column<infer K> ? K : T extends Record<string, Selection> ? {
15
16
  [K in keyof T]: Infer<T[K]>;
16
17
  } : T extends () => any ? never : unknown extends T ? never : T;
17
18
  type With<A, B> = Expr<Combine<A, B>>;
@@ -1,4 +1,4 @@
1
- import { ClearFunctionProto } from '../util/Callable.js';
1
+ import { Callable } from '../util/Callable.js';
2
2
  import { Column, ColumnData, OptionalColumn, PrimaryColumn } from './Column.js';
3
3
  import { EV, Expr } from './Expr.js';
4
4
  import type { Fields } from './Fields.js';
@@ -18,7 +18,7 @@ export declare class TableData {
18
18
  };
19
19
  constructor(data: TableData);
20
20
  }
21
- export interface TableInstance<Definition> extends ClearFunctionProto {
21
+ export interface TableInstance<Definition> extends Callable {
22
22
  (conditions: {
23
23
  [K in keyof Definition]?: Definition[K] extends Expr<infer V> ? EV<V> : never;
24
24
  }): TableSelect<Definition>;
@@ -1,4 +1,4 @@
1
- import { ClearFunctionProto } from '../util/Callable.js';
1
+ import { Callable } from '../util/Callable.js';
2
2
  import { Column } from './Column.js';
3
3
  import { EV, Expr } from './Expr.js';
4
4
  import { Fields } from './Fields.js';
@@ -6,7 +6,7 @@ import { Selection } from './Selection.js';
6
6
  import { Table } from './Table.js';
7
7
  import { Target } from './Target.js';
8
8
  import { Select } from './query/Select.js';
9
- export interface VirtualTableInstance<Definition> extends ClearFunctionProto {
9
+ export interface VirtualTableInstance<Definition> extends Callable {
10
10
  (conditions: {
11
11
  [K in keyof Definition]?: Definition[K] extends Expr<infer V> ? EV<V> : never;
12
12
  }): Select<Table.Select<Definition>>;
package/dist/index.d.ts CHANGED
@@ -14,6 +14,14 @@ export * from './define/Sql.js';
14
14
  export * from './define/Table.js';
15
15
  export * from './define/Target.js';
16
16
  export * from './define/VirtualTable.js';
17
+ export * from './define/query/Batch.js';
18
+ export * from './define/query/CreateTable.js';
19
+ export * from './define/query/Delete.js';
20
+ export * from './define/query/Insert.js';
21
+ export * from './define/query/Select.js';
22
+ export * from './define/query/TableSelect.js';
23
+ export * from './define/query/Union.js';
24
+ export * from './define/query/Update.js';
17
25
  export type { Driver } from './lib/Driver.js';
18
26
  export type { FormatContext, Formatter } from './lib/Formatter.js';
19
27
  export type { Sanitizer } from './lib/Sanitizer.js';
package/dist/index.js CHANGED
@@ -11,4 +11,12 @@ export * from "./define/Sql.js";
11
11
  export * from "./define/Table.js";
12
12
  export * from "./define/Target.js";
13
13
  export * from "./define/VirtualTable.js";
14
+ export * from "./define/query/Batch.js";
15
+ export * from "./define/query/CreateTable.js";
16
+ export * from "./define/query/Delete.js";
17
+ export * from "./define/query/Insert.js";
18
+ export * from "./define/query/Select.js";
19
+ export * from "./define/query/TableSelect.js";
20
+ export * from "./define/query/Union.js";
21
+ export * from "./define/query/Update.js";
14
22
  export * from "./lib/SqlError.js";
@@ -1,11 +1,16 @@
1
1
  export declare class Callable {
2
2
  constructor(fn: Function);
3
3
  }
4
- export declare class ClearFunctionProto {
4
+ declare class ClearFunctionProto {
5
5
  get name(): unknown;
6
6
  get length(): unknown;
7
7
  get call(): unknown;
8
+ get caller(): unknown;
8
9
  get apply(): unknown;
9
10
  get bind(): unknown;
10
11
  get prototype(): unknown;
12
+ get arguments(): unknown;
11
13
  }
14
+ export interface Callable extends ClearFunctionProto {
15
+ }
16
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rado",
3
- "version": "0.2.33",
3
+ "version": "0.2.35",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,6 +29,9 @@
29
29
  ],
30
30
  "sqlite": [
31
31
  "dist/sqlite.d.ts"
32
+ ],
33
+ "util/*": [
34
+ "dist/util/*.d.ts"
32
35
  ]
33
36
  }
34
37
  },