@zuzjs/orm 0.3.6 → 0.3.8

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/dist/types.d.ts DELETED
@@ -1,104 +0,0 @@
1
- import { ObjectLiteral } from "typeorm";
2
- export type dynamicObject = {
3
- [x: string]: any;
4
- };
5
- export interface ModelGenerator {
6
- generate: () => void;
7
- connection: () => ConnectionDetails;
8
- mapColumns: (sqlType: string) => void;
9
- }
10
- export type ConnectionDetails = {
11
- host: string;
12
- port: string | number;
13
- user: string;
14
- password: string;
15
- database: string;
16
- params: dynamicObject;
17
- };
18
- export type QueryAction = "create" | "upsert" | "select" | "update" | "delete";
19
- export type QueryResult = InsertQueryResult | SelectQueryResult | UpdateQueryResult | DeleteQueryResult;
20
- /**
21
- * Defines supported comparison operators for filtering queries.
22
- * Enables IntelliSense support in `.where()` conditions.
23
- *
24
- * @template T The type of the value being compared (e.g., number, string, Date).
25
- */
26
- export type WhereOperators<T> = {
27
- /**
28
- * Greater than (`>`) operator.
29
- *
30
- * @example
31
- * query.where({ age: { gt: 18 } }) // WHERE age > 18
32
- */
33
- gt?: T;
34
- /**
35
- * Greater than or equal to (`>=`) operator.
36
- *
37
- * @example
38
- * query.where({ price: { gte: 100 } }) // WHERE price >= 100
39
- */
40
- gte?: T;
41
- /**
42
- * Less than (`<`) operator.
43
- *
44
- * @example
45
- * query.where({ age: { lt: 30 } }) // WHERE age < 30
46
- */
47
- lt?: T;
48
- /**
49
- * Less than or equal to (`<=`) operator.
50
- *
51
- * @example
52
- * query.where({ date: { lte: '2024-01-01' } }) // WHERE date <= '2024-01-01'
53
- */
54
- lte?: T;
55
- /**
56
- * Not equal (`!=`) operator.
57
- *
58
- * @example
59
- * query.where({ status: { ne: 'inactive' } }) // WHERE status != 'inactive'
60
- */
61
- ne?: T;
62
- /**
63
- * Equal (`=`) operator.
64
- * This is typically unnecessary since `.where({ key: value })` already handles equality.
65
- *
66
- * @example
67
- * query.where({ id: { eq: 1 } }) // WHERE id = 1
68
- */
69
- eq?: T;
70
- };
71
- export type PartialConditions<T> = Partial<Record<keyof T, string | number | boolean | WhereOperators<any>>>;
72
- export type QueryError = {
73
- code: number | string;
74
- message: string;
75
- query: string;
76
- values: string[];
77
- };
78
- export type InsertQueryResult = {
79
- created: boolean;
80
- id?: number;
81
- record?: ObjectLiteral;
82
- records?: ObjectLiteral[];
83
- error?: QueryError;
84
- };
85
- export type SelectQueryResult = {
86
- hasRows: boolean;
87
- count?: number;
88
- row?: any;
89
- rows?: any[];
90
- error?: QueryError;
91
- save?: () => void;
92
- };
93
- export type UpdateQueryResult = {
94
- updated: boolean;
95
- record?: ObjectLiteral;
96
- records?: ObjectLiteral[];
97
- error?: QueryError;
98
- };
99
- export type DeleteQueryResult = {
100
- deleted: boolean;
101
- count: number;
102
- error?: QueryError;
103
- };
104
- export { BaseEntity, Column, Entity, JoinColumn, ManyToMany, ManyToOne, OneToMany, OneToOne, PrimaryColumn, PrimaryGeneratedColumn } from "typeorm";
package/dist/types.js DELETED
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PrimaryGeneratedColumn = exports.PrimaryColumn = exports.OneToOne = exports.OneToMany = exports.ManyToOne = exports.ManyToMany = exports.JoinColumn = exports.Entity = exports.Column = exports.BaseEntity = void 0;
4
- var typeorm_1 = require("typeorm");
5
- Object.defineProperty(exports, "BaseEntity", { enumerable: true, get: function () { return typeorm_1.BaseEntity; } });
6
- Object.defineProperty(exports, "Column", { enumerable: true, get: function () { return typeorm_1.Column; } });
7
- Object.defineProperty(exports, "Entity", { enumerable: true, get: function () { return typeorm_1.Entity; } });
8
- Object.defineProperty(exports, "JoinColumn", { enumerable: true, get: function () { return typeorm_1.JoinColumn; } });
9
- Object.defineProperty(exports, "ManyToMany", { enumerable: true, get: function () { return typeorm_1.ManyToMany; } });
10
- Object.defineProperty(exports, "ManyToOne", { enumerable: true, get: function () { return typeorm_1.ManyToOne; } });
11
- Object.defineProperty(exports, "OneToMany", { enumerable: true, get: function () { return typeorm_1.OneToMany; } });
12
- Object.defineProperty(exports, "OneToOne", { enumerable: true, get: function () { return typeorm_1.OneToOne; } });
13
- Object.defineProperty(exports, "PrimaryColumn", { enumerable: true, get: function () { return typeorm_1.PrimaryColumn; } });
14
- Object.defineProperty(exports, "PrimaryGeneratedColumn", { enumerable: true, get: function () { return typeorm_1.PrimaryGeneratedColumn; } });