@sqb/builder 4.9.0 → 4.10.0

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.
Files changed (158) hide show
  1. package/cjs/enums.js +4 -4
  2. package/cjs/query/delete-query.js +0 -2
  3. package/cjs/query/insert-query.js +0 -2
  4. package/cjs/query/query.js +0 -1
  5. package/cjs/query/returning-query.js +0 -1
  6. package/cjs/query/select-query.js +0 -10
  7. package/cjs/query/update-query.js +0 -3
  8. package/cjs/serialize-context.js +12 -22
  9. package/cjs/sql-objects/base-field.js +4 -4
  10. package/cjs/sql-objects/case-statement.js +0 -4
  11. package/cjs/sql-objects/coalesce-statement.js +0 -2
  12. package/cjs/sql-objects/count-statement.js +0 -1
  13. package/cjs/sql-objects/expression.js +0 -3
  14. package/cjs/sql-objects/field-expression.js +0 -1
  15. package/cjs/sql-objects/join-statement.js +1 -3
  16. package/cjs/sql-objects/lower-statement.js +0 -2
  17. package/cjs/sql-objects/max-statement.js +0 -2
  18. package/cjs/sql-objects/min-statement.js +0 -2
  19. package/cjs/sql-objects/operators/comp-operator.js +0 -4
  20. package/cjs/sql-objects/operators/logical-operator.js +1 -1
  21. package/cjs/sql-objects/operators/op-and.js +4 -1
  22. package/cjs/sql-objects/operators/op-between.js +2 -2
  23. package/cjs/sql-objects/operators/op-eq.js +2 -2
  24. package/cjs/sql-objects/operators/op-exists.js +2 -2
  25. package/cjs/sql-objects/operators/op-gt.js +2 -2
  26. package/cjs/sql-objects/operators/op-gte.js +2 -2
  27. package/cjs/sql-objects/operators/op-ilike.js +5 -2
  28. package/cjs/sql-objects/operators/op-in.js +2 -2
  29. package/cjs/sql-objects/operators/op-is-not.js +2 -2
  30. package/cjs/sql-objects/operators/op-is.js +2 -2
  31. package/cjs/sql-objects/operators/op-like.js +2 -2
  32. package/cjs/sql-objects/operators/op-lt.js +2 -2
  33. package/cjs/sql-objects/operators/op-lte.js +2 -2
  34. package/cjs/sql-objects/operators/op-ne.js +2 -2
  35. package/cjs/sql-objects/operators/op-not-between.js +5 -2
  36. package/cjs/sql-objects/operators/op-not-exists.js +5 -2
  37. package/cjs/sql-objects/operators/op-not-ilike.js +5 -2
  38. package/cjs/sql-objects/operators/op-not-in.js +5 -2
  39. package/cjs/sql-objects/operators/op-not-like.js +5 -2
  40. package/cjs/sql-objects/operators/op-not.js +1 -2
  41. package/cjs/sql-objects/operators/op-or.js +4 -1
  42. package/cjs/sql-objects/order-column.js +0 -1
  43. package/cjs/sql-objects/param-expression.js +0 -3
  44. package/cjs/sql-objects/raw-statement.js +0 -1
  45. package/cjs/sql-objects/returning-column.js +0 -1
  46. package/cjs/sql-objects/sequence-getter-statement.js +0 -3
  47. package/cjs/sql-objects/string-agg-statement.js +0 -4
  48. package/cjs/sql-objects/table-name.js +0 -3
  49. package/cjs/sql-objects/upper-statement.js +0 -2
  50. package/esm/query/delete-query.js +0 -2
  51. package/esm/query/insert-query.js +0 -2
  52. package/esm/query/query.js +0 -1
  53. package/esm/query/returning-query.js +0 -1
  54. package/esm/query/select-query.js +0 -10
  55. package/esm/query/update-query.js +0 -3
  56. package/esm/serialize-context.js +12 -22
  57. package/esm/sql-objects/base-field.js +4 -4
  58. package/esm/sql-objects/case-statement.js +0 -4
  59. package/esm/sql-objects/coalesce-statement.js +0 -2
  60. package/esm/sql-objects/count-statement.js +0 -1
  61. package/esm/sql-objects/expression.js +0 -3
  62. package/esm/sql-objects/field-expression.js +0 -1
  63. package/esm/sql-objects/join-statement.js +1 -3
  64. package/esm/sql-objects/lower-statement.js +0 -2
  65. package/esm/sql-objects/max-statement.js +0 -2
  66. package/esm/sql-objects/min-statement.js +0 -2
  67. package/esm/sql-objects/operators/comp-operator.js +0 -4
  68. package/esm/sql-objects/operators/logical-operator.js +1 -1
  69. package/esm/sql-objects/operators/op-and.js +4 -1
  70. package/esm/sql-objects/operators/op-between.js +2 -2
  71. package/esm/sql-objects/operators/op-eq.js +2 -2
  72. package/esm/sql-objects/operators/op-exists.js +2 -2
  73. package/esm/sql-objects/operators/op-gt.js +2 -2
  74. package/esm/sql-objects/operators/op-gte.js +2 -2
  75. package/esm/sql-objects/operators/op-ilike.js +5 -2
  76. package/esm/sql-objects/operators/op-in.js +2 -2
  77. package/esm/sql-objects/operators/op-is-not.js +2 -2
  78. package/esm/sql-objects/operators/op-is.js +2 -2
  79. package/esm/sql-objects/operators/op-like.js +2 -2
  80. package/esm/sql-objects/operators/op-lt.js +2 -2
  81. package/esm/sql-objects/operators/op-lte.js +2 -2
  82. package/esm/sql-objects/operators/op-ne.js +2 -2
  83. package/esm/sql-objects/operators/op-not-between.js +5 -2
  84. package/esm/sql-objects/operators/op-not-exists.js +5 -2
  85. package/esm/sql-objects/operators/op-not-ilike.js +5 -2
  86. package/esm/sql-objects/operators/op-not-in.js +5 -2
  87. package/esm/sql-objects/operators/op-not-like.js +5 -2
  88. package/esm/sql-objects/operators/op-not.js +1 -2
  89. package/esm/sql-objects/operators/op-or.js +4 -1
  90. package/esm/sql-objects/order-column.js +0 -1
  91. package/esm/sql-objects/param-expression.js +0 -3
  92. package/esm/sql-objects/raw-statement.js +0 -1
  93. package/esm/sql-objects/returning-column.js +0 -1
  94. package/esm/sql-objects/sequence-getter-statement.js +0 -3
  95. package/esm/sql-objects/string-agg-statement.js +0 -4
  96. package/esm/sql-objects/table-name.js +0 -3
  97. package/esm/sql-objects/upper-statement.js +0 -2
  98. package/package.json +7 -13
  99. package/esm/classes.ns.d.ts +0 -38
  100. package/esm/enums.d.ts +0 -94
  101. package/esm/extensions.d.ts +0 -4
  102. package/esm/helpers.d.ts +0 -4
  103. package/esm/index.d.ts +0 -20
  104. package/esm/op.initializers.d.ts +0 -89
  105. package/esm/query/delete-query.d.ts +0 -24
  106. package/esm/query/insert-query.d.ts +0 -23
  107. package/esm/query/query.d.ts +0 -15
  108. package/esm/query/returning-query.d.ts +0 -14
  109. package/esm/query/select-query.d.ts +0 -90
  110. package/esm/query/update-query.d.ts +0 -29
  111. package/esm/serializable.d.ts +0 -9
  112. package/esm/serialize-context.d.ts +0 -47
  113. package/esm/sql-objects/base-field.d.ts +0 -7
  114. package/esm/sql-objects/case-statement.d.ts +0 -42
  115. package/esm/sql-objects/coalesce-statement.d.ts +0 -22
  116. package/esm/sql-objects/count-statement.d.ts +0 -20
  117. package/esm/sql-objects/expression.d.ts +0 -7
  118. package/esm/sql-objects/field-expression.d.ts +0 -14
  119. package/esm/sql-objects/group-column.d.ts +0 -8
  120. package/esm/sql-objects/join-statement.d.ts +0 -17
  121. package/esm/sql-objects/lower-statement.d.ts +0 -22
  122. package/esm/sql-objects/max-statement.d.ts +0 -22
  123. package/esm/sql-objects/min-statement.d.ts +0 -22
  124. package/esm/sql-objects/operator.d.ts +0 -5
  125. package/esm/sql-objects/operators/comp-operator.d.ts +0 -16
  126. package/esm/sql-objects/operators/logical-operator.d.ts +0 -16
  127. package/esm/sql-objects/operators/op-and.d.ts +0 -5
  128. package/esm/sql-objects/operators/op-between.d.ts +0 -11
  129. package/esm/sql-objects/operators/op-eq.d.ts +0 -8
  130. package/esm/sql-objects/operators/op-exists.d.ts +0 -11
  131. package/esm/sql-objects/operators/op-gt.d.ts +0 -8
  132. package/esm/sql-objects/operators/op-gte.d.ts +0 -8
  133. package/esm/sql-objects/operators/op-ilike.d.ts +0 -6
  134. package/esm/sql-objects/operators/op-in.d.ts +0 -9
  135. package/esm/sql-objects/operators/op-is-not.d.ts +0 -8
  136. package/esm/sql-objects/operators/op-is.d.ts +0 -8
  137. package/esm/sql-objects/operators/op-like.d.ts +0 -10
  138. package/esm/sql-objects/operators/op-lt.d.ts +0 -8
  139. package/esm/sql-objects/operators/op-lte.d.ts +0 -8
  140. package/esm/sql-objects/operators/op-ne.d.ts +0 -8
  141. package/esm/sql-objects/operators/op-not-between.d.ts +0 -6
  142. package/esm/sql-objects/operators/op-not-exists.d.ts +0 -6
  143. package/esm/sql-objects/operators/op-not-ilike.d.ts +0 -6
  144. package/esm/sql-objects/operators/op-not-in.d.ts +0 -6
  145. package/esm/sql-objects/operators/op-not-like.d.ts +0 -6
  146. package/esm/sql-objects/operators/op-not.d.ts +0 -11
  147. package/esm/sql-objects/operators/op-or.d.ts +0 -5
  148. package/esm/sql-objects/order-column.d.ts +0 -9
  149. package/esm/sql-objects/param-expression.d.ts +0 -23
  150. package/esm/sql-objects/raw-statement.d.ts +0 -9
  151. package/esm/sql-objects/returning-column.d.ts +0 -9
  152. package/esm/sql-objects/sequence-getter-statement.d.ts +0 -24
  153. package/esm/sql-objects/string-agg-statement.d.ts +0 -31
  154. package/esm/sql-objects/table-name.d.ts +0 -11
  155. package/esm/sql-objects/upper-statement.d.ts +0 -22
  156. package/esm/sqlobject.initializers.d.ts +0 -55
  157. package/esm/typeguards.d.ts +0 -36
  158. package/esm/types.d.ts +0 -33
