/**
 * Postgres Node - Version 1
 * Get, add and update data in Postgres
 */


export interface PostgresV1Params {
  operation?: 'executeQuery' | 'insert' | 'update';
/**
 * The SQL query to execute. You can use n8n expressions or $1 and $2 in conjunction with query parameters.
 * @displayOptions.show { operation: ["executeQuery"] }
 */
    query?: string;
/**
 * Name of the schema the table belongs to
 * @displayOptions.show { operation: ["insert"] }
 * @default public
 */
    schema?: string | Expression<string> | PlaceholderValue;
/**
 * Name of the table in which to insert data to
 * @displayOptions.show { operation: ["insert"] }
 */
    table?: string | Expression<string> | PlaceholderValue;
/**
 * Comma-separated list of the properties which should used as columns for the new rows. You can use type casting with colons (:) like id:int.
 * @displayOptions.show { operation: ["insert"] }
 */
    columns?: string | Expression<string> | PlaceholderValue;
/**
 * Comma-separated list of the properties which decides which rows in the database should be updated. Normally that would be "id".
 * @displayOptions.show { operation: ["update"] }
 * @default id
 */
    updateKey?: string | Expression<string> | PlaceholderValue;
/**
 * Comma-separated list of the fields that the operation will return
 * @displayOptions.show { operation: ["insert", "update"] }
 * @default *
 */
    returnFields?: string | Expression<string> | PlaceholderValue;
  additionalFields?: {
    /** The way queries should be sent to database. Can be used in conjunction with &lt;b&gt;Continue on Fail&lt;/b&gt;. See &lt;a href="https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.postgres/"&gt;the docs&lt;/a&gt; for more examples
     * @default multiple
     */
    mode?: 'independently' | 'multiple' | 'transaction' | Expression<string>;
    /** Output Large-Format Numbers As
     * @hint Applies to NUMERIC and BIGINT columns only
     * @default text
     */
    largeNumbersOutput?: 'numbers' | 'text' | Expression<string>;
    /** Comma-separated list of properties which should be used as query parameters
     * @displayOptions.show { /operation: ["executeQuery"] }
     */
    queryParams?: string | Expression<string> | PlaceholderValue;
  };
}

export interface PostgresV1Credentials {
  postgres: CredentialReference;
}

interface PostgresV1NodeBase {
  type: 'n8n-nodes-base.postgres';
  version: 1;
  credentials?: PostgresV1Credentials;
}

export type PostgresV1ParamsNode = PostgresV1NodeBase & {
  config: NodeConfig<PostgresV1Params>;
};

export type PostgresV1Node = PostgresV1ParamsNode;