@sqb/builder 4.19.6 → 4.20.1
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 +2 -2
- 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 +2 -2
- 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 +4 -5
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { OperatorType } from '../../enums.js';
|
|
2
2
|
import { OpILike } from './op-ilike.js';
|
|
3
3
|
export class OpNotILike extends OpILike {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
this._operatorType = OperatorType.notILike;
|
|
7
|
-
this._symbol = 'not ilike';
|
|
8
|
-
}
|
|
4
|
+
_operatorType = OperatorType.notILike;
|
|
5
|
+
_symbol = 'not ilike';
|
|
9
6
|
}
|
|
@@ -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+)?$/);
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqb/builder",
|
|
3
3
|
"description": "Extensible multi-dialect SQL query builder written with TypeScript",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.20.1",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"debug": "^4.
|
|
8
|
+
"debug": "^4.4.1",
|
|
9
9
|
"putil-flattentext": "^2.1.1",
|
|
10
10
|
"putil-isplainobject": "^1.1.5",
|
|
11
11
|
"putil-merge": "^3.13.0",
|
|
@@ -36,12 +36,11 @@
|
|
|
36
36
|
],
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|
|
39
|
-
"url": "https://github.com/
|
|
39
|
+
"url": "https://github.com/panates/sqb.git",
|
|
40
40
|
"directory": "packages/builder"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
44
|
-
"npm": ">=7.0.0"
|
|
43
|
+
"node": ">=18.0"
|
|
45
44
|
},
|
|
46
45
|
"files": [
|
|
47
46
|
"bin/",
|