Add connection timeout to credentials (MSSQL Node) (#1517)

This commit is contained in:
Ricardo Espinoza 2021-03-07 08:02:26 -05:00 committed by GitHub
parent f0c1809adc
commit e8d77aea47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 136 additions and 5 deletions

View file

@ -50,5 +50,12 @@ export class MicrosoftSql implements ICredentialType {
type: 'boolean' as NodePropertyTypes,
default: true,
},
{
displayName: 'Connect Timeout',
name: 'connectTimeout',
type: 'number' as NodePropertyTypes,
default: 15000,
description: 'Connection timeout in ms.',
},
];
}

View file

@ -1,4 +1,7 @@
import { IExecuteFunctions } from 'n8n-core';
import {
IExecuteFunctions,
} from 'n8n-core';
import {
IDataObject,
INodeExecutionData,
@ -6,11 +9,16 @@ import {
INodeTypeDescription,
} from 'n8n-workflow';
import { chunk, flatten } from '../../utils/utilities';
import {
chunk,
flatten,
} from '../../utils/utilities';
import * as mssql from 'mssql';
import { ITables } from './TableInterface';
import {
ITables,
} from './TableInterface';
import {
copyInputItem,
@ -26,13 +34,13 @@ export class MicrosoftSql implements INodeType {
description: INodeTypeDescription = {
displayName: 'Microsoft SQL',
name: 'microsoftSql',
icon: 'file:mssql.png',
icon: 'file:mssql.svg',
group: ['input'],
version: 1,
description: 'Gets, add and update data in Microsoft SQL.',
defaults: {
name: 'Microsoft SQL',
color: '#1d4bab',
color: '#bcbcbd',
},
inputs: ['main'],
outputs: ['main'],
@ -217,6 +225,7 @@ export class MicrosoftSql implements INodeType {
user: credentials.user as string,
password: credentials.password as string,
domain: credentials.domain ? (credentials.domain as string) : undefined,
connectTimeout: credentials.connectTimeout as number,
options: {
encrypt: credentials.tls as boolean,
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 22 KiB