1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

feat(PostgreSQL): Postgress connection string feature for local and server connection string

This feature is based on this [issue](https://github.com/Fabio286/antares/issues/193)  I tested with the following posgress connection strings postgresql://postgres:pgpassword@127.0.0.1:5432/my_local_databse?connection=local postgres://serveruser:serverpass@test.db.elephantsql.com/my_remote_databse?connection=server  postgres://serveruser:serverpass@test.db.elephantsql.com:5432/my_remote_databse postgresql://postgres:pgpassword@127.0.0.1:5432/my_local_databse.

The connection string decoder is loaded before "test-connection", "check-connection", and "connect"
This commit is contained in:
Topollo
2022-03-06 02:20:10 +02:00
committed by Fabio Di Stasio
parent 763be8532d
commit 6305752ad1
8 changed files with 162 additions and 16 deletions

View File

@ -1,20 +1,25 @@
'use strict';
import { ipcRenderer } from 'electron';
import connStringConstruct from '../libs/connStringDecode';
export default class {
static makeTest (params) {
static makeTest(params) {
params = connStringConstruct(params);
return ipcRenderer.invoke('test-connection', params);
}
static checkConnection (params) {
static checkConnection(params) {
params = connStringConstruct(params);
return ipcRenderer.invoke('check-connection', params);
}
static connect (params) {
static connect(params) {
params = connStringConstruct(params);
return ipcRenderer.invoke('connect', params);
}
static disconnect (uid) {
static disconnect(uid) {
return ipcRenderer.invoke('disconnect', uid);
}
}