Skip to content

Commit cd783e9

Browse files
committed
rm unused code
1 parent 3ae8fa1 commit cd783e9

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@
1313

1414
</div>
1515

16-
17-
1816
<h1 align="center">Visualize, modify, and build your database with dbSpy!</h1>
1917
<p align="center">An open-source data modeling tool to facilitate relational database development</p>
2018

21-
2219
<p align="center">
2320
<img src="https://img.shields.io/badge/React-61DAFB?style=flat-square&logo=react&logoColor=black" />
2421
<img src="https://img.shields.io/badge/TypeScript-3178C6?style=flat-square&logo=typescript&logoColor=white" />
@@ -39,7 +36,6 @@
3936
<img src="https://img.shields.io/badge/AWS-FF9900?style=flat-square&logo=amazonaws&logoColor=black" />
4037
</p>
4138

42-
4339
### 🚀 dbSpy v8.0 ✨ New Features
4440

4541
### 🔍 Test New Query Page - a modern querying interface
@@ -80,7 +76,7 @@
8076

8177
---
8278

83-
### dbSpy v8.0 updates
79+
### dbSpy v7.0 updates
8480

8581
- Full widescreen UI with a dropdown menu for more workspace
8682
- Enhanced Save, Load, and Delete features that support filenames for saving schema and data

server/controllers/postgresData.controller.ts

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ const postgresController = {
2626
//----------Function to collect all schema and data from database-----------------------------------------------------------------
2727
postgresQuery: async (req: Request, res: Response, next: NextFunction) => {
2828
const PostgresDataSource = await dbConnect(req);
29-
console.log('postgresQuery REQ: ', req);
30-
console.log('MADE IT TO postgresQuery MIDDLEWARE');
29+
// console.log('postgresQuery REQ: ', req);
30+
// console.log('MADE IT TO postgresQuery MIDDLEWARE');
3131

3232
/*
3333
* Used for storing Primary Key table and column names that are
@@ -170,21 +170,20 @@ const postgresController = {
170170
//----------Function to gather query metrics from database-----------------------------------------------------------------
171171
postgresGetMetrics: async (req: Request, res: Response, next: NextFunction) => {
172172
const PostgresGetMetrics = await dbConnect(req);
173-
console.log('REACHED postgresGetMetrics MIDDLEWARE');
174-
console.log('REQ QUERY: ', req.query);
173+
// console.log('REACHED postgresGetMetrics MIDDLEWARE');
174+
// console.log('REQ QUERY: ', req.query);
175175
try {
176176
// destructuing the below 2 fields to store to the queries table in mysql db
177177
const { queryString, queryName, hostname, database_name } = req.query;
178-
console.log('❓ QUERY FROM FE IS: ', queryString);
179-
console.log('hostname:', hostname);
180-
console.log('database_name', database_name);
178+
// console.log('❓ QUERY FROM FE IS: ', queryString);
179+
// console.log('hostname:', hostname);
180+
// console.log('database_name', database_name);
181181

182182
// Query string (EXPLAIN) to access performance data
183183
const testQuery = `EXPLAIN (FORMAT JSON, ANALYZE, VERBOSE, BUFFERS) ${queryString};`;
184184
const result = await PostgresGetMetrics.query(testQuery);
185185

186-
console.log('⭐️QUERY PLAN RESULT: ', result[0]['QUERY PLAN']);
187-
// 🌟🌟🌟
186+
// console.log('⭐️QUERY PLAN RESULT: ', result[0]['QUERY PLAN']);
188187
/*
189188
Key Metrics Explanation:
190189
- Execution Time: total time it takes to execute the query (in ms)
@@ -198,15 +197,13 @@ const postgresController = {
198197

199198
//pull exec time alone for the mysql update when storing queries
200199
const exec_time = result[0]['QUERY PLAN'][0]['Execution Time'];
201-
console.log('exec_time:', exec_time);
202200

203201
// Pull Execution time only
204202
const resObj = result[0]['QUERY PLAN'][0];
205203
const resObjPlan = resObj['Plan'];
206204
const executionTime = `Execution Time: ${resObj['Execution Time']}ms`;
207205
const namedQuery = `Query Name: ${queryName}`;
208206
const queryStr = `Query: ${queryString}`;
209-
// console.log('⏰ EXECUTION TIME METRIC', executionTime);
210207

211208
const otherMetrics: Array<object> = [
212209
{
@@ -221,7 +218,6 @@ const postgresController = {
221218
sharedRead: resObjPlan['Shared Read Blocks'],
222219
},
223220
];
224-
// console.log('OTHER METRICCSSSS: ', otherMetrics);
225221

226222
// Create date metric to add to response
227223
const now = new Date();
@@ -255,8 +251,8 @@ const postgresController = {
255251
}
256252

257253
try {
258-
console.log('REACHED postgresSaveMetrics MIDDLEWARE');
259-
console.log('REQ BODY: ', req.body.params);
254+
// console.log('REACHED postgresSaveMetrics MIDDLEWARE');
255+
// console.log('REQ BODY: ', req.body.params);
260256

261257
const userEmail = user.email;
262258
const { query_date, exec_time } = req.body.params.extractedQueryRes;
@@ -277,7 +273,7 @@ const postgresController = {
277273
// converting date to DATE format (YYYY-MM-DD) for MySQL to insert into queries table
278274
const date = new Date(query_date);
279275
const formatDateForMySql = date.toISOString().split('T')[0];
280-
console.log('formatted date: ', formatDateForMySql);
276+
// console.log('formatted date: ', formatDateForMySql);
281277

282278
const insertQueryStr = `INSERT INTO queries (email, query, db_link, exec_time, db_name, query_date, name, planning_time, total_cost, actual_total_time, node_type, relation_name, plan_rows, actual_rows, shared_hit_blocks, shared_read_blocks) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`;
283279

0 commit comments

Comments
 (0)