@graffy/pg 0.15.8-alpha.3 → 0.15.8-alpha.4
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/package.json +4 -4
- package/types/Db.d.ts +9 -0
- package/types/filter/filterObject.d.ts +1 -0
- package/types/filter/getAst.d.ts +1 -0
- package/types/filter/getSql.d.ts +1 -0
- package/types/filter/index.d.ts +2 -0
- package/types/index.d.ts +7 -0
- package/types/link/index.d.ts +3 -0
- package/types/sql/clauses.d.ts +8 -0
- package/types/sql/getArgSql.d.ts +19 -0
- package/types/sql/getMeta.d.ts +4 -0
- package/types/sql/index.d.ts +2 -0
- package/types/sql/select.d.ts +2 -0
- package/types/sql/upsert.d.ts +2 -0
- package/index.d.ts +0 -87
package/package.json
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"name": "@graffy/pg",
|
|
3
3
|
"description": "The standard Postgres module for Graffy. Each instance this module mounts a Postgres table as a Graffy subtree.",
|
|
4
4
|
"author": "aravind (https://github.com/aravindet)",
|
|
5
|
-
"version": "0.15.8-alpha.
|
|
5
|
+
"version": "0.15.8-alpha.4",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"exports": {
|
|
8
8
|
"import": "./index.mjs",
|
|
9
9
|
"require": "./index.cjs"
|
|
10
10
|
},
|
|
11
11
|
"module": "./index.mjs",
|
|
12
|
-
"types": "./index.d.ts",
|
|
12
|
+
"types": "./types/index.d.ts",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git+https://github.com/usegraffy/graffy.git"
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"pg": "^8.7.1",
|
|
20
|
-
"@graffy/common": "0.15.8-alpha.
|
|
21
|
-
"@graffy/testing": "0.15.8-alpha.
|
|
20
|
+
"@graffy/common": "0.15.8-alpha.4",
|
|
21
|
+
"@graffy/testing": "0.15.8-alpha.4",
|
|
22
22
|
"debug": "^4.3.2",
|
|
23
23
|
"sql-template-tag": "^4.0.0"
|
|
24
24
|
}
|
package/types/Db.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default class Db {
|
|
2
|
+
constructor(connection: any);
|
|
3
|
+
client: any;
|
|
4
|
+
query(sql: any): Promise<any>;
|
|
5
|
+
readSql(sql: any): Promise<any>;
|
|
6
|
+
writeSql(sql: any): Promise<any>;
|
|
7
|
+
read(rootQuery: any, tableOptions: any): Promise<any>;
|
|
8
|
+
write(rootChange: any, tableOptions: any): Promise<any[]>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function filterObject(filter: any, object: any): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getAst(filter: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getSql(filter: any, getLookupSql: any): any;
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const nowTimestamp: import("sql-template-tag").Sql;
|
|
2
|
+
export function getJsonBuildObject(variadic: any): import("sql-template-tag").Sql;
|
|
3
|
+
export function getSelectCols(table: any): import("sql-template-tag").Sql;
|
|
4
|
+
export function getInsert(row: any, options: any): {
|
|
5
|
+
cols: import("sql-template-tag").Sql;
|
|
6
|
+
vals: import("sql-template-tag").Sql;
|
|
7
|
+
};
|
|
8
|
+
export function getUpdates(row: any, options: any): import("sql-template-tag").Sql;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Uses the args object (typically passed in the $key attribute)
|
|
3
|
+
|
|
4
|
+
@param {object} args
|
|
5
|
+
@param {object} options
|
|
6
|
+
|
|
7
|
+
@typedef { import('sql-template-tag').Sql } Sql
|
|
8
|
+
@return {{ meta: Sql, where: Sql[], order?: Sql, limit: number }}
|
|
9
|
+
*/
|
|
10
|
+
export default function getArgSql({ $first, $last, $after, $before, $since, $until, $all, $cursor: _, ...rest }: object, options: object): {
|
|
11
|
+
meta: Sql;
|
|
12
|
+
where: Sql[];
|
|
13
|
+
order?: Sql;
|
|
14
|
+
limit: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Uses the args object (typically passed in the $key attribute)
|
|
18
|
+
*/
|
|
19
|
+
export type Sql = import('sql-template-tag').Sql;
|
package/index.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
declare module "link/index" {
|
|
2
|
-
export function linkResult(objects: any, query: any, { links: linkSpecs }: {
|
|
3
|
-
links: any;
|
|
4
|
-
}): any[];
|
|
5
|
-
}
|
|
6
|
-
declare module "filter/getAst" {
|
|
7
|
-
export default function getAst(filter: any): any;
|
|
8
|
-
}
|
|
9
|
-
declare module "filter/filterObject" {
|
|
10
|
-
export default function filterObject(filter: any, object: any): boolean;
|
|
11
|
-
}
|
|
12
|
-
declare module "filter/getSql" {
|
|
13
|
-
export default function getSql(filter: any, getLookupSql: any): any;
|
|
14
|
-
}
|
|
15
|
-
declare module "filter/index" {
|
|
16
|
-
export { default as filterObject } from "./filterObject.js";
|
|
17
|
-
export { default as getFilterSql } from "./getSql.js";
|
|
18
|
-
}
|
|
19
|
-
declare module "sql/clauses" {
|
|
20
|
-
export const nowTimestamp: import("sql-template-tag").Sql;
|
|
21
|
-
export function getJsonBuildObject(variadic: any): import("sql-template-tag").Sql;
|
|
22
|
-
export function getSelectCols(table: any): import("sql-template-tag").Sql;
|
|
23
|
-
export function getInsert(row: any, options: any): {
|
|
24
|
-
cols: import("sql-template-tag").Sql;
|
|
25
|
-
vals: import("sql-template-tag").Sql;
|
|
26
|
-
};
|
|
27
|
-
export function getUpdates(row: any, options: any): import("sql-template-tag").Sql;
|
|
28
|
-
}
|
|
29
|
-
declare module "sql/getMeta" {
|
|
30
|
-
export function getIdMeta({ idCol }: {
|
|
31
|
-
idCol: any;
|
|
32
|
-
}): import("sql-template-tag").Sql;
|
|
33
|
-
export function getArgMeta(key: any, prefix: any, idCol: any): import("sql-template-tag").Sql;
|
|
34
|
-
}
|
|
35
|
-
declare module "sql/getArgSql" {
|
|
36
|
-
/**
|
|
37
|
-
Uses the args object (typically passed in the $key attribute)
|
|
38
|
-
|
|
39
|
-
@param {object} args
|
|
40
|
-
@param {object} options
|
|
41
|
-
|
|
42
|
-
@typedef { import('sql-template-tag').Sql } Sql
|
|
43
|
-
@return {{ meta: Sql, where: Sql[], order?: Sql, limit: number }}
|
|
44
|
-
*/
|
|
45
|
-
export default function getArgSql({ $first, $last, $after, $before, $since, $until, $all, $cursor: _, ...rest }: object, options: object): {
|
|
46
|
-
meta: Sql;
|
|
47
|
-
where: Sql[];
|
|
48
|
-
order?: Sql;
|
|
49
|
-
limit: number;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Uses the args object (typically passed in the $key attribute)
|
|
53
|
-
*/
|
|
54
|
-
export type Sql = import("../../node_modules/sql-template-tag/dist/index").Sql;
|
|
55
|
-
}
|
|
56
|
-
declare module "sql/select" {
|
|
57
|
-
export function selectByArgs(args: any, options: any): import("sql-template-tag").Sql;
|
|
58
|
-
export function selectByIds(ids: any, options: any): import("sql-template-tag").Sql;
|
|
59
|
-
}
|
|
60
|
-
declare module "sql/upsert" {
|
|
61
|
-
export function patch(object: any, arg: any, options: any): import("sql-template-tag").Sql;
|
|
62
|
-
export function put(object: any, arg: any, options: any): import("sql-template-tag").Sql;
|
|
63
|
-
}
|
|
64
|
-
declare module "sql/index" {
|
|
65
|
-
export * from "sql/select";
|
|
66
|
-
export * from "sql/upsert";
|
|
67
|
-
}
|
|
68
|
-
declare module "Db" {
|
|
69
|
-
export default class Db {
|
|
70
|
-
constructor(connection: any);
|
|
71
|
-
client: any;
|
|
72
|
-
query(sql: any): Promise<any>;
|
|
73
|
-
readSql(sql: any): Promise<any>;
|
|
74
|
-
writeSql(sql: any): Promise<any>;
|
|
75
|
-
read(rootQuery: any, tableOptions: any): Promise<any>;
|
|
76
|
-
write(rootChange: any, tableOptions: any): Promise<any[]>;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
declare module "index" {
|
|
80
|
-
export function pg({ table, idCol, verCol, links, connection }: {
|
|
81
|
-
table: any;
|
|
82
|
-
idCol: any;
|
|
83
|
-
verCol: any;
|
|
84
|
-
links: any;
|
|
85
|
-
connection: any;
|
|
86
|
-
}): (store: any) => void;
|
|
87
|
-
}
|