Skip to content

Commit 11efe6d

Browse files
authored
Merge pull request #70 from open-source-labs/development
Merge Dev with Master
2 parents 59b7dee + a24fb62 commit 11efe6d

32 files changed

+896
-25555
lines changed

.eslintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@
3333
"ignorePackages",
3434
{ "js": "never", "jsx": "never", "ts": "never", "tsx": "never" }
3535
],
36+
// "import/no-extraneous-dependencies": ["error", { "devDependencies": true }], **trying to resolve the electron issue
3637
"jsx-a11y/label-has-associated-control": "off",
3738
// prevent wrong warning with typescript overloads
3839
"no-unused-vars": "off",
3940
"@typescript-eslint/no-unused-vars": ["error"],
40-
"no-dupe-class-members": "off",
41+
"no-dupe-class-members": "off",
4142
"@typescript-eslint/no-dupe-class-members": ["error"],
4243
"lines-between-class-members": "off",
4344
"@typescript-eslint/lines-between-class-members": [
@@ -52,5 +53,6 @@
5253
"react/jsx-props-no-spreading": "off",
5354
"camelcase": "off"
5455
},
56+
// "settings": "import/core-modules: [ electron ]", **trying to resolve the electron issue
5557
"root": true
5658
}

README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
To get started on contributing to this project:
3232

