prostgles-server 2.0.240 → 2.0.241

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
@@ -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
  [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/prostgles/prostgles-server-js/blob/master/LICENSE)
7
6
  [![npm version](https://img.shields.io/npm/v/prostgles-server.svg?style=flat)](https://www.npmjs.com/package/prostgles-server)
@@ -9,6 +8,8 @@
9
8
  ![tests](https://github.com/prostgles/prostgles-server-js/workflows/tests/badge.svg?branch=master)
10
9
 
11
10
 
11
+ New: JSONB schema runtime validation and TS types
12
+ <img src="https://prostgles.com/tsdef2.png" width="100%%"/>
12
13
 
13
14
  ## Features
14
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prostgles-server",
3
- "version": "2.0.240",
3
+ "version": "2.0.241",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,19 +11,21 @@ prostgles<DBSchemaGenerated>({
11
11
  tableConfig: {
12
12
  user: {
13
13
  columns: {
14
- id: { sqlDefinition: `SERIAL PRIMARY KEY ` },
15
- email: { sqlDefinition: `TEXT NOT NULL` },
16
- status: { oneOf: ["active", "disabled", "pending"] },
17
- preferences: { defaultValue: "{}",
18
- jsonbSchema: {
19
- showIntro: { type: "boolean", optional: true },
20
- theme: { oneOf: ["light", "dark"], optional: true },
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.insert_rules.findOne()
28
+ const user = await db.users.findOne({ id: 123 });
29
+ // user.preferences.theme === ""
28
30
  }
29
31
  });