Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
0eeb13b
Branch creation
Feb 1, 2023
ae2e428
found bug fix need to eleborate
Feb 1, 2023
1e03682
added agnostic ports, usernames, and passwords from config to helper …
Feb 2, 2023
b738109
Merge pull request #1 from oslabs-beta/aya
paulinekpn Feb 2, 2023
7aaa7ce
test commit
TrevorJFerguson Feb 2, 2023
f1e3624
Merge branch 'dev' of https://github.com/oslabs-beta/SeeQR into trev
TrevorJFerguson Feb 2, 2023
24018ed
Merge branch 'dev' into pauline
Feb 2, 2023
97c76f3
syntax
utyvert Feb 2, 2023
ed290f6
fix mysql
Feb 2, 2023
fb13c9c
added permissions instructions to readme and making mysql progress
Feb 2, 2023
ee04080
comments
utyvert Feb 2, 2023
a8bc3cd
fixed mysql permissions bugs, fixed timeout issues
Feb 2, 2023
949ccf1
Merge pull request #2 from oslabs-beta/aya
paulinekpn Feb 3, 2023
4108656
Merge branch 'dev' into pauline
Feb 3, 2023
45b6ae3
..
utyvert Feb 4, 2023
61f7846
fixed a missing dbtype passed in, step 1 of dummy data bug
utyvert Feb 4, 2023
c45e06a
debugging
utyvert Feb 5, 2023
fc7b63b
zeroing in on dummy data bugs
utyvert Feb 6, 2023
d0e0ca9
fixed generate-dummy-data bug
utyvert Feb 6, 2023
0c0285d
Merge branch 'dev' into uty
Hiya-its-Aya Feb 6, 2023
72f13be
Merge pull request #3 from oslabs-beta/uty
Hiya-its-Aya Feb 6, 2023
037aa98
log changes
TrevorJFerguson Feb 6, 2023
aa32a65
still need to fix visual bugs
Feb 7, 2023
f55c602
Merge branch 'dev' into pauline
Feb 8, 2023
eb7e3fc
added controls for ertable, also added panOnScroll property
Feb 8, 2023
e62794d
Merge pull request #4 from oslabs-beta/aya
paulinekpn Feb 8, 2023
76bae17
erge branch 'dev' into pauline
Feb 8, 2023
6596a88
Merge branch 'dev' of https://github.com/oslabs-beta/SeeQR into trev
TrevorJFerguson Feb 8, 2023
84c5519
Merge branch 'dev' of https://github.com/oslabs-beta/SeeQR into trev
TrevorJFerguson Feb 8, 2023
82e13e6
fixed mysql duplicate issues, pg duplicate issues due to pg/homebrew
Feb 9, 2023
1e81428
changed readme to include permissions instructions
Feb 9, 2023
f784836
Merge pull request #5 from oslabs-beta/aya
paulinekpn Feb 9, 2023
41b640d
Debug table view rendering
Feb 10, 2023
c065628
setSelectedView from help modal is functional
TrevorJFerguson Feb 13, 2023
557c117
Merge pull request #6 from oslabs-beta/trev
utyvert Feb 13, 2023
6390814
Merge branch 'dev' into pauline
Feb 14, 2023
e536a01
Fixed ER table duplicate column bug, ghost edges, and lag
Feb 14, 2023
7566d24
MUI improvements
utyvert Feb 16, 2023
06b7245
Merge pull request #7 from oslabs-beta/pauline
Hiya-its-Aya Feb 16, 2023
35d1cd1
updated imports that dont break
utyvert Feb 18, 2023
4fafe34
repull of dev
Feb 18, 2023
b1b0c57
commit before audit
Feb 18, 2023
74c9dc7
added steps to quickstart/ help
Feb 18, 2023
a9e518e
edited steps
Feb 18, 2023
15e69c4
added team to readme
Feb 18, 2023
acb5053
Merge pull request #9 from oslabs-beta/utkarsh
utyvert Feb 19, 2023
0a3e0cb
Revert "updated mui imports"
Hiya-its-Aya Feb 19, 2023
c90fd92
reverted
Feb 19, 2023
3ca859c
Merge pull request #10 from oslabs-beta/revert-9-utkarsh
Hiya-its-Aya Feb 20, 2023
9787254
Merge branch 'dev' of github.com:oslabs-beta/SeeQR into dev
Feb 20, 2023
cb4275e
added new step, updated readme, fixed tests
Feb 20, 2023
364cd48
error found, button import changed back
utyvert Feb 20, 2023
8d014c5
getlists updates
utyvert Feb 20, 2023
2d68c29
Merge pull request #11 from oslabs-beta/aya
TrevorJFerguson Feb 20, 2023
507fd24
Merge branch 'dev' into utkarsh
utyvert Feb 21, 2023
fe0bef9
confirm deletion dialog added
utyvert Feb 21, 2023
165c36e
Revert "confirm deletion dialog added"
utyvert Feb 21, 2023
e7013da
delete confirmation dialog added
utyvert Feb 21, 2023
cfdea5e
Merge pull request #12 from oslabs-beta/utkarsh
utyvert Feb 21, 2023
f4c1822
Merge pull request #14 from oslabs-beta/delete-confirm
paulinekpn Feb 21, 2023
5004a1a
Merge branch 'dev' of github.com:oslabs-beta/SeeQR into dev
Feb 21, 2023
d0c7294
updated readme
Feb 21, 2023
489d911
updated electron builder version, removed/ commented uneccessary cons…
Feb 21, 2023
9f98ee7
Merge pull request #15 from oslabs-beta/aya
paulinekpn Feb 21, 2023
47db1b7
Merge pull request #16 from oslabs-beta/dev
Feb 22, 2023
46f6180
Update README.md
Feb 23, 2023
ff78b42
Merge pull request #17 from oslabs-beta/Hiya-its-Aya-patch-1
paulinekpn Feb 23, 2023
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<img src="./assets/readmeImages/logo_readme.png" height=300/>

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/oslabs-beta/SeeQR)
![Release: 8.0.1](https://img.shields.io/badge/Release-8.0.1-red)
![Release: 9.0.1](https://img.shields.io/badge/Release-9.0.1-red)
![License: MIT](https://img.shields.io/badge/License-MIT-orange.svg)
![Contributions Welcome](https://img.shields.io/badge/Contributions-welcome-blue.svg)
[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2Ftheseeqr)](https://twitter.com/theseeqr)
[![Github stars](https://img.shields.io/github/stars/open-source-labs/SeeQR?style=social)](https://github.com/open-source-labs/SeeQR)

[SeeQR.info](http://www.seeqr.info)
[SeeQRapp.com](http://www.seeqrapp.com)

<p>SeeQR is a <b>convenient one-stop shop</b> for efficient SQL database manipulation and performance testing. SeeQR can be used throughout the database life-cycle, from creation to testing.</p>

Expand All @@ -27,11 +27,13 @@

## Getting Started

To get started on contributing to this project:
To get started on contributing and editing databases to this project:


1. Download and install [Postgres](https://www.postgresql.org/download/) to access SeeQR's Postgres features and/or [MySQL](https://dev.mysql.com/downloads/mysql/) to access it's MySQL features.
2. Ensure that psql and/or mysql are available in the `$PATH`.
3. Download the latest version of [SeeQR](https://github.com/open-source-labs/seeqr/releases/latest).
3. Create users with passwords and permissions for both [PostgreSQL](https://phoenixnap.com/kb/postgres-create-user) and [MySQL](https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql). Linked are instructions for Mac (Homebrew) and Linux/WSL.
4. Download the latest version of [SeeQR](https://github.com/open-source-labs/seeqr/releases/latest).

## Built With

Expand Down Expand Up @@ -81,7 +83,7 @@ To get started on contributing to this project:
<div align="center">
<img src="./assets/readmeImages/gifs/dummy_data.gif" width=800/>
</div>
- Create/Edit Database <i>(currently in beta)</i>
- Create/Edit Database

- Users can create a new database from scratch by clicking the `Create New Database` button at the bottom of the sidebar.
- Users can modify the newly created database as well as any existing databases using the `ER Diagram` to create/change/delete tables and columns.
Expand All @@ -93,6 +95,7 @@ To get started on contributing to this project:
<img src="./assets/readmeImages/gifs/create_db3.gif" width=800/>
<img src="./assets/readmeImages/gifs/modify_db.gif" width=800/>
</div>

- Queries

- In the 'QUERIES' view, the main panel is where the query input text field is located, utilizing CodeMirror. The paint button in the top right corner of the panel auto-formats the inputted query.
Expand Down Expand Up @@ -162,7 +165,7 @@ We've released SeeQR because it's a useful tool to help optimize SQL databases.

## Core Team

[Fred Jeong](https://github.com/fred-jeong) | [Gabriel Kime](https://github.com/wizardbusiness) | [Chris Fryer](github.com/frynoceros) | [Ian Grepo](https://github.com/RadiantGH) | [Michelle Chang](https://github.com/mkchang168) | [Jake Bradbeer](https://github.com/JBradbeer) | [Bryan Santos](https://github.com/santosb93) | [William Trey Lewis](https://github.com/treyfrog128) | [Brandon Lee](https://github.com/BrandonW-Lee) | [Casey Escovedo](https://github.com/caseyescovedo) | [Casey Walker](https://github.com/cwalker3011) | [Catherine Chiu](https://github.com/catherinechiu) | [Chris Akinrinade](https://github.com/chrisakinrinade) | [Cindy Chau](https://github.com/cindychau) | [Claudio Santos](https://github.com/Claudiohbsantos) | [Eric Han](https://github.com/ericJH92) | [Faraz Akhtar](https://github.com/faraza22) | [Frank Norton](https://github.com/FrankNorton32) | [Harrison Nam](https://github.com/harrynam07) | [James Kolotouros](https://github.com/dkolotouros) | [Jennifer Courtner](https://github.com/jcourtner) | [John Wagner](https://github.com/jwagner988) | [Justin Dury-Agri](https://github.com/justinD-A) | [Justin Hicks](https://github.com/JuiceBawks) | [Katie Klochan](https://github.com/kklochan) | [May Wirapa Boonyasurat](https://github.com/mimiwrp) | [Mercer Stronck](https://github.com/mercerstronck) | [Muhammad Trad](https://github.com/muhammadtrad) | [Richard Guo](https://github.com/richardguoo) | [Richard Lam](https://github.com/rlam108) | [Sam Frakes](https://github.com/frakes413) | [Serena Kuo](https://github.com/serenackuo) | [Timothy Sin](https://github.com/timothysin) | [Vincent Trang](https://github.com/vincentt114)
[Aya Moosa](https://github.com/Hiya-its-Aya) | [Trevor Ferguson](https://github.com/TrevorJFerguson) | [Pauline Nguyen](https://github.com/paulinekpn) | [Utkarsh Uppal](https://github.com/utyvert) | [Fred Jeong](https://github.com/fred-jeong) | [Gabriel Kime](https://github.com/wizardbusiness) | [Chris Fryer](github.com/frynoceros) | [Ian Grepo](https://github.com/RadiantGH) | [Michelle Chang](https://github.com/mkchang168) | [Jake Bradbeer](https://github.com/JBradbeer) | [Bryan Santos](https://github.com/santosb93) | [William Trey Lewis](https://github.com/treyfrog128) | [Brandon Lee](https://github.com/BrandonW-Lee) | [Casey Escovedo](https://github.com/caseyescovedo) | [Casey Walker](https://github.com/cwalker3011) | [Catherine Chiu](https://github.com/catherinechiu) | [Chris Akinrinade](https://github.com/chrisakinrinade) | [Cindy Chau](https://github.com/cindychau) | [Claudio Santos](https://github.com/Claudiohbsantos) | [Eric Han](https://github.com/ericJH92) | [Faraz Akhtar](https://github.com/faraza22) | [Frank Norton](https://github.com/FrankNorton32) | [Harrison Nam](https://github.com/harrynam07) | [James Kolotouros](https://github.com/dkolotouros) | [Jennifer Courtner](https://github.com/jcourtner) | [John Wagner](https://github.com/jwagner988) | [Justin Dury-Agri](https://github.com/justinD-A) | [Justin Hicks](https://github.com/JuiceBawks) | [Katie Klochan](https://github.com/kklochan) | [May Wirapa Boonyasurat](https://github.com/mimiwrp) | [Mercer Stronck](https://github.com/mercerstronck) | [Muhammad Trad](https://github.com/muhammadtrad) | [Richard Guo](https://github.com/richardguoo) | [Richard Lam](https://github.com/rlam108) | [Sam Frakes](https://github.com/frakes413) | [Serena Kuo](https://github.com/serenackuo) | [Timothy Sin](https://github.com/timothysin) | [Vincent Trang](https://github.com/vincentt114)


## License
Expand Down
2 changes: 1 addition & 1 deletion __tests__/frontend/lib/queries.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
window.require = ((str: string) => str) as any
import * as queries from '../../../frontend/lib/queries';
import type { QueryData, ExplainJson } from '../../../frontend/types';
import type { QueryData } from '../../../frontend/types';

const first: Partial<QueryData> = {
label: 'firstQuery',
Expand Down
2 changes: 2 additions & 0 deletions backend/DummyD/dummyDataMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const getRandomInt = (min: number, max: number) => {
const generateDataByType = (columnObj: ColumnObj): string | number => {
let length;
// faker.js method to generate data by type
console.log('columnObj_datatype: ', columnObj.data_type)

switch (columnObj.data_type) {
case 'smallint':
return faker.random.number({ min: -32768, max: 32767 });
Expand Down
39 changes: 23 additions & 16 deletions backend/channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ipcMain.on('return-db-list', (event, dbType: DBType = DBType.Postgres) => {

db.setBaseConnections()
.then(() => {
db.getLists()
db.getLists('', dbType)
.then((data: DBList) => {
event.sender.send('db-lists', data);
logger("Sent 'db-lists' from 'return-db-list'", LogType.SEND);
Expand Down Expand Up @@ -156,7 +156,7 @@ ipcMain.handle(
await db.query(dropDBScript, null, dbType);

// send updated db info
const dbsAndTables: DBList = await db.getLists();
const dbsAndTables: DBList = await db.getLists(dbName, dbType);
event.sender.send('db-lists', dbsAndTables);
logger("Sent 'db-lists' from 'drop-db'", LogType.SEND);
} finally {
Expand Down Expand Up @@ -228,7 +228,7 @@ ipcMain.handle(
}

// update frontend with new db list
const dbsAndTableInfo: DBList = await db.getLists();
const dbsAndTableInfo: DBList = await db.getLists('', dbType);
event.sender.send('db-lists', dbsAndTableInfo);
logger("Sent 'db-lists' from 'duplicate-db'", LogType.SEND);
} finally {
Expand Down Expand Up @@ -288,7 +288,7 @@ ipcMain.handle(
}

// update frontend with new db list
const dbsAndTableInfo: DBList = await db.getLists();
const dbsAndTableInfo: DBList = await db.getLists('', dbType);
event.sender.send('db-lists', dbsAndTableInfo);
logger("Sent 'db-lists' from 'import-db'", LogType.SEND);
} finally {
Expand Down Expand Up @@ -343,7 +343,7 @@ ipcMain.handle(
dbType
);
explainResults = results[0][0];
console.log('mysql explain results', explainResults);
// console.log('mysql explain results', explainResults);

console.log(LogType.WARNING, results);
}
Expand All @@ -361,9 +361,9 @@ ipcMain.handle(
console.log('returnedRows in channels for MySQL', returnedRows);
}
if (dbType === DBType.Postgres) {
console.log('results in channels for Postgres', results);
// console.log('results in channels for Postgres', results);
returnedRows = results.rows;
console.log('returnedRows in channels for Postgres', returnedRows);
// console.log('returnedRows in channels for Postgres', returnedRows);
}
} catch (e: any) {
error = e.toString();
Expand All @@ -383,7 +383,7 @@ ipcMain.handle(

// send updated db info in case query affected table or database information
// must be run after we connect back to the originally selected so tables information is accurate
const dbsAndTables: DBList = await db.getLists();
const dbsAndTables: DBList = await db.getLists('', dbType);
event.sender.send('db-lists', dbsAndTables);
logger(
"Sent 'db-lists' from 'run-query'",
Expand Down Expand Up @@ -440,26 +440,30 @@ interface dummyDataRequestPayload {
rows: number;
}

ipcMain.handle(
ipcMain.handle( // generate dummy data
'generate-dummy-data',
async (event, data: dummyDataRequestPayload, dbType: DBType) => {
logger("Received 'generate-dummy-data'", LogType.RECEIVE);
// send notice to front end that DD generation has been started
event.sender.send('async-started');

console.log('genereatedata ipcMain dbType: ', dbType)
let feedback: Feedback = {
type: '',
message: '',
};
try {
console.log('data in generate-dummy-data', data); // gets here fine

// Retrieves the Primary Keys and Foreign Keys for all the tables
const tableInfo: ColumnObj[] = await db.getTableInfo(data.tableName);

const tableInfo: ColumnObj[] = await db.getTableInfo(data.tableName, dbType); // passed in dbType to second argument
console.log('tableInfo in generate-dummy-data', tableInfo); // working

// generate dummy data
const dummyArray: DummyRecords = await generateDummyData(
tableInfo,
data.rows
);
console.log('dummyArray output: ', dummyArray)
// generate insert query string to insert dummy records
const columnsStringified = '('
.concat(dummyArray[0].join(', '))
Expand Down Expand Up @@ -491,9 +495,11 @@ ipcMain.handle(
message: err,
};
} finally {
console.log('dbType inside generate-dummy-data', dbType)
// send updated db info in case query affected table or database information
const dbsAndTables: DBList = await db.getLists();
event.sender.send('db-lists', dbsAndTables);
const dbsAndTables: DBList = await db.getLists('', dbType); // dummy data clear error is from here
console.log('dbsAndTables in generate-dummy-data', dbsAndTables)
event.sender.send('db-lists', dbsAndTables); // dummy data clear error is from here

// send feedback back to FE
event.sender.send('feedback', feedback);
Expand Down Expand Up @@ -534,7 +540,7 @@ ipcMain.handle(
await db.connectToDB(newDbName, dbType);

// update DBList in the sidebar to show this new db
const dbsAndTableInfo: DBList = await db.getLists();
const dbsAndTableInfo: DBList = await db.getLists(newDbName, dbType);
event.sender.send('db-lists', dbsAndTableInfo);
logger("Sent 'db-lists' from 'initialize-db'", LogType.SEND);
} catch (e) {
Expand Down Expand Up @@ -578,7 +584,7 @@ ipcMain.handle(
} finally {
// send updated db info in case query affected table or database information
// must be run after we connect back to the originally selected so tables information is accurate
const dbsAndTables: DBList = await db.getLists();
const dbsAndTables: DBList = await db.getLists('', dbType);
event.sender.send('db-lists', dbsAndTables);
logger("Sent 'db-lists' from 'update-db'", LogType.SEND);

Expand Down Expand Up @@ -625,6 +631,7 @@ ipcMain.handle(
};
} finally {
// send updated db info

const updatedDb: DBList = await db.getLists(dbName, dbType);
event.sender.send('db-lists', updatedDb);

Expand Down
31 changes: 19 additions & 12 deletions backend/helperFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable object-shorthand */
import { DBType } from './BE_types';
const { exec } = require('child_process'); // Child_Process: Importing Node.js' child_process API
const { dialog } = require('electron'); // Dialog: display native system dialogs for opening and saving files, alerting, etc
const { dialog } = require('electron'); // Dialog: display native system dialogs for opening and saving files, alerting, etcim
const docConfig = require('./_documentsConfig')
// ************************************** CLI COMMANDS & SQL Queries TO CREATE, DELETE, COPY DB SCHEMA, etc. ************************************** //

// Generate SQL queries & CLI commands to be executed in pg and child process respectively
Expand Down Expand Up @@ -63,9 +64,11 @@ const helperFunctions: HelperFunctions = {

// import SQL file into new DB created
runSQLFunc: function (dbName, file, dbType: DBType) {
const PG = `psql -U postgres -d "${dbName}" -f "${file}"`;
const SQL_data = docConfig.getFullConfig();
console.log(SQL_data)
const PG = `PGPASSWORD=${SQL_data.pg_pass} psql -U ${SQL_data.pg_user} -d "${dbName}" -f "${file}" -p ${SQL_data.pg_port}`;
// const MYSQL = `mysql -u root -p ${dbName} < ${file}`;
const MYSQL = `mysql -uroot -p; use ${dbName}; source ${file}`;
const MYSQL = `export MYSQL_PWD='${SQL_data.mysql_pass}'; mysql -u${SQL_data.mysql_user} --port=${SQL_data.mysql_port} ${dbName} < ${file}`;

console.log(`runSQLFunc MySQL: ${MYSQL}, ${dbType}`);
console.log(`runSQLFunc PG: ${PG}, ${dbType}`);
Expand All @@ -75,8 +78,9 @@ const helperFunctions: HelperFunctions = {

// import TAR file into new DB created
runTARFunc: function (dbName, file, dbType: DBType) {
const PG = `pg_restore -U postgres -d "${dbName}" "${file}"`;
const MYSQL = `mysqldump -u root -p ${dbName} > ${file}`;
const SQL_data = docConfig.getFullConfig();
const PG = `PGPASSWORD=${SQL_data.pg_pass} pg_restore -U ${SQL_data.pg_user} -p ${SQL_data.pg_port} -d "${dbName}" "${file}" `;
const MYSQL = `export MYSQL_PWD='${SQL_data.mysql_pass}'; mysqldump -u ${SQL_data.mysql_user} --port=${SQL_data.mysql_port} ${dbName} > ${file}`;

console.log(`runTARFunc MySQL: ${MYSQL}, ${dbType}`);
console.log(`runTARFunc PG: ${PG}, ${dbType}`);
Expand All @@ -86,8 +90,9 @@ const helperFunctions: HelperFunctions = {

// make a full copy of the schema
runFullCopyFunc: function (dbCopyName, newFile, dbType: DBType) {
const PG = `pg_dump -U postgres -F p -d "${dbCopyName}" > "${newFile}"`;
const MYSQL = `mysqldump -h localhost -u root -p --no-data ${dbCopyName} > ${newFile}`;
const SQL_data = docConfig.getFullConfig();
const PG = `PGPASSWORD=${SQL_data.pg_pass} pg_dump -s -U ${SQL_data.pg_user} -p ${SQL_data.pg_port} -Fp -d ${dbCopyName} > "${newFile}"`;
const MYSQL = `export MYSQL_PWD='${SQL_data.mysql_pass}'; mysqldump -h localhost -u ${SQL_data.mysql_user} ${dbCopyName} > ${newFile}`;

console.log(`runFullCopyFunc MySQL: ${MYSQL}, ${dbType}`);
console.log(`runFullCopyFunc PG: ${PG}, ${dbType}`);
Expand All @@ -97,20 +102,22 @@ const helperFunctions: HelperFunctions = {

// make a hollow copy of the schema
runHollowCopyFunc: function (dbCopyName, file, dbType: DBType) {
const PG = `pg_dump -s -U postgres -F p -d "${dbCopyName}" > "${file}"`;
const MYSQL = `mysqldump -h localhost -u root -p --no-data ${dbCopyName} > ${file}`;
const SQL_data = docConfig.getFullConfig();
const PG = ` PGPASSWORD=${SQL_data.pg_pass} pg_dump -s -U ${SQL_data.pg_user} -p ${SQL_data.pg_port} -F p -d "${dbCopyName}" > "${file}"`;
const MYSQL = `export MYSQL_PWD='${SQL_data.mysql_pass}'; mysqldump -h localhost -u ${SQL_data.mysql_user} --port=${SQL_data.mysql_port} ${dbCopyName} > ${file}`;

console.log(`runHollowCopyFunc MySQL: ${MYSQL}, ${dbType}`);
console.log(`runHollowCopyFunc PG: ${PG}, ${dbType}`);

return dbType === DBType.Postgres ? PG : MYSQL;
},

// promisified execute to execute commands in the child process
promExecute: (cmd: string) =>
new Promise((resolve, reject) => {
exec(cmd, (error, stdout, stderr) => {
if (error) return reject(error);
exec(cmd, {timeout: 5000}, (error, stdout, stderr) => {
if (error){
console.log(error)
return reject(error)};
if (stderr) return reject(new Error(stderr));
return resolve({ stdout, stderr });
});
Expand Down
1 change: 0 additions & 1 deletion backend/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { FamilyRestroomRounded } from '@mui/icons-material';
import { BrowserWindow, Menu } from 'electron';

const { app } = require('electron');
Expand Down
Loading