prostgles-server 2.0.240 → 2.0.243
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 +3 -2
- package/package.json +1 -1
- package/tests/server/server.ts +11 -9
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# prostgles-server
|
|
2
2
|
|
|
3
|
-
Isomorphic PostgreSQL client for [node](http://nodejs.org)
|
|
4
|
-
TypeScript, pg-promise, Socket.IO
|
|
3
|
+
Isomorphic PostgreSQL client for [node](http://nodejs.org)
|
|
5
4
|
|
|
6
5
|
[](https://github.com/prostgles/prostgles-server-js/blob/master/LICENSE)
|
|
7
6
|
[](https://www.npmjs.com/package/prostgles-server)
|
|
@@ -9,6 +8,8 @@
|
|
|
9
8
|

|
|
10
9
|
|
|
11
10
|
|
|
11
|
+
New: JSONB schema runtime validation and TS types
|
|
12
|
+
<img src="https://prostgles.com/tsdef2.png" width="33%"/>
|
|
12
13
|
|
|
13
14
|
## Features
|
|
14
15
|
|
package/package.json
CHANGED
package/tests/server/server.ts
CHANGED
|
@@ -11,19 +11,21 @@ prostgles<DBSchemaGenerated>({
|
|
|
11
11
|
tableConfig: {
|
|
12
12
|
user: {
|
|
13
13
|
columns: {
|
|
14
|
-
id:
|
|
15
|
-
email:
|
|
16
|
-
status:
|
|
17
|
-
preferences:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
id: { sqlDefinition: `SERIAL PRIMARY KEY ` },
|
|
15
|
+
email: { sqlDefinition: `TEXT NOT NULL` },
|
|
16
|
+
status: { oneOf: ["active", "disabled", "pending"] },
|
|
17
|
+
preferences: {
|
|
18
|
+
defaultValue: "{}",
|
|
19
|
+
jsonbSchema: {
|
|
20
|
+
showIntro: { type: "boolean", optional: true },
|
|
21
|
+
theme: { oneOf: ["light", "dark"], optional: true },
|
|
22
|
+
}
|
|
22
23
|
},
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
27
|
onReady: async (db) => {
|
|
27
|
-
db.
|
|
28
|
+
const user = await db.users.findOne({ id: 123 });
|
|
29
|
+
// user.preferences.theme === ""
|
|
28
30
|
}
|
|
29
31
|
});
|