@rudsys/n8n-nodes-sqlite3 0.1.4 → 0.1.5

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.
@@ -396,7 +396,11 @@ class SqliteSsh {
396
396
  // For rename: table param is OLD name, newTableName is NEW name
397
397
  // For drop: table param is table to drop
398
398
  if (action === 'create') {
399
- const columnsDef = this.getNodeParameter('tableColumnsDefinition', i);
399
+ let columnsDef = this.getNodeParameter('tableColumnsDefinition', i);
400
+ columnsDef = columnsDef.trim();
401
+ if (columnsDef.startsWith('(') && columnsDef.endsWith(')')) {
402
+ columnsDef = columnsDef.slice(1, -1);
403
+ }
400
404
  sql = `CREATE TABLE ${table} (${columnsDef});`;
401
405
  }
402
406
  else if (action === 'rename') {
@@ -417,7 +421,11 @@ class SqliteSsh {
417
421
  else {
418
422
  const colName = escapeIdentifier(this.getNodeParameter('columnName', i));
419
423
  if (action === 'add') {
420
- const colDef = this.getNodeParameter('columnDefinition', i);
424
+ let colDef = this.getNodeParameter('columnDefinition', i);
425
+ colDef = colDef.trim();
426
+ if (colDef.startsWith('(') && colDef.endsWith(')')) {
427
+ colDef = colDef.slice(1, -1);
428
+ }
421
429
  sql = `ALTER TABLE ${table} ADD COLUMN ${colName} ${colDef};`;
422
430
  }
423
431
  else if (action === 'rename') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rudsys/n8n-nodes-sqlite3",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "n8n node for Remote SQLite operations via SSH",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/rudsys/n8n-nodes-sqlite3",