prostgles-client 4.0.8 → 4.0.10

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/typeTests.js CHANGED
@@ -1,12 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const dbo = 1;
4
- const filter = {};
5
- const filterCheck = (f) => { };
6
- filterCheck(filter);
7
- const sub = dbo.table1.count;
8
- const f = (a) => { };
9
- // f(dbo.table1)
10
- const ra = (a) => {
11
- };
12
- // const dboBasic: DBHandlerClient = dbo;
3
+ (async () => {
4
+ var _a, _b;
5
+ const dbo = 1;
6
+ const filter = {};
7
+ const filterCheck = (f) => { };
8
+ filterCheck(filter);
9
+ const sub = dbo.table1.count;
10
+ const f = (a) => { };
11
+ // f(dbo.table1)
12
+ const ra = (a) => {
13
+ };
14
+ const dbH = 1;
15
+ dbH.dwadwa.findOne({ "name.@@.to_tsquery": ["abc81"] }, { select: {
16
+ h: { "$ts_headline_simple": ["name", { plainto_tsquery: "abc81" }] },
17
+ hh: { "$ts_headline": ["name", "abc81"] },
18
+ added: "$date_trunc_2hour",
19
+ addedY: { "$date_trunc_5minute": ["added"] }
20
+ } });
21
+ (_b = (_a = dbH.d).find) === null || _b === void 0 ? void 0 : _b.call(_a, {}, {
22
+ select: { id: 1, name: 1, items3: { name: "$upper" } }
23
+ });
24
+ // const dboBasic: DBHandlerClient = dbo;
25
+ });
package/lib/typeTests.ts CHANGED
@@ -1,36 +1,52 @@
1
- import { AnyObject, DBSchema, FullFilter, TableHandler } from "prostgles-types";
2
- import { DBHandlerClient } from "./prostgles";
3
-
4
-
5
- // const schema: DBSchema = {
6
- type GeneratedSchema = {
7
- table1: {
8
- columns: {
9
- col1: string,
10
- },
11
- is_view: false,
12
- select: true,
13
- insert: true,
14
- update: true,
15
- delete: true,
16
- }
17
- };
18
-
19
- const dbo: DBHandlerClient<GeneratedSchema> = 1 as any;
20
-
21
- const filter: FullFilter<GeneratedSchema["table1"]["columns"], GeneratedSchema> = { };
22
-
23
- const filterCheck = <F extends FullFilter<void, void> | undefined>(f: F) => {};
24
- filterCheck(filter);
25
-
26
- const sub: TableHandler["count"] = dbo.table1.count
27
-
28
- const f = <A extends TableHandler>(a: A) => {};
29
-
30
- // f(dbo.table1)
31
- const ra = <A extends AnyObject>(a: A) => {
32
-
33
- };
34
-
35
-
36
- // const dboBasic: DBHandlerClient = dbo;
1
+ import { AnyObject, DBSchema, FullFilter, Select, TableHandler } from "prostgles-types";
2
+ import { DBHandlerClient, TableHandlerClient } from "./prostgles";
3
+
4
+ (async () => {
5
+ // const schema: DBSchema = {
6
+ type GeneratedSchema = {
7
+ table1: {
8
+ columns: {
9
+ col1: string,
10
+ },
11
+ is_view: false,
12
+ select: true,
13
+ insert: true,
14
+ update: true,
15
+ delete: true,
16
+ }
17
+ };
18
+
19
+ const dbo: DBHandlerClient<GeneratedSchema> = 1 as any;
20
+
21
+ const filter: FullFilter<GeneratedSchema["table1"]["columns"], GeneratedSchema> = { };
22
+
23
+ const filterCheck = <F extends FullFilter<void, void> | undefined>(f: F) => {};
24
+ filterCheck(filter);
25
+
26
+ const sub: TableHandler["count"] = dbo.table1.count
27
+
28
+ const f = <A extends TableHandler>(a: A) => {};
29
+
30
+ // f(dbo.table1)
31
+ const ra = <A extends AnyObject>(a: A) => {
32
+
33
+ };
34
+
35
+ const dbH: DBHandlerClient = 1 as any;
36
+
37
+ dbH.dwadwa.findOne!(
38
+ { "name.@@.to_tsquery": ["abc81"] },
39
+ { select: {
40
+ h: { "$ts_headline_simple": ["name", { plainto_tsquery: "abc81" }] },
41
+ hh: { "$ts_headline": ["name", "abc81"] } ,
42
+ added: "$date_trunc_2hour",
43
+ addedY: { "$date_trunc_5minute": ["added"] }
44
+ }});
45
+
46
+ dbH.d.find?.({}, {
47
+
48
+ select: { id: 1, name: 1, items3: { name: "$upper" } }
49
+ })
50
+ // const dboBasic: DBHandlerClient = dbo;
51
+
52
+ })
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "prostgles-client",
3
- "version": "4.0.8",
3
+ "version": "4.0.10",
4
4
  "description": "Reactive client for Postgres",
5
5
  "main": "dist/prostgles-full.js",
6
6
  "types": "dist/prostgles-full.d.ts",
7
7
  "dependencies": {
8
- "prostgles-types": "^4.0.12"
8
+ "prostgles-types": "^4.0.14"
9
9
  },
10
10
  "devDependencies": {
11
11
  "@types/node": "^14.14.14",