relq 1.0.51 → 1.0.53

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.
@@ -29,7 +29,8 @@ class ConnectedSelectBuilder {
29
29
  }
30
30
  setupColumnResolver() {
31
31
  const internal = this.relq[methods_1.INTERNAL];
32
- const tableDef = internal.getTableDef(this.schemaKey || this.tableName);
32
+ const tableKey = this.schemaKey || this.tableName;
33
+ const tableDef = internal.getTableDef(tableKey);
33
34
  if (!tableDef) {
34
35
  return;
35
36
  }
@@ -31,15 +31,15 @@ class DeleteBuilder {
31
31
  return conditions;
32
32
  }
33
33
  return conditions.map(cond => {
34
- if (!cond.column || cond.method === 'raw') {
35
- return cond;
36
- }
37
34
  if (cond.method === 'or' || cond.method === 'and') {
38
35
  return {
39
36
  ...cond,
40
37
  values: this.transformConditionColumns(cond.values)
41
38
  };
42
39
  }
40
+ if (!cond.column || cond.method === 'raw') {
41
+ return cond;
42
+ }
43
43
  if (cond.column.includes('.')) {
44
44
  const [tableRef, colName] = cond.column.split('.');
45
45
  return {
@@ -37,18 +37,18 @@ class SelectBuilder {
37
37
  return conditions;
38
38
  }
39
39
  return conditions.map(cond => {
40
- if (!cond.column) {
41
- return cond;
42
- }
43
- if (cond.method === 'raw') {
44
- return cond;
45
- }
46
40
  if (cond.method === 'or' || cond.method === 'and') {
47
41
  return {
48
42
  ...cond,
49
43
  values: this.transformConditionColumns(cond.values)
50
44
  };
51
45
  }
46
+ if (!cond.column) {
47
+ return cond;
48
+ }
49
+ if (cond.method === 'raw') {
50
+ return cond;
51
+ }
52
52
  if (cond.column.includes('.')) {
53
53
  const [tableRef, colName] = cond.column.split('.');
54
54
  return {
@@ -37,15 +37,15 @@ class UpdateBuilder {
37
37
  return conditions;
38
38
  }
39
39
  return conditions.map(cond => {
40
- if (!cond.column || cond.method === 'raw') {
41
- return cond;
42
- }
43
40
  if (cond.method === 'or' || cond.method === 'and') {
44
41
  return {
45
42
  ...cond,
46
43
  values: this.transformConditionColumns(cond.values)
47
44
  };
48
45
  }
46
+ if (!cond.column || cond.method === 'raw') {
47
+ return cond;
48
+ }
49
49
  if (cond.column.includes('.')) {
50
50
  const [tableRef, colName] = cond.column.split('.');
51
51
  return {
@@ -23,7 +23,8 @@ export class ConnectedSelectBuilder {
23
23
  }
24
24
  setupColumnResolver() {
25
25
  const internal = this.relq[INTERNAL];
26
- const tableDef = internal.getTableDef(this.schemaKey || this.tableName);
26
+ const tableKey = this.schemaKey || this.tableName;
27
+ const tableDef = internal.getTableDef(tableKey);
27
28
  if (!tableDef) {
28
29
  return;
29
30
  }
@@ -25,15 +25,15 @@ export class DeleteBuilder {
25
25
  return conditions;
26
26
  }
27
27
  return conditions.map(cond => {
28
- if (!cond.column || cond.method === 'raw') {
29
- return cond;
30
- }
31
28
  if (cond.method === 'or' || cond.method === 'and') {
32
29
  return {
33
30
  ...cond,
34
31
  values: this.transformConditionColumns(cond.values)
35
32
  };
36
33
  }
34
+ if (!cond.column || cond.method === 'raw') {
35
+ return cond;
36
+ }
37
37
  if (cond.column.includes('.')) {
38
38
  const [tableRef, colName] = cond.column.split('.');
39
39
  return {
@@ -31,18 +31,18 @@ export class SelectBuilder {
31
31
  return conditions;
32
32
  }
33
33
  return conditions.map(cond => {
34
- if (!cond.column) {
35
- return cond;
36
- }
37
- if (cond.method === 'raw') {
38
- return cond;
39
- }
40
34
  if (cond.method === 'or' || cond.method === 'and') {
41
35
  return {
42
36
  ...cond,
43
37
  values: this.transformConditionColumns(cond.values)
44
38
  };
45
39
  }
40
+ if (!cond.column) {
41
+ return cond;
42
+ }
43
+ if (cond.method === 'raw') {
44
+ return cond;
45
+ }
46
46
  if (cond.column.includes('.')) {
47
47
  const [tableRef, colName] = cond.column.split('.');
48
48
  return {
@@ -31,15 +31,15 @@ export class UpdateBuilder {
31
31
  return conditions;
32
32
  }
33
33
  return conditions.map(cond => {
34
- if (!cond.column || cond.method === 'raw') {
35
- return cond;
36
- }
37
34
  if (cond.method === 'or' || cond.method === 'and') {
38
35
  return {
39
36
  ...cond,
40
37
  values: this.transformConditionColumns(cond.values)
41
38
  };
42
39
  }
40
+ if (!cond.column || cond.method === 'raw') {
41
+ return cond;
42
+ }
43
43
  if (cond.column.includes('.')) {
44
44
  const [tableRef, colName] = cond.column.split('.');
45
45
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relq",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
4
4
  "description": "The Fully-Typed PostgreSQL ORM for TypeScript",
5
5
  "author": "Olajide Mathew O. <olajide.mathew@yuniq.solutions>",
6
6
  "license": "MIT",