pg-mvc-service 2.0.14 → 2.0.16

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.
@@ -59,6 +59,7 @@ class TableModel {
59
59
  }
60
60
  get createSqlFromJoinWhere() {
61
61
  let sql = ` FROM ${this.TableName} as "${this.TableAlias}"`;
62
+ console.log('createSqlFromJoinWhere', this.joinConditions.length);
62
63
  for (const join of this.joinConditions) {
63
64
  const joins = {
64
65
  inner: ' INNER JOIN',
@@ -67,7 +68,7 @@ class TableModel {
67
68
  };
68
69
  sql += joins[join.type];
69
70
  sql += ` ${join.model.TableName} as "${join.model.TableAlias}" ON `;
70
- console.log('createSqlFronJOin', this.vars);
71
+ console.log(join.conditions, 'createSqlFronJOin', this.vars);
71
72
  const query = WhereExpression_1.default.createCondition(join.conditions, this, this.vars.length + 1);
72
73
  console.log('createSqlFronJoin end', this.vars, query.vars);
73
74
  sql += query.expression;
@@ -209,6 +210,7 @@ class TableModel {
209
210
  * @param conditions 結合条件を指定します。条件はオブジェクトまたは文字列で指定できます。
210
211
  */
211
212
  join(joinType, joinModel, conditions) {
213
+ console.log({ type: joinType, model: joinModel, conditions: conditions }, this.joinConditions);
212
214
  this.joinConditions.push({ type: joinType, model: joinModel, conditions: conditions });
213
215
  }
214
216
  where(left, operator, right) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-mvc-service",
3
- "version": "2.0.14",
3
+ "version": "2.0.16",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/n-daira/npm-pack_mvc-service#readme",
6
6
  "bugs": {
@@ -81,6 +81,7 @@ export class TableModel {
81
81
  private get createSqlFromJoinWhere(): string {
82
82
  let sql = ` FROM ${this.TableName} as "${this.TableAlias}"`;
83
83
 
84
+ console.log('createSqlFromJoinWhere', this.joinConditions.length);
84
85
  for (const join of this.joinConditions) {
85
86
  const joins = {
86
87
  inner: ' INNER JOIN',
@@ -89,7 +90,7 @@ export class TableModel {
89
90
  }
90
91
  sql += joins[join.type];
91
92
  sql += ` ${join.model.TableName} as "${join.model.TableAlias}" ON `;
92
- console.log('createSqlFronJOin', this.vars);
93
+ console.log(join.conditions, 'createSqlFronJOin', this.vars);
93
94
  const query = WhereExpression.createCondition(join.conditions, this, this.vars.length + 1);
94
95
  console.log('createSqlFronJoin end', this.vars, query.vars);
95
96
  sql += query.expression;
@@ -249,6 +250,7 @@ export class TableModel {
249
250
  * @param conditions 結合条件を指定します。条件はオブジェクトまたは文字列で指定できます。
250
251
  */
251
252
  public join(joinType: 'left' | 'inner' | 'full', joinModel: TableModel, conditions: Array<TNestedCondition>): void {
253
+ console.log({type: joinType, model: joinModel, conditions: conditions}, this.joinConditions);
252
254
  this.joinConditions.push({type: joinType, model: joinModel, conditions: conditions});
253
255
  }
254
256