@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/bin.cjs +4 -0
- package/dist/bin.d.cts +1 -0
- package/dist/bin.d.ts +0 -1
- package/dist/bin.js +2 -25
- package/dist/chunk-3TCXY5YG.js +16 -0
- package/dist/chunk-ZWZYE56D.cjs +17 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +386 -0
- package/dist/index.d.ts +303 -8
- package/dist/index.js +1 -183
- package/package.json +56 -48
- package/dist/core/cli.d.ts +0 -5
- package/dist/core/cli.js +0 -78
- package/dist/core/index.d.ts +0 -8
- package/dist/core/index.js +0 -72
- package/dist/drivers/expressionBuilder.d.ts +0 -32
- package/dist/drivers/expressionBuilder.js +0 -100
- package/dist/drivers/mysql/index.d.ts +0 -39
- package/dist/drivers/mysql/index.js +0 -336
- package/dist/drivers/queryBuilder.d.ts +0 -162
- package/dist/drivers/queryBuilder.js +0 -518
- package/dist/types.d.ts +0 -104
- package/dist/types.js +0 -14
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; } });
|