@graffy/pg 0.19.0 → 0.19.1-alpha.2
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/{types/Db.d.ts → Db.d.ts} +3 -3
- package/Db.js +236 -0
- package/filter/filterObject.js +39 -0
- package/filter/getAst.js +154 -0
- package/filter/getSql.js +100 -0
- package/filter/index.d.ts +2 -0
- package/index.d.ts +8 -0
- package/index.js +71 -0
- package/package.json +15 -9
- package/sql/clauses.d.ts +12 -0
- package/sql/clauses.js +224 -0
- package/sql/format.d.ts +5 -0
- package/sql/format.js +36 -0
- package/sql/getArgSql.d.ts +34 -0
- package/sql/getArgSql.js +82 -0
- package/sql/getMeta.d.ts +12 -0
- package/sql/getMeta.js +11 -0
- package/sql/index.d.ts +2 -0
- package/sql/select.d.ts +2 -0
- package/sql/select.js +41 -0
- package/sql/upsert.d.ts +3 -0
- package/sql/upsert.js +73 -0
- package/index.cjs +0 -996
- package/index.mjs +0 -996
- package/types/index.d.ts +0 -13
- package/types/sql/clauses.d.ts +0 -12
- package/types/sql/format.d.ts +0 -5
- package/types/sql/getArgSql.d.ts +0 -28
- package/types/sql/getMeta.d.ts +0 -12
- package/types/sql/select.d.ts +0 -2
- package/types/sql/upsert.d.ts +0 -3
- /package/{types/filter → filter}/filterObject.d.ts +0 -0
- /package/{types/filter → filter}/getAst.d.ts +0 -0
- /package/{types/filter → filter}/getSql.d.ts +0 -0
- /package/{types/filter/index.d.ts → filter/index.js} +0 -0
- /package/{types/sql/index.d.ts → sql/index.js} +0 -0
package/types/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export function pg({ connection, ...rawOptions }: Partial<TableOpts> & {
|
|
2
|
-
connection: any;
|
|
3
|
-
}): Function;
|
|
4
|
-
export type TableOpts = {
|
|
5
|
-
table: string;
|
|
6
|
-
idCol: string;
|
|
7
|
-
verCol: string;
|
|
8
|
-
joins: Record<string, Partial<TableOpts> & {
|
|
9
|
-
refCol: string;
|
|
10
|
-
}>;
|
|
11
|
-
schema?: any;
|
|
12
|
-
verDefault?: string;
|
|
13
|
-
};
|
package/types/sql/clauses.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export function cubeLiteralSql(value: any): Sql;
|
|
2
|
-
export function getJsonBuildTrusted(variadic: any): Sql;
|
|
3
|
-
export function lookup(prop: any, options: any): Sql;
|
|
4
|
-
export function lookupNumeric(prop: any): Sql;
|
|
5
|
-
export function getSelectCols(options: any, projection?: any): Sql;
|
|
6
|
-
export function getInsert(rows: any, options: any): {
|
|
7
|
-
cols: Sql;
|
|
8
|
-
vals: Sql;
|
|
9
|
-
updates: Sql;
|
|
10
|
-
};
|
|
11
|
-
export function getUpdates(row: any, options: any): Sql;
|
|
12
|
-
import { Sql } from 'sql-template-tag';
|
package/types/sql/format.d.ts
DELETED
package/types/sql/getArgSql.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Uses the args object (typically passed in the $key attribute)
|
|
3
|
-
|
|
4
|
-
@param {object} args
|
|
5
|
-
@param {{prefix: string, idCol: string, verDefault: string, schema: { types: Record<string, any> } }} options
|
|
6
|
-
|
|
7
|
-
@typedef { import('sql-template-tag').Sql } Sql
|
|
8
|
-
@return {{ meta: Sql, where: Sql[], order?: Sql, group?: Sql, limit: number, ensureSingleRow: boolean }}
|
|
9
|
-
*/
|
|
10
|
-
export default function getArgSql({ $first, $last, $after, $before, $since, $until, $all, $cursor: _, ...rest }: object, options: {
|
|
11
|
-
prefix: string;
|
|
12
|
-
idCol: string;
|
|
13
|
-
verDefault: string;
|
|
14
|
-
schema: {
|
|
15
|
-
types: Record<string, any>;
|
|
16
|
-
};
|
|
17
|
-
}): {
|
|
18
|
-
meta: Sql;
|
|
19
|
-
where: Sql[];
|
|
20
|
-
order?: Sql;
|
|
21
|
-
group?: Sql;
|
|
22
|
-
limit: number;
|
|
23
|
-
ensureSingleRow: boolean;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Uses the args object (typically passed in the $key attribute)
|
|
27
|
-
*/
|
|
28
|
-
export type Sql = import("sql-template-tag").Sql;
|
package/types/sql/getMeta.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export function getIdMeta({ idCol, verDefault }: {
|
|
2
|
-
idCol: any;
|
|
3
|
-
verDefault: any;
|
|
4
|
-
}): import("sql-template-tag").Sql;
|
|
5
|
-
export function getArgMeta(key: any, { prefix, idCol, verDefault }: {
|
|
6
|
-
prefix: any;
|
|
7
|
-
idCol: any;
|
|
8
|
-
verDefault: any;
|
|
9
|
-
}): import("sql-template-tag").Sql;
|
|
10
|
-
export function getAggMeta(key: any, { verDefault }: {
|
|
11
|
-
verDefault: any;
|
|
12
|
-
}): import("sql-template-tag").Sql;
|
package/types/sql/select.d.ts
DELETED
package/types/sql/upsert.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|