@dwtechs/antity-pgsql 0.3.1 โ 0.3.3
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 +8 -13
- package/dist/antity-pgsql.d.ts +2 -1
- package/dist/antity-pgsql.js +2 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@dwtechs/antity-pgsql)
|
|
4
4
|
[](https://www.npmjs.com/package/@dwtechs/antity-pgsql)
|
|
5
5
|

|
|
6
|
-
[](https://www.npmjs.com/package/@dwtechs/antity-pgsql)
|
|
7
6
|
|
|
8
7
|
- [Synopsis](#synopsis)
|
|
9
8
|
- [Support](#support)
|
|
10
9
|
- [Installation](#installation)
|
|
11
10
|
- [Usage](#usage)
|
|
12
|
-
- [ES6](#es6)
|
|
13
11
|
- [API Reference](#api-reference)
|
|
14
12
|
- [Contributors](#contributors)
|
|
15
13
|
- [Stack](#stack)
|
|
@@ -19,11 +17,10 @@
|
|
|
19
17
|
|
|
20
18
|
**[Antity-pgsql.js](https://github.com/DWTechs/Antity-pgsql.js)** adds PostgreSQL features to **Antity.js** library.
|
|
21
19
|
|
|
22
|
-
- Very lightweight
|
|
23
|
-
- Thoroughly tested
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
- Written in Typescript
|
|
20
|
+
- ๐ชถ Very lightweight
|
|
21
|
+
- ๐งช Thoroughly tested
|
|
22
|
+
- ๐ Shipped as EcmaScrypt module
|
|
23
|
+
- ๐ Written in Typescript
|
|
27
24
|
|
|
28
25
|
|
|
29
26
|
## Support
|
|
@@ -43,8 +40,6 @@ $ npm i @dwtechs/antity-pgsql
|
|
|
43
40
|
## Usage
|
|
44
41
|
|
|
45
42
|
|
|
46
|
-
### ES6 / TypeScript
|
|
47
|
-
|
|
48
43
|
```javascript
|
|
49
44
|
|
|
50
45
|
import { SQLEntity } from "@dwtechs/antity-pgsql";
|
|
@@ -117,8 +112,7 @@ const entity = new Entity("consumers", [
|
|
|
117
112
|
},
|
|
118
113
|
]);
|
|
119
114
|
|
|
120
|
-
|
|
121
|
-
router.gett("/", ..., entity.get);
|
|
115
|
+
router.get("/", ..., entity.get);
|
|
122
116
|
router.post("/", entity.normalize, entity.validate, ..., entity.add);
|
|
123
117
|
router.put("/", entity.normalize, entity.validate, ..., entity.update);
|
|
124
118
|
router.put("/", ..., entity.archive);
|
|
@@ -191,9 +185,9 @@ class SQLEntity {
|
|
|
191
185
|
|
|
192
186
|
function filter(
|
|
193
187
|
first: number,
|
|
194
|
-
rows: number,
|
|
188
|
+
rows: number | null,
|
|
195
189
|
sortField: string | null,
|
|
196
|
-
sortOrder: Sort
|
|
190
|
+
sortOrder: Sort | null,
|
|
197
191
|
filters: Filters | null,
|
|
198
192
|
): { filterClause: string, args: (Filter["value"])[] };
|
|
199
193
|
|
|
@@ -265,6 +259,7 @@ List of secondary types :
|
|
|
265
259
|
| jwt | string |
|
|
266
260
|
| symbol | string |
|
|
267
261
|
| email | string |
|
|
262
|
+
| password | string |
|
|
268
263
|
| regex | string |
|
|
269
264
|
| ipAddress | string |
|
|
270
265
|
| slug | string |
|
package/dist/antity-pgsql.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ https://github.com/DWTechs/Antity-pgsql.js
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
import { Entity, Property } from "@dwtechs/antity";
|
|
28
|
+
import { Type } from "@dwtechs/antity";
|
|
28
29
|
import type { Request, Response, NextFunction } from 'express';
|
|
29
30
|
|
|
30
31
|
export type Operation = "SELECT" | "INSERT" | "UPDATE" | "DELETE";
|
|
@@ -37,11 +38,11 @@ export type Filter = {
|
|
|
37
38
|
subProps?: string[];
|
|
38
39
|
matchMode?: MatchMode;
|
|
39
40
|
};
|
|
41
|
+
export { Type };
|
|
40
42
|
export type LogicalOperator = "AND" | "OR";
|
|
41
43
|
export type Comparator = "=" | "<" | ">" | "<=" | ">=" | "<>" | "IS" | "IS NOT" | "IN" | "LIKE" | "NOT LIKE";
|
|
42
44
|
export type MatchMode = "startsWith" | "endsWith" | "contains" | "notContains" | "equals" | "notEquals" | "between" | "in" | "lt" | "lte" | "gt" | "gte" | "is" | "isNot" | "before" | "after" | "st_contains" | "st_dwithin";
|
|
43
45
|
export type MappedType = "string" | "number" | "date";
|
|
44
|
-
export type Type = "boolean" | "string" | "number" | "integer" | "float" | "even" | "odd" | "positive" | "negative" | "powerOfTwo" | "ascii" | "array" | "jwt" | "symbol" | "email" | "regex" | "json" | "ipAddress" | "slug" | "hexadecimal" | "date" | "timestamp" | "function" | "htmlElement" | "htmlEventAttribute" | "node" | "object" | "geometry";
|
|
45
46
|
export type Geometry = {
|
|
46
47
|
lng: number;
|
|
47
48
|
lat: number;
|
package/dist/antity-pgsql.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dwtechs/antity-pgsql",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Open source library for easy entity management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"entities"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@dwtechs/checkard": "3.2.3",
|
|
40
40
|
"@dwtechs/winstan": "0.4.0",
|
|
41
|
-
"@dwtechs/antity": "0.
|
|
41
|
+
"@dwtechs/antity": "0.11.1",
|
|
42
42
|
"@dwtechs/sparray": "0.2.0",
|
|
43
43
|
"pg": "8.13.1"
|
|
44
44
|
},
|