33-
1. Download and install [Postgres.app](https://postgresapp.com/) and start it before opening up SeeQR
33+
1. Download and install [Postgres.app](https://postgresapp.com/)(Mac)/[PGAdmin](https://www.pgadmin.org/download)(Windows) and start it before opening up SeeQR
3434
2. Ensure that psql is available in the `$PATH`
3535
3. Ensure that a 'postgres' role exists
3636
4. Download the latest version of [SeeQR](https://github.com/open-source-labs/seeqr/releases/latest)
@@ -85,7 +85,7 @@ To get started on contributing to this project:
8585
- Create/Edit Database <i>(currently in beta)</i>
8686

8787
- Users can create a new database from scratch by clicking the `Create New Database` button at the bottom of the sidebar
88-
- Once a the database is given a name, htiting the `Initialize Database` button will create new database on the users PostgreSQL instance
88+
- Once a the database is given a name, hitting the `Initialize Database` button will create new database on the users PostgreSQL instance
8989
- Users can then input SQL commands and click `Update Database` to create and drop tables in the database
9090
- Users have the option to alter any existing databases as well by selecting the database on the sidebar and running any SQL commands they would like.
9191
- The `Export` button will write a .sql file on the user's desktop of the selected database
@@ -99,13 +99,24 @@ To get started on contributing to this project:
9999

100100
- 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
101101
- Users can select the database to use in the 'Database' dropdown above the main panel
102-
- Users also have the option to execute a labelled or unlabelled query — simply provide a label in the 'Label' field above the main panel to identify the query in later comparisons against other queries
102+
- Users also have the option to execute a labelled/grouped or unlabelled/ungrouped query — simply provide a label/group in the 'Label'/'Group' field above the main panel to identify the query in later comparisons against other queries
103103
- Please note that only labelled queries will be saved in the current session for future references
104104
- To execute the query, simply select the 'RUN QUERY' button at the bottom of the panel or press 'Ctrl-Enter' on the keyboard
105105

106+
<br />
107+
<div align="center">
108+
<img src="./assets/readmeImages/gifs/Query_Execution.gif" width=800/>
109+
</div>
110+
111+
- Save/Load Queries
112+
113+
- In the 'QUERIES' view, the file upload icon will open a file explorer window to select a .JSON to import query data from
114+
- The file icon to the right of the upload icon will designate the file path to save query data to if you press the save button on the queries
115+
- To save individual query data press the save icon on the individual queries in the dropdowns
116+
106117
<br />
107118
<div align="center">
108-
<img src="./assets/readmeImages/gifs/query.gif" width=800/>
119+
<img src="./assets/readmeImages/gifs/Save_Load_Queries.gif" width=800/>
109120
</div>
110121

111122
- Data
@@ -121,21 +132,22 @@ To get started on contributing to this project:
121132
- Clicking on a node will display additional details regarding that action as well
122133
- To execute a new query, simply select the '+' button in the sidebar. To go back to a previously saved query, just select it in the sidebar
123134

135+
124136
<br />
125137
<div align="center">
126-
<img src="./assets/readmeImages/gifs/execution_plan.gif" width=800/>
138+
<img src="./assets/readmeImages/gifs/Query_Exec_Plan.gif" width=800/>
127139
</div>
128140

129141
- Compare
130142

131143
- Click on the 'bar graph' icon at the top of the sidebar to get to the 'Compare Queries' view
132144
- The comparison table is flexible to the user’s preferences as the user selects which queries to compare side by side
133145
- Simply check or uncheck the box next to each saved query to add or remove the query from the graph
134-
- Graph will be organized along the x-axis by label, and colored by schema
146+
- Graph will be organized along the x-axis by group, and colored by schema
135147
- Aside from the visualized performance comparison of the selected queries, a table will display information about each selected query, including its total run time and performance relative to other queries with the same label, with the most performant query highlighted
136148

137149
<div align="center">
138-
<img src="./assets/readmeImages/gifs/compare_view.gif" width=800/>
150+
<img src="./assets/readmeImages/gifs/Comparing_Queries.gif" width=800/>
139151
</div>
140152

141153
## Application Architecture and Logic
@@ -152,7 +164,7 @@ We've released SeeQR because it's a useful tool to help optimize SQL databases.
152164

153165
## Core Team
154166

155-
[Allison Le](https://github.com/allisonle1) | [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) | [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) | [Justin Dury-Agri](https://github.com/justinD-A) | [Katie Klochan](https://github.com/kklochan) | [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)
167+
[Allison Le](https://github.com/allisonle1) | [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)
156168

157169

158170
## License

__tests__/frontend/lib/queries.spec.ts

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
1+
window.require = ((str: string) => str) as any
12
import * as queries from '../../../frontend/lib/queries';
2-
import type { QueryData } from '../../../frontend/types';
3+
import type { QueryData, ExplainJson } from '../../../frontend/types';
34

45
const first: Partial<QueryData> = {
56
label: 'firstQuery',
67
db: 'firstDb',
8+
group: 'group1',
79
sqlString: 'select * from tests',
10+
executionPlan: {
11+
Plan: {
12+
'Node Type': 'Seq Scan',
13+
'Relation Name': 'users',
14+
Alias: 'users',
15+
'Startup Cost': 0,
16+
'Total Cost': 0,
17+
'Plan Rows': 0,
18+
'Plan Width': 0,
19+
'Actual Startup Time': 0,
20+
'Actual Total Time': 0,
21+
'Actual Rows': 0,
22+
'Actual Loops': 0,
23+
},
24+
'Planning Time': 1,
25+
'Execution Time': 1,
26+
},
827
};
928

1029
const second: Partial<QueryData> = {
@@ -15,15 +34,16 @@ const second: Partial<QueryData> = {
1534

1635
describe('key generation', () => {
1736
it('should create key from label and db given as params', () => {
18-
expect(queries.keyFromData('LABEL', 'DB')).toEqual('label:LABEL db:DB');
37+
expect(queries.keyFromData('LABEL', 'DB', 'GROUP')).toEqual('label:LABEL db:DB group:GROUP');
1938
});
2039

2140
it('should create key from query object', () => {
2241
const query = {
2342
label: 'query1',
2443
db: 'db1',
44+
group: 'group1'
2545
};
26-
expect(queries.key(query as QueryData)).toEqual('label:query1 db:db1');
46+
expect(queries.key(query as QueryData)).toEqual('label:query1 db:db1 group:group1');
2747
});
2848
});
2949

@@ -137,23 +157,28 @@ describe('setCompare', () => {
137157

138158
it('should not mutate original collection', () => {
139159
expect(Object.keys(collection).length).toBe(0);
140-
const newCollection = queries.setCompare({}, first as QueryData, true);
160+
const newCollection = queries.setCompare({}, {}, first as QueryData, true);
141161
expect(Object.keys(collection).length).toBe(0);
142162
expect(newCollection).not.toBe(collection);
143163
});
144164

145165
it('should add query to new collection if given true for isCompared', () => {
146166
expect(Object.keys(collection).length).toBe(0);
147-
const newCollection = queries.setCompare({}, first as QueryData, true);
167+
const newCollection = queries.setCompare({}, {}, first as QueryData, true);
148168
expect(Object.keys(newCollection).length).toBe(1);
149169
expect(newCollection[queries.key(first as QueryData)]).toEqual(first);
150170
});
151171

152-
it('should remove query from new collection if given false for isCompared', () => {
172+
it('should set execution time to 0 if given false for isCompared', () => {
173+
let qs:any = { [`${queries.key(first as QueryData)}`]: first };
153174
expect(Object.keys(collection).length).toBe(0);
154-
const newCollection = queries.setCompare({}, first as QueryData, true);
175+
const newCollection = queries.setCompare({}, qs, first as QueryData, true);
155176
expect(Object.keys(newCollection).length).toBe(1);
156-
const clearedCollection = queries.setCompare({}, first as QueryData, false);
157-
expect(Object.keys(clearedCollection).length).toBe(0);
177+
expect(newCollection[queries.key(first as QueryData)].executionPlan['Planning Time']).toBe(1);
178+
expect(newCollection[queries.key(first as QueryData)].executionPlan['Execution Time']).toBe(1);
179+
const newSetCollection = queries.setCompare(newCollection, qs, first as QueryData, false);
180+
expect(Object.keys(newSetCollection).length).toBe(1);
181+
expect(newSetCollection[queries.key(first as QueryData)].executionPlan['Planning Time']).toBe(0);
182+
expect(newSetCollection[queries.key(first as QueryData)].executionPlan['Execution Time']).toBe(0);
158183
});
159184
});
429 KB
Loading
603 KB
Loading
801 KB
Loading
238 KB
Loading
2.27 MB
Loading
533 KB
Loading
1.11 MB
Loading

0 commit comments

Comments
 (0)