uranio 0.1.35 → 0.1.37

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.
@@ -28,6 +28,6 @@
28
28
  "typescript": "^5.2.2"
29
29
  },
30
30
  "dependencies": {
31
- "uranio": "0.1.35"
31
+ "uranio": "0.1.37"
32
32
  }
33
33
  }
package/README.md CHANGED
@@ -2,10 +2,14 @@
2
2
 
3
3
  ![uranio logo](./img/uranio_logo_1440x220.png)
4
4
 
5
- Uranio is a Typescript Object Document Mapper (ODM) for MongoDB.\
6
- It creates a client for querying collections in a database by just parsing
5
+ Uranio is the lighest Typescript Object Document Mapper (ODM) for MongoDB and
6
+ Object Relational Mapping (ORM) for MySQL.\
7
+ It creates a client for querying collections/tabls in a database by just parsing
7
8
  the types in a repository.
8
9
 
10
+ It is the simplest and fastest way to query a database without the need to build
11
+ a Data Access Layer (DAL) from the defined types.
12
+
9
13
  ## Install
10
14
 
11
15
  ```
@@ -15,8 +19,10 @@ yarn add uranio
15
19
  ## How it works
16
20
 
17
21
  Run:
18
- ```
19
- uranio generate
22
+ ```bash
23
+ uranio generate -d mondodb
24
+ // or
25
+ uranio generate -d mysql
20
26
  ```
21
27
 
22
28
  The above command search for all interfaces in your repository that extends
@@ -57,21 +63,10 @@ await urn.products.put_item({
57
63
  });
58
64
  ```
59
65
 
60
- ### Uranio types
61
-
62
- You can use uranio types to better define the schema of your collections.\
63
- For example:
64
-
65
- ```typescript
66
- interface Customer extends uranio.atom {
67
- email: uranio.unique<string>;
68
- }
69
- ```
70
-
71
- ### Primary index `_id`
66
+ ### Primary index `_id` for MongoDB
72
67
 
73
- When extending an interface with `uranio.atom` this add a primary index
74
- attribute `_id` to the interface, so there is no need to add it manually.
68
+ When extending an interface with `uranio.atom` (MongoDB) this add a primary
69
+ index attribute `_id` to the interface, so there is no need to add it manually.
75
70
 
76
71
  ```typescript
77
72
  import uranio from 'uranio';
package/dist/bin.js CHANGED
@@ -65,8 +65,9 @@ function _handle_exception_wrapper(fn, ...args) {
65
65
  if (err instanceof exception.UranioCLIException &&
66
66
  err.family === 'UranioCLIException') {
67
67
  index_1.log.error(err.message);
68
+ process.exit(1);
68
69
  }
69
- process.exit(1);
70
+ throw err;
70
71
  }
71
72
  };
72
73
  }
package/dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,8CAAsB;AACtB,2CAAoC;AACpC,iEAAmD;AACnD,wDAA8B;AAE9B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,yBAAyB,CAAC,eAAG,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CACtD,KAAK,EAAE,kBAAkB,EAAE,EAAE;IAC3B,KAAK,UAAU,cAAc,CAAC,IAAmB;;QAC/C,IAAI,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,OAAO,MAAK,IAAI,EAAE,CAAC;YACjC,WAAG,CAAC,MAAM,CAAC,SAAS,GAAG,aAAG,CAAC,SAAS,CAAC,KAAK,CAAC;YAC3C,OAAO;QACT,CAAC;QACD,WAAG,CAAC,MAAM,CAAC,SAAS,GAAG,aAAG,CAAC,SAAS,CAAC,IAAI,CAAC;IAC5C,CAAC;IACD,KAAK,UAAU,YAAY,CAAC,IAAmB;QAC7C,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;YACrB,KAAK,UAAU,CAAC,CAAC,CAAC;gBAChB,MAAM,eAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBACzB,MAAM;YACR,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACR,MAAM,eAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACxB,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,yBAAyB,CAAC,cAAc,E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C;IACD,KAAK,UAAU,YAAY,CAAC,IAAmB;QAC7C,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;YACrB,KAAK,UAAU,CAAC,CAAC,CAAC;gBAChB,MAAM,eAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBACzB,MAAM;YACR,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACR,MAAM,eAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACxB,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,yBAAyB,CAAC,cAAc,EAAE,kBAAkB,CAAC,EAAE,CAAC;IACtE,MAAM,yBAAyB,CAAC,YAAY,EAAE,kBAAkB,CAAC,EAAE,CAAC;AACtE,CAAC,CACF,CAAC;AAEF,SAAS,yBAAyB,CAAC,EAAyB,EAAE,GAAG,IAAS;IACxE,OAAO,KAAK,IAAI,EAAE;QAChB,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IACE,GAAG,YAAY,SAAS,CAAC,kBAAkB;gBAC3C,GAAG,CAAC,MAAM,KAAK,oBAAoB,EACnC,CAAC;gBACD,WAAG,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,MAAM,GAAG,CAAA;QACX,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uranio",
3
- "version": "0.1.35",
3
+ "version": "0.1.37",
4
4
  "description": "Uranio is a type-safe ODM for MongoDB",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -25,7 +25,7 @@
25
25
  "dev": "yarn tsc -w",
26
26
  "dev:base": "node ./dist/index.js",
27
27
  "dev:bin": "node ./dist/bin.js generate --root ~/repos/uranio/builder",
28
- "dev:bin:verbose": "node ./dist/bin.js generate -v -d mysql --root ~/repos/uranio/builder",
28
+ "dev:bin:verbose": "node ./dist/bin.js generate -v -d mysql --root ~/repos/avk-47/core",
29
29
  "dev:bin:version": "node ./dist/bin.js --root ~/repos/uranio/builder",
30
30
  "dev:run": "yarn tsc-watch --onSuccess \"yarn dev:bin\"",
31
31
  "dev:run:verbose": "yarn tsc-watch --onSuccess \"yarn dev:bin:verbose\"",
@@ -57,7 +57,7 @@
57
57
  "i0n": "^0.8.1",
58
58
  "mongodb": "^6.3.0",
59
59
  "mysql2": "^3.7.0",
60
- "plutonio": "^0.5.1",
60
+ "plutonio": "^0.5.2",
61
61
  "r4y": "^0.6.0"
62
62
  }
63
63
  }
package/src/bin.ts CHANGED
@@ -43,8 +43,9 @@ function _handle_exception_wrapper(fn: (...args: any) => any, ...args: any) {
43
43
  err.family === 'UranioCLIException'
44
44
  ) {
45
45
  log.error(err.message);
46
+ process.exit(1);
46
47
  }
47
- process.exit(1);
48
+ throw err
48
49
  }
49
50
  };
50
51
  }