UNPKG

casbin-pg-adapter-with-schema

Version:

PostgreSQL native adapter for Node-Casbin with advanced filter capability and improved performance.

35 lines (34 loc) 1.05 kB
/// <reference types="node" /> import { Duplex } from "stream"; import { ConnectionOptions } from "tls"; export declare type CasbinRuleFilter = Array<string | null | undefined>; export declare type CasbinFilter = Record<string, CasbinRuleFilter>; export interface CasbinRule { ptype: string; rule: string[]; } export interface PostgresAdapaterOptions { migrate?: boolean; dbClient?: (exec: (client: any) => Promise<any>) => Promise<any>; user?: string; database?: string; schema?: string; tableName?: string; password?: string; port?: number; host?: string; connectionString?: string; keepAlive?: boolean; stream?: Duplex; statement_timeout?: false | number; parseInputDatesAsUTC?: boolean; ssl?: boolean | ConnectionOptions; query_timeout?: number; keepAliveInitialDelayMillis?: number; idle_in_transaction_session_timeout?: number; poolSize?: number; poolIdleTimeout?: number; reapIntervalMillis?: number; binary?: boolean; parseInt8?: boolean; }