@@ -1,14 +0,0 @@
1
- import { DataType, SerializationType } from '../enums.js';
2
- import { SerializeContext } from '../serialize-context.js';
3
- import { BaseField } from './base-field.js';
4
- export declare class FieldExpression extends BaseField {
5
- _alias?: string;
6
- constructor(expression: string, dataType?: DataType, isArray?: boolean);
7
- constructor(args: {
8
- expression: string;
9
- dataType?: DataType;
10
- isArray?: boolean;
11
- });
12
- get _type(): SerializationType;
13
- _serialize(ctx: SerializeContext): string;
14
- }
@@ -1,8 +0,0 @@
1
- import { SerializationType } from '../enums.js';
2
- import { SerializeContext } from '../serialize-context.js';
3
- import { BaseField } from './base-field.js';
4
- export declare class GroupColumn extends BaseField {
5
- constructor(value: string);
6
- get _type(): SerializationType;
7
- _serialize(ctx: SerializeContext): string;
8
- }
@@ -1,17 +0,0 @@
1
- import { JoinType, SerializationType } from '../enums.js';
2
- import { SelectQuery } from '../query/select-query.js';
3
- import { Serializable } from '../serializable.js';
4
- import { SerializeContext } from '../serialize-context.js';
5
- import { LogicalOperator } from './operators/logical-operator.js';
6
- import { RawStatement } from './raw-statement.js';
7
- import { TableName } from './table-name.js';
8
- export declare class JoinStatement extends Serializable {
9
- _joinType: JoinType;
10
- _table: TableName | SelectQuery | RawStatement;
11
- _conditions: LogicalOperator;
12
- constructor(joinType: JoinType, table: string | TableName | SelectQuery | RawStatement);
13
- get _type(): SerializationType;
14
- on(...conditions: Serializable[]): this;
15
- _serialize(ctx: SerializeContext): string;
16
- protected __serializeConditions(ctx: any, join: JoinStatement): any;
17
- }
@@ -1,22 +0,0 @@
1
- import { SerializationType } from '../enums.js';
2
- import { Serializable } from '../serializable.js';
3
- import { SerializeContext } from '../serialize-context.js';
4
- export declare class LowerStatement extends Serializable {
5
- _expression: any;
6
- _alias?: string;
7
- constructor(expression: any);
8
- get _type(): SerializationType;
9
- /**
10
- * Sets alias to case expression.
11
- */
12
- as(alias: string): this;
13
- /**
14
- * Performs serialization
15
- *
16
- * @param {Object} ctx
17
- * @return {string}
18
- * @override
19
- */
20
- _serialize(ctx: SerializeContext): string;
21
- protected __defaultSerialize(ctx: SerializeContext, o: any): string;
22
- }
@@ -1,22 +0,0 @@
1
- import { SerializationType } from '../enums.js';
2
- import { Serializable } from '../serializable.js';
3
- import { SerializeContext } from '../serialize-context.js';
4
- export declare class MaxStatement extends Serializable {
5
- _expression: any;
6
- _alias?: string;
7
- constructor(expression: any);
8
- get _type(): SerializationType;
9
- /**
10
- * Sets alias to case expression.
11
- */
12
- as(alias: string): this;
13
- /**
14
- * Performs serialization
15
- *
16
- * @param {Object} ctx
17
- * @return {string}
18
- * @override
19
- */
20
- _serialize(ctx: SerializeContext): string;
21
- protected __defaultSerialize(ctx: SerializeContext, o: any): string;
22
- }
@@ -1,22 +0,0 @@
1
- import { SerializationType } from '../enums.js';
2
- import { Serializable } from '../serializable.js';
3
- import { SerializeContext } from '../serialize-context.js';
4
- export declare class MinStatement extends Serializable {
5
- _expression: any;
6
- _alias?: string;
7
- constructor(expression: any);
8
- get _type(): SerializationType;
9
- /**
10
- * Sets alias to case expression.
11
- */
12
- as(alias: string): this;
13
- /**
14
- * Performs serialization
15
- *
16
- * @param {Object} ctx
17
- * @return {string}
18
- * @override
19
- */
20
- _serialize(ctx: SerializeContext): string;
21
- protected __defaultSerialize(ctx: SerializeContext, o: any): string;
22
- }
@@ -1,5 +0,0 @@
1
- import { OperatorType } from '../enums.js';
2
- import { Serializable } from '../serializable.js';
3
- export declare abstract class Operator extends Serializable {
4
- abstract _operatorType: OperatorType;
5
- }
@@ -1,16 +0,0 @@
1
- import { SerializationType } from '../../enums.js';
2
- import { Serializable } from '../../serializable.js';
3
- import { SerializeContext } from '../../serialize-context.js';
4
- import { Operator } from '../operator.js';
5
- export declare abstract class CompOperator extends Operator {
6
- _left: Serializable | string;
7
- _right?: any | Serializable;
8
- _symbol?: string;
9
- _isArray?: boolean;
10
- protected constructor(left: string | Serializable, right?: any);
11
- get _type(): SerializationType;
12
- _serialize(ctx: SerializeContext): string;
13
- protected __serializeItem(ctx: SerializeContext, x: any, isRight?: boolean): any;
14
- protected __serialize(ctx: SerializeContext, o: any): string;
15
- protected __defaultSerialize(ctx: SerializeContext, o: any): string;
16
- }
@@ -1,16 +0,0 @@
1
- import { SerializationType } from '../../enums.js';
2
- import { Serializable } from '../../serializable.js';
3
- import { SerializeContext } from '../../serialize-context.js';
4
- import { Operator } from '../operator.js';
5
- export declare const WrapOps: {};
6
- export declare abstract class LogicalOperator extends Operator {
7
- _items: Serializable[];
8
- constructor(...expressions: any[]);
9
- get _type(): SerializationType;
10
- /**
11
- * Adds operator(s) to item list
12
- */
13
- add(...expressions: (LogicalOperator | any)[]): this;
14
- _serialize(ctx: SerializeContext): string;
15
- private _wrapObject;
16
- }
@@ -1,5 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { LogicalOperator } from './logical-operator.js';
3
- export declare class OpAnd extends LogicalOperator {
4
- _operatorType: OperatorType;
5
- }
@@ -1,11 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { Serializable } from '../../serializable.js';
3
- import { SerializeContext } from '../../serialize-context.js';
4
- import { CompOperator } from './comp-operator.js';
5
- export declare class OpBetween extends CompOperator {
6
- _operatorType: OperatorType;
7
- _symbol: string;
8
- constructor(left: string | Serializable, right: any[]);
9
- _serialize(ctx: SerializeContext): string;
10
- __defaultSerialize(ctx: any, o: any): string;
11
- }
@@ -1,8 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { Serializable } from '../../serializable.js';
3
- import { CompOperator } from './comp-operator.js';
4
- export declare class OpEq extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right: any);
8
- }
@@ -1,11 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { SelectQuery } from '../../query/select-query.js';
3
- import { SerializeContext } from '../../serialize-context.js';
4
- import { CompOperator } from './comp-operator.js';
5
- export declare class OpExists extends CompOperator {
6
- _operatorType: OperatorType;
7
- _symbol: string;
8
- constructor(query: SelectQuery);
9
- _serialize(ctx: SerializeContext): string;
10
- protected __defaultSerialize(ctx: SerializeContext, o: any): string;
11
- }
@@ -1,8 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { Serializable } from '../../serializable.js';
3
- import { CompOperator } from './comp-operator.js';
4
- export declare class OpGt extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,8 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { Serializable } from '../../serializable.js';
3
- import { CompOperator } from './comp-operator.js';
4
- export declare class OpGte extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,6 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { OpLike } from './op-like.js';
3
- export declare class OpILike extends OpLike {
4
- _operatorType: OperatorType;
5
- _symbol: string;
6
- }
@@ -1,9 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { SerializeContext } from '../../serialize-context.js';
3
- import { CompOperator } from './comp-operator.js';
4
- export declare class OpIn extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: any, right: any);
8
- _serialize(ctx: SerializeContext): string;
9
- }
@@ -1,8 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { Serializable } from '../../serializable.js';
3
- import { CompOperator } from './comp-operator.js';
4
- export declare class OpIsNot extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,8 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { Serializable } from '../../serializable.js';
3
- import { CompOperator } from './comp-operator.js';
4
- export declare class OpIs extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,10 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { Serializable } from '../../serializable.js';
3
- import { SerializeContext } from '../../serialize-context.js';
4
- import { CompOperator } from './comp-operator.js';
5
- export declare class OpLike extends CompOperator {
6
- _operatorType: OperatorType;
7
- _symbol: string;
8
- constructor(left: string | Serializable, right?: any);
9
- protected __serialize(ctx: SerializeContext, o: any): string;
10
- }
@@ -1,8 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { Serializable } from '../../serializable.js';
3
- import { CompOperator } from './comp-operator.js';
4
- export declare class OpLt extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,8 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { Serializable } from '../../serializable.js';
3
- import { CompOperator } from './comp-operator.js';
4
- export declare class OpLte extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,8 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { Serializable } from '../../serializable.js';
3
- import { CompOperator } from './comp-operator.js';
4
- export declare class OpNe extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,6 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { OpBetween } from './op-between.js';
3
- export declare class OpNotBetween extends OpBetween {
4
- _operatorType: OperatorType;
5
- _symbol: string;
6
- }
@@ -1,6 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { OpExists } from './op-exists.js';
3
- export declare class OpNotExists extends OpExists {
4
- _operatorType: OperatorType;
5
- _symbol: string;
6
- }
@@ -1,6 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { OpILike } from './op-ilike.js';
3
- export declare class OpNotILike extends OpILike {
4
- _operatorType: OperatorType;
5
- _symbol: string;
6
- }
@@ -1,6 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { OpIn } from './op-in.js';
3
- export declare class OpNotIn extends OpIn {
4
- _operatorType: OperatorType;
5
- _symbol: string;
6
- }
@@ -1,6 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { OpLike } from './op-like.js';
3
- export declare class OpNotLike extends OpLike {
4
- _operatorType: OperatorType;
5
- _symbol: string;
6
- }
@@ -1,11 +0,0 @@
1
- import { OperatorType, SerializationType } from '../../enums.js';
2
- import { Serializable } from '../../serializable.js';
3
- import { SerializeContext } from '../../serialize-context.js';
4
- import { Operator } from '../operator.js';
5
- export declare class OpNot extends Operator {
6
- _operatorType: OperatorType;
7
- _expression: Serializable;
8
- constructor(expression: Serializable);
9
- get _type(): SerializationType;
10
- _serialize(ctx: SerializeContext): string;
11
- }
@@ -1,5 +0,0 @@
1
- import { OperatorType } from '../../enums.js';
2
- import { LogicalOperator } from './logical-operator.js';
3
- export declare class OpOr extends LogicalOperator {
4
- _operatorType: OperatorType;
5
- }
@@ -1,9 +0,0 @@
1
- import { SerializationType } from '../enums.js';
2
- import { SerializeContext } from '../serialize-context.js';
3
- import { BaseField } from './base-field.js';
4
- export declare class OrderColumn extends BaseField {
5
- _descending?: boolean;
6
- constructor(value: string);
7
- get _type(): SerializationType;
8
- _serialize(ctx: SerializeContext): string;
9
- }
@@ -1,23 +0,0 @@
1
- import { DataType, SerializationType } from '../enums.js';
2
- import { Serializable } from '../serializable.js';
3
- import { SerializeContext } from '../serialize-context.js';
4
- export declare class ParamExpression extends Serializable {
5
- _name: string;
6
- _dataType?: DataType;
7
- _isArray?: boolean;
8
- constructor(arg: string | {
9
- name: string;
10
- dataType?: DataType;
11
- isArray?: boolean;
12
- });
13
- get _type(): SerializationType;
14
- /**
15
- * Performs serialization
16
- */
17
- _serialize(ctx: SerializeContext): string;
18
- protected __defaultSerialize(ctx: SerializeContext, o: {
19
- name: string;
20
- dataType?: DataType;
21
- isArray?: boolean;
22
- }): string;
23
- }
@@ -1,9 +0,0 @@
1
- import { SerializationType } from '../enums.js';
2
- import { Serializable } from '../serializable.js';
3
- import { SerializeContext } from '../serialize-context.js';
4
- export declare class RawStatement extends Serializable {
5
- _text: string;
6
- constructor(str: string);
7
- get _type(): SerializationType;
8
- _serialize(ctx: SerializeContext): string;
9
- }
@@ -1,9 +0,0 @@
1
- import { SerializationType } from '../enums.js';
2
- import { SerializeContext } from '../serialize-context.js';
3
- import { BaseField } from './base-field.js';
4
- export declare class ReturningColumn extends BaseField {
5
- _alias: string;
6
- constructor(field: string);
7
- get _type(): SerializationType;
8
- _serialize(ctx: SerializeContext): string;
9
- }
@@ -1,24 +0,0 @@
1
- import { SerializationType } from '../enums.js';
2
- import { Serializable } from '../serializable.js';
3
- import { SerializeContext } from '../serialize-context.js';
4
- export declare class SequenceGetterStatement extends Serializable {
5
- _expression: string;
6
- _next: boolean;
7
- _alias?: string;
8
- constructor(expression: string, next?: boolean);
9
- get _type(): SerializationType;
10
- next(value: boolean): this;
11
- /**
12
- * Sets alias to case expression.
13
- */
14
- as(alias: string): this;
15
- /**
16
- * Performs serialization
17
- *
18
- * @param {Object} ctx
19
- * @return {string}
20
- * @override
21
- */
22
- _serialize(ctx: SerializeContext): string;
23
- protected __defaultSerialize(ctx: SerializeContext, o: any): string;
24
- }
@@ -1,31 +0,0 @@
1
- import { SerializationType } from '../enums.js';
2
- import { Serializable } from '../serializable.js';
3
- import { SerializeContext } from '../serialize-context.js';
4
- import { OrderColumn } from './order-column.js';
5
- export declare class StringAGGStatement extends Serializable {
6
- _field: Serializable;
7
- _delimiter: string;
8
- _orderBy?: (OrderColumn | Serializable)[];
9
- _alias?: string;
10
- constructor(field: string | Serializable, delimiter?: string);
11
- get _type(): SerializationType;
12
- delimiter(value: string): this;
13
- /**
14
- * Defines "order by" part of StringAGG.
15
- */
16
- orderBy(...field: (string | Serializable)[]): this;
17
- /**
18
- * Sets alias to case expression.
19
- */
20
- as(alias: string): this;
21
- /**
22
- * Performs serialization
23
- *
24
- * @param {Object} ctx
25
- * @return {string}
26
- * @override
27
- */
28
- _serialize(ctx: SerializeContext): string;
29
- protected __serializeOrderColumns(ctx: SerializeContext): string;
30
- protected __defaultSerialize(ctx: SerializeContext, o: any): string;
31
- }
@@ -1,11 +0,0 @@
1
- import { SerializationType } from '../enums.js';
2
- import { Serializable } from '../serializable.js';
3
- import { SerializeContext } from '../serialize-context.js';
4
- export declare class TableName extends Serializable {
5
- schema?: string;
6
- table?: string;
7
- alias?: string;
8
- constructor(tableName: string);
9
- get _type(): SerializationType;
10
- _serialize(ctx: SerializeContext): string;
11
- }
@@ -1,22 +0,0 @@
1
- import { SerializationType } from '../enums.js';
2
- import { Serializable } from '../serializable.js';
3
- import { SerializeContext } from '../serialize-context.js';
4
- export declare class UpperStatement extends Serializable {
5
- _expression: any;
6
- _alias?: string;
7
- constructor(expression: any);
8
- get _type(): SerializationType;
9
- /**
10
- * Sets alias to case expression.
11
- */
12
- as(alias: string): this;
13
- /**
14
- * Performs serialization
15
- *
16
- * @param {Object} ctx
17
- * @return {string}
18
- * @override
19
- */
20
- _serialize(ctx: SerializeContext): string;
21
- protected __defaultSerialize(ctx: SerializeContext, o: any): string;
22
- }
@@ -1,55 +0,0 @@
1
- import { DataType } from './enums.js';
2
- import { DeleteQuery } from './query/delete-query.js';
3
- import { InsertQuery } from './query/insert-query.js';
4
- import { SelectQuery } from './query/select-query.js';
5
- import { UpdateQuery } from './query/update-query.js';
6
- import { Serializable } from './serializable.js';
7
- import { CaseStatement } from './sql-objects/case-statement.js';
8
- import { CoalesceStatement } from './sql-objects/coalesce-statement.js';
9
- import { CountStatement } from './sql-objects/count-statement.js';
10
- import { FieldExpression } from './sql-objects/field-expression.js';
11
- import { JoinStatement } from './sql-objects/join-statement.js';
12
- import { LowerStatement } from './sql-objects/lower-statement.js';
13
- import { MaxStatement } from './sql-objects/max-statement.js';
14
- import { MinStatement } from './sql-objects/min-statement.js';
15
- import { ParamExpression } from './sql-objects/param-expression.js';
16
- import { RawStatement } from './sql-objects/raw-statement.js';
17
- import { SequenceGetterStatement } from './sql-objects/sequence-getter-statement.js';
18
- import { StringAGGStatement } from './sql-objects/string-agg-statement.js';
19
- import { UpperStatement } from './sql-objects/upper-statement.js';
20
- export declare function Raw(text: string): RawStatement;
21
- export declare function Select(...column: (string | string[] | Serializable)[]): SelectQuery;
22
- export declare function Insert(tableName: string | RawStatement, input: any): InsertQuery;
23
- export declare function Update(tableName: string | RawStatement, input: any): UpdateQuery;
24
- export declare function Delete(tableName: string | RawStatement): DeleteQuery;
25
- export declare function Join(table: string | SelectQuery | RawStatement): JoinStatement;
26
- export declare function InnerJoin(table: string | SelectQuery | RawStatement): JoinStatement;
27
- export declare function LeftJoin(table: string | SelectQuery | RawStatement): JoinStatement;
28
- export declare function LeftOuterJoin(table: string | SelectQuery | RawStatement): JoinStatement;
29
- export declare function RightJoin(table: string | SelectQuery | RawStatement): JoinStatement;
30
- export declare function RightOuterJoin(table: string | SelectQuery | RawStatement): JoinStatement;
31
- export declare function OuterJoin(table: string | SelectQuery | RawStatement): JoinStatement;
32
- export declare function FullOuterJoin(table: string | SelectQuery | RawStatement): JoinStatement;
33
- export declare function CrossJoin(table: string | SelectQuery | RawStatement): JoinStatement;
34
- export declare function Case(): CaseStatement;
35
- export declare function Coalesce(...expressions: any[]): CoalesceStatement;
36
- export declare function Lower(expression: any): LowerStatement;
37
- export declare function Upper(expression: any): UpperStatement;
38
- export declare function Min(expression: any): MinStatement;
39
- export declare function Max(expression: any): MaxStatement;
40
- export declare function StringAGG(field: any): StringAGGStatement;
41
- export declare function Count(): CountStatement;
42
- export declare function SequenceNext(expression: string): SequenceGetterStatement;
43
- export declare function SequenceCurr(expression: string): SequenceGetterStatement;
44
- export declare function Param(name: string, dataType?: DataType, isArray?: boolean): ParamExpression;
45
- export declare function Param(args: {
46
- name: string;
47
- dataType?: DataType;
48
- isArray?: boolean;
49
- }): ParamExpression;
50
- export declare function Field(name: string, dataType?: DataType, isArray?: boolean): FieldExpression;
51
- export declare function Field(args: {
52
- name: string;
53
- dataType?: DataType;
54
- isArray?: boolean;
55
- }): FieldExpression;
@@ -1,36 +0,0 @@
1
- import type { DeleteQuery } from './query/delete-query.js';
2
- import type { InsertQuery } from './query/insert-query.js';
3
- import type { SelectQuery } from './query/select-query.js';
4
- import type { UpdateQuery } from './query/update-query.js';
5
- import { Serializable } from './serializable.js';
6
- import type { CaseStatement } from './sql-objects/case-statement.js';
7
- import { CountStatement } from './sql-objects/count-statement.js';
8
- import type { FieldExpression } from './sql-objects/field-expression.js';
9
- import type { GroupColumn } from './sql-objects/group-column.js';
10
- import type { JoinStatement } from './sql-objects/join-statement.js';
11
- import type { CompOperator } from './sql-objects/operators/comp-operator.js';
12
- import type { LogicalOperator } from './sql-objects/operators/logical-operator.js';
13
- import type { OrderColumn } from './sql-objects/order-column.js';
14
- import type { ParamExpression } from './sql-objects/param-expression.js';
15
- import type { RawStatement } from './sql-objects/raw-statement.js';
16
- import type { ReturningColumn } from './sql-objects/returning-column.js';
17
- import type { TableName } from './sql-objects/table-name.js';
18
- export declare function isSerializable(value: any): value is Serializable;
19
- export declare function isQuery(value: any): value is Serializable;
20
- export declare function isRawStatement(value: any): value is RawStatement;
21
- export declare function isSelectQuery(value: any): value is SelectQuery;
22
- export declare function isInsertQuery(value: any): value is InsertQuery;
23
- export declare function isIUpdateQuery(value: any): value is UpdateQuery;
24
- export declare function isDeleteQuery(value: any): value is DeleteQuery;
25
- export declare function isJoinStatement(value: any): value is JoinStatement;
26
- export declare function isCaseStatement(value: any): value is CaseStatement;
27
- export declare function isCountStatement(value: any): value is CountStatement;
28
- export declare function isParamExpression(value: any): value is ParamExpression;
29
- export declare function isLogicalOperator(value: any): value is LogicalOperator;
30
- export declare function isCompOperator(value: any): value is CompOperator;
31
- export declare function isNotOperator(value: any): value is CompOperator;
32
- export declare function isSelectColumn(value: any): value is FieldExpression;
33
- export declare function isOrderColumn(value: any): value is OrderColumn;
34
- export declare function isGroupColumn(value: any): value is GroupColumn;
35
- export declare function isReturningColumn(value: any): value is ReturningColumn;
36
- export declare function isTableName(value: any): value is TableName;
package/esm/types.d.ts DELETED
@@ -1,33 +0,0 @@
1
- import { DataType, SerializationType } from './enums.js';
2
- import type { SerializeContext } from './serialize-context.js';
3
- export type SerializeFunction = (ctx: SerializeContext, type: SerializationType | string, obj: any, defFn: DefaultSerializeFunction) => string | undefined;
4
- export type DefaultSerializeFunction = (ctx: SerializeContext, o: any) => string;
5
- export 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
- }