mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
⚡ Open edit window for SQL query fields (#2188)
This commit is contained in:
parent
455db990d6
commit
f03833ff25
|
@ -72,7 +72,7 @@ export class CrateDb implements INodeType {
|
||||||
name: 'query',
|
name: 'query',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
rows: 5,
|
alwaysOpenEditWindow: true,
|
||||||
},
|
},
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
|
|
@ -91,7 +91,7 @@ export class MicrosoftSql implements INodeType {
|
||||||
name: 'query',
|
name: 'query',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
rows: 5,
|
alwaysOpenEditWindow: true,
|
||||||
},
|
},
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
|
|
@ -65,7 +65,7 @@ export class MySql implements INodeType {
|
||||||
name: 'query',
|
name: 'query',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
rows: 5,
|
alwaysOpenEditWindow: true,
|
||||||
},
|
},
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
@ -295,12 +295,12 @@ export class MySql implements INodeType {
|
||||||
const options = this.getNodeParameter('options', 0) as IDataObject;
|
const options = this.getNodeParameter('options', 0) as IDataObject;
|
||||||
const insertIgnore = options.ignore as boolean;
|
const insertIgnore = options.ignore as boolean;
|
||||||
const insertPriority = options.priority as string;
|
const insertPriority = options.priority as string;
|
||||||
|
|
||||||
const insertSQL = `INSERT ${insertPriority || ''} ${insertIgnore ? 'IGNORE' : ''} INTO ${table}(${columnString}) VALUES ${items.map(item => insertPlaceholder).join(',')};`;
|
const insertSQL = `INSERT ${insertPriority || ''} ${insertIgnore ? 'IGNORE' : ''} INTO ${table}(${columnString}) VALUES ${items.map(item => insertPlaceholder).join(',')};`;
|
||||||
const queryItems = insertItems.reduce((collection, item) => collection.concat(Object.values(item as any)), []); // tslint:disable-line:no-any
|
const queryItems = insertItems.reduce((collection, item) => collection.concat(Object.values(item as any)), []); // tslint:disable-line:no-any
|
||||||
|
|
||||||
const queryResult = await connection.query(insertSQL, queryItems);
|
const queryResult = await connection.query(insertSQL, queryItems);
|
||||||
|
|
||||||
returnItems = this.helpers.returnJsonArray(queryResult[0] as unknown as IDataObject);
|
returnItems = this.helpers.returnJsonArray(queryResult[0] as unknown as IDataObject);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (this.continueOnFail()) {
|
if (this.continueOnFail()) {
|
||||||
|
|
|
@ -65,7 +65,7 @@ export class Postgres implements INodeType {
|
||||||
name: 'query',
|
name: 'query',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
rows: 5,
|
alwaysOpenEditWindow: true,
|
||||||
},
|
},
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
|
|
@ -63,7 +63,7 @@ export class QuestDb implements INodeType {
|
||||||
name: 'query',
|
name: 'query',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
rows: 5,
|
alwaysOpenEditWindow: true,
|
||||||
},
|
},
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
|
|
@ -72,7 +72,7 @@ export class Snowflake implements INodeType {
|
||||||
name: 'query',
|
name: 'query',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
rows: 5,
|
alwaysOpenEditWindow: true,
|
||||||
},
|
},
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
|
|
@ -72,7 +72,7 @@ export class TimescaleDb implements INodeType {
|
||||||
name: 'query',
|
name: 'query',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
rows: 5,
|
alwaysOpenEditWindow: true,
|
||||||
},
|
},
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
|
Loading…
Reference in a new issue