matrix-appservice-bridge
    Preparing search index...

    Interface PostgresStoreOpts

    interface PostgresStoreOpts {
        autocreateSchemaTable?: boolean;
        backoff?: boolean | ((attemptNum: number) => number);
        connect_timeout?: number;
        connection?: Partial<ConnectionParameters>;
        database?: string;
        db?: string;
        debug?:
            | boolean
            | (
                (
                    connection: number,
                    query: string,
                    parameters: any[],
                    paramTypes: any[],
                ) => void
            );
        fetch_types?: boolean;
        host?: string;
        hostname?: string;
        idle_timeout?: number;
        keep_alive?: null | number;
        max?: number;
        max_lifetime?: null | number;
        no_prepare?: boolean;
        onclose?: (connId: number) => void;
        onnotice?: (notice: Notice) => void;
        onparameter?: (key: string, value: any) => void;
        pass?: string | (() => string | Promise<string>);
        password?: string | (() => string | Promise<string>);
        path?: string;
        port?: number;
        prepare?: boolean;
        publications?: string;
        ssl?: boolean | object | "allow" | "require" | "prefer" | "verify-full";
        target_session_attrs?:
            | "read-write"
            | "read-only"
            | "primary"
            | "standby"
            | "prefer-standby";
        timeout?: number;
        transform?: {
            column?: | {
                from?: (column: string) => string;
                to?: (column: string) => string;
            }
            | ((column: string) => string);
            row?: { from?: (row: Row) => any } | ((row: Row) => any);
            undefined?: any;
            value?:
                | { from?: (value: unknown, column: Column<string>) => any }
                | ((value: any) => any);
        };
        types?: Record<string, PostgresType<unknown>>;
        url?: string;
        user?: string;
        username?: string;
    }

    Hierarchy

    • Options<Record<string, PostgresType<unknown>>>
      • PostgresStoreOpts
    Index

    Properties

    autocreateSchemaTable?: boolean

    Should the schema table be automatically created (the v0 schema effectively). Defaults to true.

    backoff?: boolean | ((attemptNum: number) => number)
    connect_timeout?: number

    Connect timeout in seconds

    process.env['PGCONNECT_TIMEOUT']
    
    connection?: Partial<ConnectionParameters>

    Connection parameters

    database?: string

    Name of database to connect to

    process.env['PGDATABASE'] || options.user
    
    db?: string

    Name of database to connect to (an alias for database)

    debug?:
        | boolean
        | (
            (
                connection: number,
                query: string,
                parameters: any[],
                paramTypes: any[],
            ) => void
        )

    Is called with (connection; query; parameters)

    fetch_types?: boolean

    Automatically fetches types on connect

    true
    
    host?: string
    hostname?: string

    Postgres ip address or domain name (an alias for host)

    idle_timeout?: number

    Idle connection timeout in seconds

    process.env['PGIDLE_TIMEOUT']
    
    keep_alive?: null | number
    max?: number

    Max number of connections

    10
    
    max_lifetime?: null | number
    no_prepare?: boolean

    Disable prepared mode

    use "prepare" option instead

    onclose?: (connId: number) => void
    onnotice?: (notice: Notice) => void

    Called when a notice is received

    console.log
    
    onparameter?: (key: string, value: any) => void

    (key; value) when a server param change

    pass?: string | (() => string | Promise<string>)

    Password of database user (an alias for password)

    password?: string | (() => string | Promise<string>)

    Password of database user

    process.env['PGPASSWORD']
    
    path?: string
    port?: number
    prepare?: boolean

    Enables prepare mode.

    true
    
    publications?: string

    Publications to subscribe to (only relevant when calling sql.subscribe())

    'alltables'
    
    ssl?: boolean | object | "allow" | "require" | "prefer" | "verify-full"

    How to deal with ssl (can be a tls.connect option object)

    false
    
    target_session_attrs?:
        | "read-write"
        | "read-only"
        | "primary"
        | "standby"
        | "prefer-standby"

    Use 'read-write' with multiple hosts to ensure only connecting to primary

    process.env['PGTARGETSESSIONATTRS']
    
    timeout?: number

    Idle connection timeout in seconds

    use "idle_timeout" option instead

    transform?: {
        column?:
            | {
                from?: (column: string) => string;
                to?: (column: string) => string;
            }
            | ((column: string) => string);
        row?: { from?: (row: Row) => any } | ((row: Row) => any);
        undefined?: any;
        value?:
            | { from?: (value: unknown, column: Column<string>) => any }
            | ((value: any) => any);
    }

    Transform hooks

    Type declaration

    • Optionalcolumn?:
          | { from?: (column: string) => string; to?: (column: string) => string }
          | ((column: string) => string)

      Transforms incoming and outgoing column names

    • Optionalrow?: { from?: (row: Row) => any } | ((row: Row) => any)

      Transforms entire rows

    • Optionalundefined?: any

      Transforms outcoming undefined values

    • Optionalvalue?:
          | { from?: (value: unknown, column: Column<string>) => any }
          | ((value: any) => any)

      Transforms incoming and outgoing row values

    types?: Record<string, PostgresType<unknown>>

    Array of custom types; see more in the README

    url?: string

    URL to reach the database on.

    user?: string

    Username of database user

    process.env['PGUSERNAME'] || process.env['PGUSER'] || require('os').userInfo().username
    
    username?: string

    Username of database user (an alias for user)