plugin-postgresql-connector
Version:
NocoBase plugin for connecting to external PostgreSQL databases
38 lines • 1.4 kB
TypeScript
export interface ConnectionConfig {
name: string;
host: string;
port: number;
database: string;
username: string;
password: string;
ssl: boolean;
}
export interface Connection extends ConnectionConfig {
id: string;
isActive: boolean;
createdAt?: string;
updatedAt?: string;
}
export declare const useConnection: () => {
connections: Connection[];
selectedConnection: string;
setSelectedConnection: import("react").Dispatch<import("react").SetStateAction<string>>;
loadingConnections: boolean;
testingConnection: boolean;
creatingConnection: boolean;
updatingConnection: boolean;
deletingConnection: boolean;
refreshConnections: (...params: any) => void;
testConnection: (...params: any) => void;
createConnection: (...params: any) => void;
updateConnection: (...params: any) => void;
deleteConnection: (...params: any) => void;
testAndCreateConnection: (config: ConnectionConfig) => Promise<void>;
testAndUpdateConnection: (id: string, config: ConnectionConfig) => Promise<void>;
getConnectionById: (id: string) => Connection | undefined;
getActiveConnections: () => Connection[];
connectionExists: (name: string) => boolean;
validateConnectionConfig: (config: Partial<ConnectionConfig>) => string[];
};
export default useConnection;
//# sourceMappingURL=useConnection.d.ts.map