@sqb/builder 4.20.0 → 4.20.2
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/cjs/extensions.js +1 -1
- package/cjs/query/delete-query.js +2 -0
- package/cjs/query/insert-query.js +2 -0
- package/cjs/query/query.js +1 -0
- package/cjs/query/returning-query.js +1 -0
- package/cjs/query/select-query.js +10 -0
- package/cjs/query/union-query.js +2 -0
- package/cjs/query/update-query.js +3 -0
- package/cjs/serialize-context.js +68 -58
- package/cjs/sql-objects/base-field.js +4 -4
- package/cjs/sql-objects/case-statement.js +4 -0
- package/cjs/sql-objects/coalesce-statement.js +2 -0
- package/cjs/sql-objects/count-statement.js +1 -0
- package/cjs/sql-objects/expression.js +3 -0
- package/cjs/sql-objects/field-expression.js +1 -0
- package/cjs/sql-objects/join-statement.js +3 -1
- package/cjs/sql-objects/lower-statement.js +2 -0
- package/cjs/sql-objects/max-statement.js +2 -0
- package/cjs/sql-objects/min-statement.js +2 -0
- package/cjs/sql-objects/operators/comp-operator.js +4 -0
- package/cjs/sql-objects/operators/logical-operator.js +1 -1
- package/cjs/sql-objects/operators/op-and.js +1 -4
- package/cjs/sql-objects/operators/op-between.js +2 -2
- package/cjs/sql-objects/operators/op-eq.js +2 -2
- package/cjs/sql-objects/operators/op-exists.js +2 -2
- package/cjs/sql-objects/operators/op-gt.js +2 -2
- package/cjs/sql-objects/operators/op-gte.js +2 -2
- package/cjs/sql-objects/operators/op-ilike.js +2 -5
- package/cjs/sql-objects/operators/op-in.js +2 -2
- package/cjs/sql-objects/operators/op-is-not.js +2 -2
- package/cjs/sql-objects/operators/op-is.js +2 -2
- package/cjs/sql-objects/operators/op-like.js +2 -2
- package/cjs/sql-objects/operators/op-lt.js +2 -2
- package/cjs/sql-objects/operators/op-lte.js +2 -2
- package/cjs/sql-objects/operators/op-ne.js +2 -2
- package/cjs/sql-objects/operators/op-not-between.js +2 -5
- package/cjs/sql-objects/operators/op-not-exists.js +2 -5
- package/cjs/sql-objects/operators/op-not-ilike.js +2 -5
- package/cjs/sql-objects/operators/op-not-in.js +2 -5
- package/cjs/sql-objects/operators/op-not-like.js +2 -5
- package/cjs/sql-objects/operators/op-not.js +2 -1
- package/cjs/sql-objects/operators/op-or.js +1 -4
- package/cjs/sql-objects/order-column.js +1 -0
- package/cjs/sql-objects/param-expression.js +3 -0
- package/cjs/sql-objects/raw-statement.js +1 -0
- package/cjs/sql-objects/returning-column.js +1 -0
- package/cjs/sql-objects/sequence-getter-statement.js +3 -0
- package/cjs/sql-objects/string-agg-statement.js +4 -0
- package/cjs/sql-objects/table-name.js +3 -0
- package/cjs/sql-objects/upper-statement.js +2 -0
- package/esm/extensions.js +1 -1
- package/esm/query/delete-query.js +2 -0
- package/esm/query/insert-query.js +2 -0
- package/esm/query/query.js +1 -0
- package/esm/query/returning-query.js +1 -0
- package/esm/query/select-query.js +10 -0
- package/esm/query/union-query.js +2 -0
- package/esm/query/update-query.js +3 -0
- package/esm/serialize-context.js +68 -58
- package/esm/sql-objects/base-field.js +4 -4
- package/esm/sql-objects/case-statement.js +4 -0
- package/esm/sql-objects/coalesce-statement.js +2 -0
- package/esm/sql-objects/count-statement.js +1 -0
- package/esm/sql-objects/expression.js +3 -0
- package/esm/sql-objects/field-expression.js +1 -0
- package/esm/sql-objects/join-statement.js +3 -1
- package/esm/sql-objects/lower-statement.js +2 -0
- package/esm/sql-objects/max-statement.js +2 -0
- package/esm/sql-objects/min-statement.js +2 -0
- package/esm/sql-objects/operators/comp-operator.js +4 -0
- package/esm/sql-objects/operators/logical-operator.js +1 -1
- package/esm/sql-objects/operators/op-and.js +1 -4
- package/esm/sql-objects/operators/op-between.js +2 -2
- package/esm/sql-objects/operators/op-eq.js +2 -2
- package/esm/sql-objects/operators/op-exists.js +2 -2
- package/esm/sql-objects/operators/op-gt.js +2 -2
- package/esm/sql-objects/operators/op-gte.js +2 -2
- package/esm/sql-objects/operators/op-ilike.js +2 -5
- package/esm/sql-objects/operators/op-in.js +2 -2
- package/esm/sql-objects/operators/op-is-not.js +2 -2
- package/esm/sql-objects/operators/op-is.js +2 -2
- package/esm/sql-objects/operators/op-like.js +2 -2
- package/esm/sql-objects/operators/op-lt.js +2 -2
- package/esm/sql-objects/operators/op-lte.js +2 -2
- package/esm/sql-objects/operators/op-ne.js +2 -2
- package/esm/sql-objects/operators/op-not-between.js +2 -5
- package/esm/sql-objects/operators/op-not-exists.js +2 -5
- package/esm/sql-objects/operators/op-not-ilike.js +2 -5
- package/esm/sql-objects/operators/op-not-in.js +2 -5
- package/esm/sql-objects/operators/op-not-like.js +2 -5
- package/esm/sql-objects/operators/op-not.js +2 -1
- package/esm/sql-objects/operators/op-or.js +1 -4
- package/esm/sql-objects/order-column.js +1 -0
- package/esm/sql-objects/param-expression.js +3 -0
- package/esm/sql-objects/raw-statement.js +1 -0
- package/esm/sql-objects/returning-column.js +1 -0
- package/esm/sql-objects/sequence-getter-statement.js +3 -0
- package/esm/sql-objects/string-agg-statement.js +4 -0
- package/esm/sql-objects/table-name.js +3 -0
- package/esm/sql-objects/upper-statement.js +2 -0
- package/package.json +1 -1
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { OperatorType } from '../../enums.js';
|
|
2
2
|
import { OpIn } from './op-in.js';
|
|
3
3
|
export class OpNotIn extends OpIn {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
this._operatorType = OperatorType.notIn;
|
|
7
|
-
this._symbol = 'not in';
|
|
8
|
-
}
|
|
4
|
+
_operatorType = OperatorType.notIn;
|
|
5
|
+
_symbol = 'not in';
|
|
9
6
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { OperatorType } from '../../enums.js';
|
|
2
2
|
import { OpLike } from './op-like.js';
|
|
3
3
|
export class OpNotLike extends OpLike {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
this._operatorType = OperatorType.notLike;
|
|
7
|
-
this._symbol = 'not like';
|
|
8
|
-
}
|
|
4
|
+
_operatorType = OperatorType.notLike;
|
|
5
|
+
_symbol = 'not like';
|
|
9
6
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { OperatorType, SerializationType } from '../../enums.js';
|
|
2
2
|
import { Operator } from '../operator.js';
|
|
3
3
|
export class OpNot extends Operator {
|
|
4
|
+
_operatorType = OperatorType.not;
|
|
5
|
+
_expression;
|
|
4
6
|
constructor(expression) {
|
|
5
7
|
super();
|
|
6
|
-
this._operatorType = OperatorType.not;
|
|
7
8
|
this._expression = expression;
|
|
8
9
|
}
|
|
9
10
|
get _type() {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { OperatorType } from '../../enums.js';
|
|
2
2
|
import { LogicalOperator } from './logical-operator.js';
|
|
3
3
|
export class OpOr extends LogicalOperator {
|
|
4
|
-
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this._operatorType = OperatorType.or;
|
|
7
|
-
}
|
|
4
|
+
_operatorType = OperatorType.or;
|
|
8
5
|
}
|
|
@@ -2,6 +2,7 @@ import { SerializationType } from '../enums.js';
|
|
|
2
2
|
import { BaseField } from './base-field.js';
|
|
3
3
|
const ORDER_COLUMN_PATTERN = /^([-+])?((?:[a-zA-Z_][\w$]*\.){0,2})([a-zA-Z_][\w$]*|\*) *(asc|dsc|desc|ascending|descending)?$/i;
|
|
4
4
|
export class OrderColumn extends BaseField {
|
|
5
|
+
_descending;
|
|
5
6
|
constructor(value) {
|
|
6
7
|
super();
|
|
7
8
|
const m = value.match(ORDER_COLUMN_PATTERN);
|
|
@@ -2,6 +2,7 @@ import { SerializationType } from '../enums.js';
|
|
|
2
2
|
import { BaseField } from './base-field.js';
|
|
3
3
|
const RETURNING_COLUMN_PATTERN = /^([a-zA-Z_]\w*) *(?:as)? *(\w+)?$/;
|
|
4
4
|
export class ReturningColumn extends BaseField {
|
|
5
|
+
_alias;
|
|
5
6
|
constructor(field) {
|
|
6
7
|
super();
|
|
7
8
|
const m = field.match(RETURNING_COLUMN_PATTERN);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { SerializationType } from '../enums.js';
|
|
2
2
|
import { Serializable } from '../serializable.js';
|
|
3
3
|
export class SequenceGetterStatement extends Serializable {
|
|
4
|
+
_expression;
|
|
5
|
+
_next;
|
|
6
|
+
_alias;
|
|
4
7
|
constructor(expression, next) {
|
|
5
8
|
super();
|
|
6
9
|
this._expression = expression;
|
|
@@ -4,6 +4,10 @@ import { Serializable } from '../serializable.js';
|
|
|
4
4
|
import { FieldExpression } from './field-expression.js';
|
|
5
5
|
import { OrderColumn } from './order-column.js';
|
|
6
6
|
export class StringAGGStatement extends Serializable {
|
|
7
|
+
_field;
|
|
8
|
+
_delimiter;
|
|
9
|
+
_orderBy;
|
|
10
|
+
_alias;
|
|
7
11
|
constructor(field, delimiter) {
|
|
8
12
|
super();
|
|
9
13
|
this._field =
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { SerializationType } from '../enums.js';
|
|
2
2
|
import { Serializable } from '../serializable.js';
|
|
3
3
|
export class TableName extends Serializable {
|
|
4
|
+
schema;
|
|
5
|
+
table;
|
|
6
|
+
alias;
|
|
4
7
|
constructor(tableName) {
|
|
5
8
|
super();
|
|
6
9
|
const m = tableName.match(/^(?:([a-zA-Z][\w$]*)\.)? *([a-zA-Z][\w$]*) *(?:as)? *(\w+)?$/);
|