n8n/packages/nodes-base/credentials/Postgres.credentials.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

80 lines
1.4 KiB
TypeScript
Raw Permalink Normal View History

import type { ICredentialType, INodeProperties } from 'n8n-workflow';
import { sshTunnelProperties } from '@utils/sshTunnel.properties';
2019-08-21 09:44:10 -07:00
export class Postgres implements ICredentialType {
name = 'postgres';
2019-08-21 09:44:10 -07:00
displayName = 'Postgres';
documentationUrl = 'postgres';
properties: INodeProperties[] = [
2019-08-21 09:44:10 -07:00
{
displayName: 'Host',
name: 'host',
type: 'string',
2019-08-21 09:44:10 -07:00
default: 'localhost',
},
{
displayName: 'Database',
name: 'database',
type: 'string',
2019-08-21 09:44:10 -07:00
default: 'postgres',
},
{
displayName: 'User',
name: 'user',
type: 'string',
2019-08-21 09:44:10 -07:00
default: 'postgres',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
2019-08-21 09:44:10 -07:00
typeOptions: {
password: true,
},
default: '',
},
{
displayName: 'Ignore SSL Issues',
name: 'allowUnauthorizedCerts',
type: 'boolean',
default: false,
description: 'Whether to connect even if SSL certificate validation is not possible',
},
{
displayName: 'SSL',
name: 'ssl',
type: 'options',
displayOptions: {
show: {
allowUnauthorizedCerts: [false],
},
},
options: [
2020-01-14 15:26:01 -08:00
{
name: 'Allow',
value: 'allow',
2020-01-14 15:26:01 -08:00
},
{
name: 'Disable',
value: 'disable',
2020-01-14 15:26:01 -08:00
},
{
name: 'Require',
2020-01-14 15:26:01 -08:00
value: 'require',
},
],
default: 'disable',
},
2019-08-21 09:44:10 -07:00
{
displayName: 'Port',
name: 'port',
type: 'number',
2019-08-21 09:44:10 -07:00
default: 5432,
},
...sshTunnelProperties,
2019-08-21 09:44:10 -07:00
];
}