noxium 1.0.9 → 1.0.11

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,10 +1,10 @@
1
1
  # Noxium
2
2
 
3
- Lightweight, type-safe mini ORM for **Bun** and **TypeScript** that unifies **SQLite (`bun:sqlite`)** and **MongoDB (`Mongoose`)** behind a single declarative schema and query API.
3
+ Lightweight, type-safe mini ORM for **Bun** and **TypeScript** that unifies **SQLite (`better-sqlite3`)** and **MongoDB (`Mongoose`)** behind a single declarative schema and query API.
4
4
 
5
5
  ## Features
6
6
 
7
- - **Dual-Driver Support:** Switch seamlessly between `sqlite` (`bun:sqlite`) and `mongo` (`mongoose`) from a single configuration object.
7
+ - **Dual-Driver Support:** Switch seamlessly between `sqlite` (`better-sqlite3`) and `mongo` (`mongoose`) from a single configuration object.
8
8
  - **Declarative Schema:** Define models, field types (`String`, `Number`, `Boolean`, `Date`, `"ref"`), `required`, `unique`, `default`, `trim`, and `lowercase` in one place.
9
9
  - **Full TypeScript Type Safety:** Automatic type inference and IDE autocomplete (`Ctrl + Space`) for required fields on `insert`, unique keys on `findUnique`, and typed query results.
10
10
  - **Built-in Relations (`populate`):** Unified relation loading using `.populate()` on MongoDB and automatic `LEFT JOIN` on SQLite.
@@ -22,8 +22,6 @@ npm install noxium
22
22
 
23
23
  ```
24
24
 
25
- > **Note:** Make sure [Bun](https://bun.sh/) is installed if you plan to use the built-in `bun:sqlite` driver.
26
-
27
25
  ## Quick Start
28
26
 
29
27
  ### 1. Create Your Configuration File
@@ -0,0 +1,4 @@
1
+ var m=Object.create;var{getPrototypeOf:x,defineProperty:n,getOwnPropertyNames:C,getOwnPropertyDescriptor:b}=Object,r=Object.prototype.hasOwnProperty;function c(e){return this[e]}var l,q,u=(e,t,o)=>{var i=e!=null&&typeof e==="object";if(i){var s=t?l??=new WeakMap:q??=new WeakMap,f=s.get(e);if(f)return f}o=e!=null?m(x(e)):{};let a=t||!e||!e.__esModule||!r.call(e,"default")?n(o,"default",{value:e,enumerable:!0}):o;if(e&&typeof e==="object"||typeof e==="function"){for(let g of C(e))if(!r.call(a,g))n(a,g,{get:c.bind(e,g),enumerable:!0})}if(i)s.set(e,a);return a},y=(e)=>{var t=(p??=new WeakMap).get(e),o;if(t)return t;if(t=n({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var i of C(e))if(!r.call(t,i))n(t,i,{get:c.bind(e,i),enumerable:!(o=b(e,i))||o.enumerable})}return p.set(e,t),t},p;var S=(e)=>e;function d(e,t){this[e]=S.bind(null,t)}var D=(e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0,configurable:!0,set:d.bind(t,o)})};var h={};module.exports=y(h);
2
+
3
+ //# debugId=EDB916D6A85EEC5364756E2164756E21
4
+ //# sourceMappingURL=config.cjs.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "EDB916D6A85EEC5364756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1,19 @@
1
+ export interface SqliteConfig {
2
+ type: "sqlite";
3
+ sqlite: {
4
+ path: string;
5
+ };
6
+ }
7
+ export interface MongoConfig {
8
+ type: "mongo";
9
+ mongo: {
10
+ uri: string;
11
+ dbName?: string;
12
+ };
13
+ }
14
+ export type DatabaseConfig = SqliteConfig | MongoConfig;
15
+ export interface NoxiumConfig<S = Record<string, any>> {
16
+ database: DatabaseConfig;
17
+ schemas?: S;
18
+ }
19
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,WAAW,CAAC;AAExD,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACnD,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC;CACb"}
@@ -0,0 +1,3 @@
1
+
2
+ //# debugId=7EE16B3DF3FDFFB964756E2164756E21
3
+ //# sourceMappingURL=config.mjs.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "7EE16B3DF3FDFFB964756E2164756E21",
8
+ "names": []
9
+ }