sql-tools 0.1.3 → 0.1.4

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 (2) hide show
  1. package/bin/sql-tools.js +3 -10
  2. package/package.json +5 -2
package/bin/sql-tools.js CHANGED
@@ -171,16 +171,9 @@ SqlTools.structuredData.sqlsDeletes = function sqlsDeletes(data, structuredData,
171
171
  (data[childTable.tableName]||[]).forEach(function(childData){
172
172
  queriesArray = SqlTools.structuredData.sqlsDeletes(childData, childTable, queriesArray, childPksIndex);
173
173
  });
174
- var parentPk=childTable.pkFields.filter(function(field){
175
- return !childPksIndex[field.fieldName];
176
- }).map(function(field){ return field.fieldName; });
177
- queriesArray.push(
178
- "delete from " + SqlTools.quoteIdent(childTable.tableName) +
179
- " where " + conditionChild.join(' and ') +
180
- " and " + join1wp(parentPk) + `
181
- not in (select ${parentPk.join(', ')} from jsonb_populate_recordset(null::${SqlTools.quoteIdent(childTable.tableName)},
182
- ${SqlTools.quoteLiteral(JSON.stringify(data[childTable.tableName]))}::jsonb
183
- ));`
174
+ queriesArray.push(`
175
+ delete from ${SqlTools.quoteIdent(childTable.tableName)}
176
+ where ${conditionChild.join(' and ')}`
184
177
  );
185
178
  });
186
179
  }
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "sql-tools",
3
3
  "description": "olap for sql non-olap engines / and other tools",
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
- "repository": "codenautas/sql-tools",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/codenautas/sql-tools.git"
10
+ },
8
11
  "contributors": [
9
12
  {
10
13
  "name": "Emilio Platzer",