@sqb/builder 4.0.6 → 4.0.9
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/LICENSE +191 -21
- package/package.json +11 -11
- package/dist/Serializable.d.ts +0 -9
- package/dist/Serializable.js +0 -6
- package/dist/SerializeContext.d.ts +0 -47
- package/dist/SerializeContext.js +0 -138
- package/dist/classes.d.ts +0 -38
- package/dist/classes.js +0 -50
- package/dist/enums.d.ts +0 -84
- package/dist/enums.js +0 -91
- package/dist/extensions.d.ts +0 -4
- package/dist/extensions.js +0 -16
- package/dist/helpers.d.ts +0 -4
- package/dist/helpers.js +0 -31
- package/dist/index.d.ts +0 -20
- package/dist/index.js +0 -48
- package/dist/op.initializers.d.ts +0 -86
- package/dist/op.initializers.js +0 -158
- package/dist/query/DeleteQuery.d.ts +0 -24
- package/dist/query/DeleteQuery.js +0 -53
- package/dist/query/InsertQuery.d.ts +0 -23
- package/dist/query/InsertQuery.js +0 -76
- package/dist/query/Query.d.ts +0 -15
- package/dist/query/Query.js +0 -42
- package/dist/query/ReturningQuery.d.ts +0 -14
- package/dist/query/ReturningQuery.js +0 -44
- package/dist/query/SelectQuery.d.ts +0 -90
- package/dist/query/SelectQuery.js +0 -283
- package/dist/query/UpdateQuery.d.ts +0 -29
- package/dist/query/UpdateQuery.js +0 -80
- package/dist/sql-objects/BaseField.d.ts +0 -7
- package/dist/sql-objects/BaseField.js +0 -11
- package/dist/sql-objects/CaseStatement.d.ts +0 -42
- package/dist/sql-objects/CaseStatement.js +0 -85
- package/dist/sql-objects/CountStatement.d.ts +0 -20
- package/dist/sql-objects/CountStatement.js +0 -34
- package/dist/sql-objects/Expression.d.ts +0 -7
- package/dist/sql-objects/Expression.js +0 -7
- package/dist/sql-objects/FieldExpression.d.ts +0 -14
- package/dist/sql-objects/FieldExpression.js +0 -53
- package/dist/sql-objects/GroupColumn.d.ts +0 -8
- package/dist/sql-objects/GroupColumn.js +0 -38
- package/dist/sql-objects/JoinStatement.d.ts +0 -17
- package/dist/sql-objects/JoinStatement.js +0 -81
- package/dist/sql-objects/Operator.d.ts +0 -5
- package/dist/sql-objects/Operator.js +0 -7
- package/dist/sql-objects/OrderColumn.d.ts +0 -9
- package/dist/sql-objects/OrderColumn.js +0 -42
- package/dist/sql-objects/ParamExpression.d.ts +0 -23
- package/dist/sql-objects/ParamExpression.js +0 -53
- package/dist/sql-objects/RawStatement.d.ts +0 -9
- package/dist/sql-objects/RawStatement.js +0 -18
- package/dist/sql-objects/ReturningColumn.d.ts +0 -9
- package/dist/sql-objects/ReturningColumn.js +0 -32
- package/dist/sql-objects/TableName.d.ts +0 -11
- package/dist/sql-objects/TableName.js +0 -31
- package/dist/sql-objects/operators/CompOperator.d.ts +0 -16
- package/dist/sql-objects/operators/CompOperator.js +0 -87
- package/dist/sql-objects/operators/LogicalOperator.d.ts +0 -16
- package/dist/sql-objects/operators/LogicalOperator.js +0 -85
- package/dist/sql-objects/operators/OpAnd.d.ts +0 -5
- package/dist/sql-objects/operators/OpAnd.js +0 -12
- package/dist/sql-objects/operators/OpBetween.d.ts +0 -11
- package/dist/sql-objects/operators/OpBetween.js +0 -35
- package/dist/sql-objects/operators/OpEq.d.ts +0 -8
- package/dist/sql-objects/operators/OpEq.js +0 -13
- package/dist/sql-objects/operators/OpExists.d.ts +0 -11
- package/dist/sql-objects/operators/OpExists.js +0 -30
- package/dist/sql-objects/operators/OpGt.d.ts +0 -8
- package/dist/sql-objects/operators/OpGt.js +0 -13
- package/dist/sql-objects/operators/OpGte.d.ts +0 -8
- package/dist/sql-objects/operators/OpGte.js +0 -13
- package/dist/sql-objects/operators/OpILike.d.ts +0 -6
- package/dist/sql-objects/operators/OpILike.js +0 -13
- package/dist/sql-objects/operators/OpIn.d.ts +0 -9
- package/dist/sql-objects/operators/OpIn.js +0 -19
- package/dist/sql-objects/operators/OpIs.d.ts +0 -8
- package/dist/sql-objects/operators/OpIs.js +0 -13
- package/dist/sql-objects/operators/OpIsNot.d.ts +0 -8
- package/dist/sql-objects/operators/OpIsNot.js +0 -13
- package/dist/sql-objects/operators/OpLike.d.ts +0 -10
- package/dist/sql-objects/operators/OpLike.js +0 -22
- package/dist/sql-objects/operators/OpLt.d.ts +0 -8
- package/dist/sql-objects/operators/OpLt.js +0 -13
- package/dist/sql-objects/operators/OpLte.d.ts +0 -8
- package/dist/sql-objects/operators/OpLte.js +0 -13
- package/dist/sql-objects/operators/OpNe.d.ts +0 -8
- package/dist/sql-objects/operators/OpNe.js +0 -13
- package/dist/sql-objects/operators/OpNotBetween.d.ts +0 -6
- package/dist/sql-objects/operators/OpNotBetween.js +0 -13
- package/dist/sql-objects/operators/OpNotExists.d.ts +0 -6
- package/dist/sql-objects/operators/OpNotExists.js +0 -13
- package/dist/sql-objects/operators/OpNotILike.d.ts +0 -6
- package/dist/sql-objects/operators/OpNotILike.js +0 -13
- package/dist/sql-objects/operators/OpNotIn.d.ts +0 -6
- package/dist/sql-objects/operators/OpNotIn.js +0 -13
- package/dist/sql-objects/operators/OpNotLike.d.ts +0 -6
- package/dist/sql-objects/operators/OpNotLike.js +0 -13
- package/dist/sql-objects/operators/OpOr.d.ts +0 -5
- package/dist/sql-objects/operators/OpOr.js +0 -12
- package/dist/sqlobject.initializers.d.ts +0 -39
- package/dist/sqlobject.initializers.js +0 -90
- package/dist/typeguards.d.ts +0 -34
- package/dist/typeguards.js +0 -73
- package/dist/types.d.ts +0 -33
- package/dist/types.js +0 -2
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OpNotIn = void 0;
|
|
4
|
-
const OpIn_1 = require("./OpIn");
|
|
5
|
-
const enums_1 = require("../../enums");
|
|
6
|
-
class OpNotIn extends OpIn_1.OpIn {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this._operatorType = enums_1.OperatorType.notIn;
|
|
10
|
-
this._symbol = 'not in';
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.OpNotIn = OpNotIn;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OpNotLike = void 0;
|
|
4
|
-
const OpLike_1 = require("./OpLike");
|
|
5
|
-
const enums_1 = require("../../enums");
|
|
6
|
-
class OpNotLike extends OpLike_1.OpLike {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this._operatorType = enums_1.OperatorType.notLike;
|
|
10
|
-
this._symbol = 'not like';
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.OpNotLike = OpNotLike;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OpOr = void 0;
|
|
4
|
-
const LogicalOperator_1 = require("./LogicalOperator");
|
|
5
|
-
const enums_1 = require("../../enums");
|
|
6
|
-
class OpOr extends LogicalOperator_1.LogicalOperator {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this._operatorType = enums_1.OperatorType.or;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.OpOr = OpOr;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { DataType } from './enums';
|
|
2
|
-
import { Serializable } from './Serializable';
|
|
3
|
-
import { SelectQuery } from './query/SelectQuery';
|
|
4
|
-
import { InsertQuery } from './query/InsertQuery';
|
|
5
|
-
import { UpdateQuery } from './query/UpdateQuery';
|
|
6
|
-
import { DeleteQuery } from './query/DeleteQuery';
|
|
7
|
-
import { RawStatement } from './sql-objects/RawStatement';
|
|
8
|
-
import { JoinStatement } from './sql-objects/JoinStatement';
|
|
9
|
-
import { CaseStatement } from './sql-objects/CaseStatement';
|
|
10
|
-
import { CountStatement } from './sql-objects/CountStatement';
|
|
11
|
-
import { ParamExpression } from './sql-objects/ParamExpression';
|
|
12
|
-
import { FieldExpression } from './sql-objects/FieldExpression';
|
|
13
|
-
export declare function Raw(text: string): RawStatement;
|
|
14
|
-
export declare function Select(...column: (string | string[] | Serializable)[]): SelectQuery;
|
|
15
|
-
export declare function Insert(tableName: string | RawStatement, input: any): InsertQuery;
|
|
16
|
-
export declare function Update(tableName: string | RawStatement, input: any): UpdateQuery;
|
|
17
|
-
export declare function Delete(tableName: string | RawStatement): DeleteQuery;
|
|
18
|
-
export declare function Join(table: string | SelectQuery | RawStatement): JoinStatement;
|
|
19
|
-
export declare function InnerJoin(table: string | SelectQuery | RawStatement): JoinStatement;
|
|
20
|
-
export declare function LeftJoin(table: string | SelectQuery | RawStatement): JoinStatement;
|
|
21
|
-
export declare function LeftOuterJoin(table: string | SelectQuery | RawStatement): JoinStatement;
|
|
22
|
-
export declare function RightJoin(table: string | SelectQuery | RawStatement): JoinStatement;
|
|
23
|
-
export declare function RightOuterJoin(table: string | SelectQuery | RawStatement): JoinStatement;
|
|
24
|
-
export declare function OuterJoin(table: string | SelectQuery | RawStatement): JoinStatement;
|
|
25
|
-
export declare function FullOuterJoin(table: string | SelectQuery | RawStatement): JoinStatement;
|
|
26
|
-
export declare function Case(): CaseStatement;
|
|
27
|
-
export declare function Count(): CountStatement;
|
|
28
|
-
export declare function Param(name: string, dataType?: DataType, isArray?: boolean): ParamExpression;
|
|
29
|
-
export declare function Param(args: {
|
|
30
|
-
name: string;
|
|
31
|
-
dataType?: DataType;
|
|
32
|
-
isArray?: boolean;
|
|
33
|
-
}): ParamExpression;
|
|
34
|
-
export declare function Field(name: string, dataType?: DataType, isArray?: boolean): FieldExpression;
|
|
35
|
-
export declare function Field(args: {
|
|
36
|
-
name: string;
|
|
37
|
-
dataType?: DataType;
|
|
38
|
-
isArray?: boolean;
|
|
39
|
-
}): FieldExpression;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Field = exports.Param = exports.Count = exports.Case = exports.FullOuterJoin = exports.OuterJoin = exports.RightOuterJoin = exports.RightJoin = exports.LeftOuterJoin = exports.LeftJoin = exports.InnerJoin = exports.Join = exports.Delete = exports.Update = exports.Insert = exports.Select = exports.Raw = void 0;
|
|
4
|
-
const enums_1 = require("./enums");
|
|
5
|
-
const SelectQuery_1 = require("./query/SelectQuery");
|
|
6
|
-
const InsertQuery_1 = require("./query/InsertQuery");
|
|
7
|
-
const UpdateQuery_1 = require("./query/UpdateQuery");
|
|
8
|
-
const DeleteQuery_1 = require("./query/DeleteQuery");
|
|
9
|
-
const RawStatement_1 = require("./sql-objects/RawStatement");
|
|
10
|
-
const JoinStatement_1 = require("./sql-objects/JoinStatement");
|
|
11
|
-
const CaseStatement_1 = require("./sql-objects/CaseStatement");
|
|
12
|
-
const CountStatement_1 = require("./sql-objects/CountStatement");
|
|
13
|
-
const ParamExpression_1 = require("./sql-objects/ParamExpression");
|
|
14
|
-
const FieldExpression_1 = require("./sql-objects/FieldExpression");
|
|
15
|
-
function Raw(text) {
|
|
16
|
-
return new RawStatement_1.RawStatement(text);
|
|
17
|
-
}
|
|
18
|
-
exports.Raw = Raw;
|
|
19
|
-
function Select(...column) {
|
|
20
|
-
return new SelectQuery_1.SelectQuery(...column);
|
|
21
|
-
}
|
|
22
|
-
exports.Select = Select;
|
|
23
|
-
function Insert(tableName, input) {
|
|
24
|
-
return new InsertQuery_1.InsertQuery(tableName, input);
|
|
25
|
-
}
|
|
26
|
-
exports.Insert = Insert;
|
|
27
|
-
function Update(tableName, input) {
|
|
28
|
-
return new UpdateQuery_1.UpdateQuery(tableName, input);
|
|
29
|
-
}
|
|
30
|
-
exports.Update = Update;
|
|
31
|
-
function Delete(tableName) {
|
|
32
|
-
return new DeleteQuery_1.DeleteQuery(tableName);
|
|
33
|
-
}
|
|
34
|
-
exports.Delete = Delete;
|
|
35
|
-
function Join(table) {
|
|
36
|
-
return new JoinStatement_1.JoinStatement(enums_1.JoinType.INNER, table);
|
|
37
|
-
}
|
|
38
|
-
exports.Join = Join;
|
|
39
|
-
function InnerJoin(table) {
|
|
40
|
-
return new JoinStatement_1.JoinStatement(enums_1.JoinType.INNER, table);
|
|
41
|
-
}
|
|
42
|
-
exports.InnerJoin = InnerJoin;
|
|
43
|
-
function LeftJoin(table) {
|
|
44
|
-
return new JoinStatement_1.JoinStatement(enums_1.JoinType.LEFT, table);
|
|
45
|
-
}
|
|
46
|
-
exports.LeftJoin = LeftJoin;
|
|
47
|
-
function LeftOuterJoin(table) {
|
|
48
|
-
return new JoinStatement_1.JoinStatement(enums_1.JoinType.LEFT_OUTER, table);
|
|
49
|
-
}
|
|
50
|
-
exports.LeftOuterJoin = LeftOuterJoin;
|
|
51
|
-
function RightJoin(table) {
|
|
52
|
-
return new JoinStatement_1.JoinStatement(enums_1.JoinType.RIGHT, table);
|
|
53
|
-
}
|
|
54
|
-
exports.RightJoin = RightJoin;
|
|
55
|
-
function RightOuterJoin(table) {
|
|
56
|
-
return new JoinStatement_1.JoinStatement(enums_1.JoinType.RIGHT_OUTER, table);
|
|
57
|
-
}
|
|
58
|
-
exports.RightOuterJoin = RightOuterJoin;
|
|
59
|
-
function OuterJoin(table) {
|
|
60
|
-
return new JoinStatement_1.JoinStatement(enums_1.JoinType.OUTER, table);
|
|
61
|
-
}
|
|
62
|
-
exports.OuterJoin = OuterJoin;
|
|
63
|
-
function FullOuterJoin(table) {
|
|
64
|
-
return new JoinStatement_1.JoinStatement(enums_1.JoinType.FULL_OUTER, table);
|
|
65
|
-
}
|
|
66
|
-
exports.FullOuterJoin = FullOuterJoin;
|
|
67
|
-
function Case() {
|
|
68
|
-
return new CaseStatement_1.CaseStatement();
|
|
69
|
-
}
|
|
70
|
-
exports.Case = Case;
|
|
71
|
-
function Count() {
|
|
72
|
-
return new CountStatement_1.CountStatement();
|
|
73
|
-
}
|
|
74
|
-
exports.Count = Count;
|
|
75
|
-
function Param(arg0, arg1, arg2) {
|
|
76
|
-
if (typeof arg0 === 'object')
|
|
77
|
-
return new ParamExpression_1.ParamExpression(arg0);
|
|
78
|
-
return new ParamExpression_1.ParamExpression({
|
|
79
|
-
name: arg0,
|
|
80
|
-
dataType: arg1,
|
|
81
|
-
isArray: arg2
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
exports.Param = Param;
|
|
85
|
-
function Field(arg0, arg1, arg2) {
|
|
86
|
-
if (typeof arg0 === 'object')
|
|
87
|
-
return new FieldExpression_1.FieldExpression(arg0);
|
|
88
|
-
return new FieldExpression_1.FieldExpression(arg0, arg1, arg2);
|
|
89
|
-
}
|
|
90
|
-
exports.Field = Field;
|
package/dist/typeguards.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Serializable } from './Serializable';
|
|
2
|
-
import type { SelectQuery } from './query/SelectQuery';
|
|
3
|
-
import type { InsertQuery } from './query/InsertQuery';
|
|
4
|
-
import type { UpdateQuery } from './query/UpdateQuery';
|
|
5
|
-
import type { DeleteQuery } from './query/DeleteQuery';
|
|
6
|
-
import type { RawStatement } from './sql-objects/RawStatement';
|
|
7
|
-
import type { JoinStatement } from './sql-objects/JoinStatement';
|
|
8
|
-
import type { CaseStatement } from './sql-objects/CaseStatement';
|
|
9
|
-
import type { ParamExpression } from './sql-objects/ParamExpression';
|
|
10
|
-
import type { LogicalOperator } from './sql-objects/operators/LogicalOperator';
|
|
11
|
-
import type { CompOperator } from './sql-objects/operators/CompOperator';
|
|
12
|
-
import type { FieldExpression } from './sql-objects/FieldExpression';
|
|
13
|
-
import type { OrderColumn } from './sql-objects/OrderColumn';
|
|
14
|
-
import type { GroupColumn } from './sql-objects/GroupColumn';
|
|
15
|
-
import type { ReturningColumn } from './sql-objects/ReturningColumn';
|
|
16
|
-
import type { TableName } from './sql-objects/TableName';
|
|
17
|
-
import { CountStatement } from './sql-objects/CountStatement';
|
|
18
|
-
export declare function isSerializable(value: any): value is Serializable;
|
|
19
|
-
export declare function isRawStatement(value: any): value is RawStatement;
|
|
20
|
-
export declare function isSelectQuery(value: any): value is SelectQuery;
|
|
21
|
-
export declare function isInsertQuery(value: any): value is InsertQuery;
|
|
22
|
-
export declare function isIUpdateQuery(value: any): value is UpdateQuery;
|
|
23
|
-
export declare function isDeleteQuery(value: any): value is DeleteQuery;
|
|
24
|
-
export declare function isJoinStatement(value: any): value is JoinStatement;
|
|
25
|
-
export declare function isCaseStatement(value: any): value is CaseStatement;
|
|
26
|
-
export declare function isCountStatement(value: any): value is CountStatement;
|
|
27
|
-
export declare function isParamExpression(value: any): value is ParamExpression;
|
|
28
|
-
export declare function isLogicalOperator(value: any): value is LogicalOperator;
|
|
29
|
-
export declare function isCompOperator(value: any): value is CompOperator;
|
|
30
|
-
export declare function isSelectColumn(value: any): value is FieldExpression;
|
|
31
|
-
export declare function isOrderColumn(value: any): value is OrderColumn;
|
|
32
|
-
export declare function isGroupColumn(value: any): value is GroupColumn;
|
|
33
|
-
export declare function isReturningColumn(value: any): value is ReturningColumn;
|
|
34
|
-
export declare function isTableName(value: any): value is TableName;
|
package/dist/typeguards.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTableName = exports.isReturningColumn = exports.isGroupColumn = exports.isOrderColumn = exports.isSelectColumn = exports.isCompOperator = exports.isLogicalOperator = exports.isParamExpression = exports.isCountStatement = exports.isCaseStatement = exports.isJoinStatement = exports.isDeleteQuery = exports.isIUpdateQuery = exports.isInsertQuery = exports.isSelectQuery = exports.isRawStatement = exports.isSerializable = void 0;
|
|
4
|
-
const enums_1 = require("./enums");
|
|
5
|
-
const Serializable_1 = require("./Serializable");
|
|
6
|
-
function isSerializable(value) {
|
|
7
|
-
return value instanceof Serializable_1.Serializable;
|
|
8
|
-
}
|
|
9
|
-
exports.isSerializable = isSerializable;
|
|
10
|
-
function isRawStatement(value) {
|
|
11
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.RAW;
|
|
12
|
-
}
|
|
13
|
-
exports.isRawStatement = isRawStatement;
|
|
14
|
-
function isSelectQuery(value) {
|
|
15
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.SELECT_QUERY;
|
|
16
|
-
}
|
|
17
|
-
exports.isSelectQuery = isSelectQuery;
|
|
18
|
-
function isInsertQuery(value) {
|
|
19
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.INSERT_QUERY;
|
|
20
|
-
}
|
|
21
|
-
exports.isInsertQuery = isInsertQuery;
|
|
22
|
-
function isIUpdateQuery(value) {
|
|
23
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.UPDATE_QUERY;
|
|
24
|
-
}
|
|
25
|
-
exports.isIUpdateQuery = isIUpdateQuery;
|
|
26
|
-
function isDeleteQuery(value) {
|
|
27
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.DELETE_QUERY;
|
|
28
|
-
}
|
|
29
|
-
exports.isDeleteQuery = isDeleteQuery;
|
|
30
|
-
function isJoinStatement(value) {
|
|
31
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.JOIN;
|
|
32
|
-
}
|
|
33
|
-
exports.isJoinStatement = isJoinStatement;
|
|
34
|
-
function isCaseStatement(value) {
|
|
35
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.CASE_STATEMENT;
|
|
36
|
-
}
|
|
37
|
-
exports.isCaseStatement = isCaseStatement;
|
|
38
|
-
function isCountStatement(value) {
|
|
39
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.COUNT_STATEMENT;
|
|
40
|
-
}
|
|
41
|
-
exports.isCountStatement = isCountStatement;
|
|
42
|
-
function isParamExpression(value) {
|
|
43
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.EXTERNAL_PARAMETER;
|
|
44
|
-
}
|
|
45
|
-
exports.isParamExpression = isParamExpression;
|
|
46
|
-
function isLogicalOperator(value) {
|
|
47
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.LOGICAL_EXPRESSION;
|
|
48
|
-
}
|
|
49
|
-
exports.isLogicalOperator = isLogicalOperator;
|
|
50
|
-
function isCompOperator(value) {
|
|
51
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.COMPARISON_EXPRESSION;
|
|
52
|
-
}
|
|
53
|
-
exports.isCompOperator = isCompOperator;
|
|
54
|
-
function isSelectColumn(value) {
|
|
55
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.SELECT_COLUMN;
|
|
56
|
-
}
|
|
57
|
-
exports.isSelectColumn = isSelectColumn;
|
|
58
|
-
function isOrderColumn(value) {
|
|
59
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.ORDER_COLUMN;
|
|
60
|
-
}
|
|
61
|
-
exports.isOrderColumn = isOrderColumn;
|
|
62
|
-
function isGroupColumn(value) {
|
|
63
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.GROUP_COLUMN;
|
|
64
|
-
}
|
|
65
|
-
exports.isGroupColumn = isGroupColumn;
|
|
66
|
-
function isReturningColumn(value) {
|
|
67
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.RETURNING_COLUMN;
|
|
68
|
-
}
|
|
69
|
-
exports.isReturningColumn = isReturningColumn;
|
|
70
|
-
function isTableName(value) {
|
|
71
|
-
return isSerializable(value) && value._type === enums_1.SerializationType.TABLE_NAME;
|
|
72
|
-
}
|
|
73
|
-
exports.isTableName = isTableName;
|
package/dist/types.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { DataType, SerializationType } from './enums';
|
|
2
|
-
import type { SerializeContext } from './SerializeContext';
|
|
3
|
-
export declare type SerializeFunction = (ctx: SerializeContext, type: SerializationType | string, obj: any, defFn: DefaultSerializeFunction) => string | undefined;
|
|
4
|
-
export declare type DefaultSerializeFunction = (ctx: SerializeContext, o: any) => string;
|
|
5
|
-
export declare type IsReservedWordFunction = (ctx: SerializeContext, s: string) => boolean;
|
|
6
|
-
export interface SerializerExtension {
|
|
7
|
-
dialect: string;
|
|
8
|
-
serialize?: SerializeFunction;
|
|
9
|
-
isReservedWord?: IsReservedWordFunction;
|
|
10
|
-
}
|
|
11
|
-
export interface GenerateOptions {
|
|
12
|
-
/**
|
|
13
|
-
* Dialect that query to be generated for. Etc: postgres, oracle, sqlite ...
|
|
14
|
-
*/
|
|
15
|
-
dialect?: string;
|
|
16
|
-
prettyPrint?: boolean;
|
|
17
|
-
params?: Record<string, any>;
|
|
18
|
-
dialectVersion?: string;
|
|
19
|
-
strictParams?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface ParamOptions {
|
|
22
|
-
dataType?: DataType;
|
|
23
|
-
isArray?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export interface GenerateResult {
|
|
26
|
-
sql: string;
|
|
27
|
-
params?: any;
|
|
28
|
-
paramOptions?: Record<string, ParamOptions> | ParamOptions[];
|
|
29
|
-
returningFields?: {
|
|
30
|
-
field: string;
|
|
31
|
-
alias?: string;
|
|
32
|
-
}[];
|
|
33
|
-
}
|
package/dist/types.js
DELETED