1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 18:18:53 +08:00

326 Commits

Author SHA1 Message Date
lana-k
9de01dbe2e sidebar settings 2022-01-07 18:46:18 +01:00
lana-k
2397ea6fb3 add index 2022-01-07 12:47:12 +01:00
lana-k
27bb23ac3d Add headers; fix images and links 2022-01-06 22:34:07 +01:00
lana-k
0698522fa5 fix link 2022-01-06 22:16:05 +01:00
lana-k
73849ee820 remove versions 2022-01-06 22:04:25 +01:00
lana-k
7dde645fbc fix images in Basic usage 2022-01-06 21:38:29 +01:00
lana-k
b273d7677d add docs 2022-01-06 21:32:52 +01:00
lana-k
f9561b8678 clear branch 2022-01-06 21:29:46 +01:00
lana-k
310a939109 #89 add tests 2021-12-24 16:13:42 +01:00
lana-k
bb9ba08902 #89 remove head and body 2021-12-22 20:42:53 +01:00
lana-k
c7c727ff78 fix lint 2021-12-21 22:15:21 +01:00
lana-k
8669a6a9e5 #89 export to html plolty charts and pivots 2021-12-21 22:13:02 +01:00
lana-k
c1cc5bb95e getHtml for chart #89 2021-12-20 22:31:08 +01:00
lana-k
9c55e76a41 update version 2021-12-19 16:00:11 +01:00
lana-k
70a9edf57e fix lint 2021-12-19 15:57:30 +01:00
lana-k
b2c2344951 update version 2021-12-19 15:38:17 +01:00
lana-k
cbec91e78a Merge branch 'master' of github.com:lana-k/sqliteviz 2021-12-19 15:37:01 +01:00
lana-k
816b0e6218 show plotly warnings and errors #55 2021-12-19 15:36:46 +01:00
saaj
4ed93bbea7 Two more extensions and improved extension documentation (#86) 2021-09-10 20:11:37 +02:00
lana-k
3e3a70430f fix lint 2021-09-03 16:03:06 +02:00
lana-k
bce3854792 fix test 2021-09-03 15:58:37 +02:00
lana-k
307cac06e6 remove html2canvas logging 2021-09-03 15:58:20 +02:00
lana-k
c4b0bdc870 fix lint 2021-09-03 15:25:30 +02:00
lana-k
69e0b2129b add tests for Pivot and Chart 2021-09-03 15:25:23 +02:00
lana-k
4ebb3715d6 add tests for RinResult 2021-09-03 15:22:48 +02:00
lana-k
858e32c9fd fix errors in tests 2021-09-01 22:42:34 +02:00
lana-k
42cce95ed0 fix errors in tests 2021-09-01 22:27:51 +02:00
lana-k
61ffcc82d6 add test for clipboard copying in DataView 2021-08-30 23:10:57 +02:00
lana-k
4716bcf258 DataView tests 2021-08-29 22:27:25 +02:00
lana-k
23d2421584 add tests for clipboard lib 2021-08-29 21:32:13 +02:00
lana-k
4730afc68a add test for tab 2021-08-29 21:31:50 +02:00
lana-k
6b902d5f00 fix line size 2021-08-29 21:31:30 +02:00
lana-k
a484c1e022 add test for pivot helper 2021-08-29 21:30:53 +02:00
lana-k
1ed5bf2fae add test for sleep 2021-08-29 21:29:36 +02:00
lana-k
da8dc71f23 add test to csv (serialize) 2021-08-29 21:29:21 +02:00
lana-k
ebac3d8f6c add test for chart helper 2021-08-29 21:28:55 +02:00
lana-k
0336168bdc line size lint checking 2021-08-29 21:27:02 +02:00
lana-k
e38f482933 saveAsPng refactoring 2021-08-28 19:07:10 +02:00
lana-k
bcd98fe1ad add sleep function 2021-08-23 22:20:03 +02:00
lana-k
ec3ec6f57a add test for selection and filter #84 2021-08-22 16:50:17 +02:00
lana-k
ae9e2bc03c fix lint errors 2021-08-22 15:01:22 +02:00
lana-k
fe11d446f3 add NO found msg #83; fix checkbox behaviour #84 2021-08-22 15:00:34 +02:00
lana-k
e6bef139f1 Support vector graphic chart download #39 2021-08-21 22:51:17 +02:00
lana-k
d7e0e52da5 add copy dialog for csv #50 2021-08-21 21:41:06 +02:00
lana-k
09cec13a9c show dialog for keeping user activity #50 2021-08-21 18:44:29 +02:00
lana-k
0cae368350 fix lint errors #50 2021-08-20 22:33:15 +02:00
lana-k
88c62a1dfb show message about ClipboardItem support #50
for Firefox
2021-08-20 22:30:48 +02:00
lana-k
ead861b610 copy png to clipboard #50 2021-08-20 21:45:05 +02:00
lana-k
949e6b626e fix lint errors #81 2021-08-20 18:07:30 +02:00
lana-k
6dc81f7be6 copy result set as tsv #50 2021-08-20 18:06:58 +02:00
lana-k
bb39dcbc2f use tab for export to csv #81
(support paste to google sheets)
2021-08-20 18:05:51 +02:00
lana-k
131efb55df update readme #81 2021-08-20 15:38:18 +02:00
lana-k
b33974c26c Export result set to CSV file #81 2021-08-20 15:36:19 +02:00
lana-k
e9c97beb5a fix lint error 2021-08-18 22:09:32 +02:00
lana-k
cabc4f8acd fix JS error during running queries #80 2021-08-18 21:50:42 +02:00
lana-k
679a785d70 add test for view #78 2021-08-18 21:24:12 +02:00
lana-k
a91add40cc uninstall sqlite parser #78 2021-08-18 20:58:53 +02:00
twoxfh
53b2d8372f Updating how database object information is getting retrieved (#79)
* Updating how database object information is getting retrieved

I updated the SQLite query for gathering database objects to make use of the JSON1 extension so you can grab tables and views name, their associated columns with types and set it to the schema. This removes the need to work with DDL's. Hints for Tables and Views works since my approach is they are both database objects.
2021-08-18 20:22:30 +02:00
lana-k
f3e8448851 update version 2021-08-11 23:16:11 +02:00
lana-k
4213e9df5c fix lint errors 2021-08-10 23:36:16 +02:00
lana-k
9f32323a80 fix column order in result set #74 2021-08-10 20:31:12 +02:00
lana-k
2ed5160f65 remove maps from root 2021-08-05 18:47:24 +02:00
lana-k
fe8ab3f3e8 update version 2021-08-05 18:44:10 +02:00
saaj
848112979b SQLite WebAssembly micro-benchmark and new build with a memory leak fix (#70) 2021-08-05 18:35:31 +02:00
lana-k
2830df2adc Update README.md 2021-08-04 22:25:23 +02:00
lana-k
5017b55944 Pivot implementation and redesign (#69)
- Pivot support implementation 
- Rename queries into inquiries
- Rename editor into workspace
- Change result set format
- New JSON format for inquiries
- Redesign panels
2021-08-04 22:20:51 +02:00
lana-k
8d0bc6affe Update package.json 2021-07-15 22:48:46 +02:00
lana-k
d07506266c fix lint error 2021-07-15 22:41:36 +02:00
lana-k
cea1d40797 Merge branch 'master' of github.com:lana-k/sqliteviz 2021-07-15 22:36:33 +02:00
lana-k
0f2dc9f11e fix ISO time columns when no column names #66 2021-07-15 22:36:07 +02:00
lana-k
23250259eb Update package.json 2021-07-04 13:57:13 +02:00
lana-k
fb930028de update chokidar 2021-07-04 13:05:06 +02:00
lana-k
1ff4adf95c Merge branch 'master' of github.com:lana-k/sqliteviz 2021-07-04 12:23:35 +02:00
lana-k
78cdb3809c update npm in CI 2021-07-03 19:55:47 +02:00
saaj
3a6628cab9 Pre-built custom sql.js for sqliteviz (#62)
* Proof-of-concept pre-built custom sql.js

* Rewrite Makefile as a couple of comprehensible Python scripts

* Add link to a blog post about transitive closure in SQLite

* Remove eval extension -- no much point as it only returns a string

* Consistently use existing Path objects

* Add basic tests scalar functions from extension-functions.c

* Test presence of functions from the rest of built extensions

* Use the same sqlite.com domain

* Add a couple SQLite compile flags that may make it a bit faster

* Add regexpi function test

* Add node about regexpi and REGEXP operator

* Workaround first build failure, rebuild lock file and minor fixes
2021-07-03 16:43:43 +02:00
lana-k
418809d27d lint no fix in CI 2021-07-03 15:48:56 +02:00
lana-k
f9edeafd40 fix csv import with ISO dates #64 2021-07-01 19:07:59 +02:00
lana-k
a37ed93306 update version 2021-06-17 12:24:41 +02:00
lana-k
cf4b83f7d4 fix csv result when column names have spaces #59 2021-06-17 12:23:44 +02:00
lana-k
2abd42c9c3 run tests on pull request 2021-06-07 13:20:42 +02:00
lana-k
1251c542cb update react-chart-editor 2021-05-25 11:52:37 +02:00
lana-k
ac89259924 Always create empty db on start #46 2021-05-24 21:45:51 +02:00
lana-k
179ff8b1e1 fix table layout on My queries #32 2021-05-24 20:50:52 +02:00
lana-k
99a10225a3 CSV import as a table and db connection rework
- Add csv to existing db #32
- [RFE] Simplify working with temporary tables #53
2021-05-24 19:40:47 +02:00
lana-k
c96deb5766 Fix overflow for Firefox #46 2021-05-22 22:26:23 +02:00
lana-k
700970e1cc Add addTable icon #32 2021-05-22 22:25:19 +02:00
lana-k
e2be61e2cf Make error in text field start with uppercase #32 2021-05-22 22:24:20 +02:00
lana-k
9c2c8f3692 Make Logs smaller #32 2021-05-22 22:23:12 +02:00
lana-k
414a116f94 Lost focus in SQL query editor #54 2021-05-19 22:50:56 +02:00
lana-k
3e503f85a9 Stub app-diagnostic-info in tests 2021-05-19 21:52:42 +02:00
lana-k
88257bfcf6 fix CSV dialog height typo 2021-05-19 16:53:30 +02:00
lana-k
bdcc494138 Add scrolling to App info , CSV import dialogs #46 2021-05-19 16:43:42 +02:00
lana-k
d750541c80 App diagnostic dialog #46 2021-05-19 15:46:18 +02:00
lana-k
75f743ff9e remove title in release notes 2021-05-18 15:38:44 +02:00
lana-k
8a9f4b3c0a add Help link 2021-05-18 15:04:35 +02:00
lana-k
77468d34ae add release notes 2021-05-18 15:04:19 +02:00
lana-k
a0577ec0ce Fix gradient for Safari 2021-05-17 21:34:42 +02:00
lana-k
e7d1398546 Rewrite reg exp: make them work in Safari #52 2021-05-17 21:34:24 +02:00
lana-k
aa52048d51 Fix file type detection #48
file.type is empty on some Windows machines (Registry settings affects)
2021-05-17 21:32:09 +02:00
lana-k
33913f8f5c fix lint 2021-05-14 16:47:01 +02:00
lana-k
51eb7a543c Merge branch 'master' of github.com:lana-k/sqliteviz 2021-05-14 16:43:13 +02:00
lana-k
a3fb38b23c SQL query execution state in UI #3
- use LoadingIndicator
- use Logs
2021-05-14 16:42:58 +02:00
lana-k
3bb40b4eb7 Improve LoadingIndicator
- size parameters
- smooth animation (use ony transform)
2021-05-14 16:40:55 +02:00
lana-k
6864bf84f8 Update README.md 2021-05-06 21:36:20 +02:00
lana-k
9f1b3823f6 Update README.md 2021-05-06 20:46:36 +02:00
lana-k
7574f529c3 add hidden state for file in animation 2021-05-06 15:17:15 +02:00
lana-k
653f8eff7b minor changes in animation 2021-05-06 15:05:58 +02:00
lana-k
9b3dda6cff delete .nojekyll from master 2021-05-05 23:43:51 +02:00
lana-k
d94604ebfb Merge branch 'master' of github.com:lana-k/sqliteviz 2021-05-05 23:31:17 +02:00
lana-k
16868ef430 add clean-exclude 2021-05-05 23:30:33 +02:00
lana-k
b162c7043e Create .nojekyll 2021-05-05 23:20:46 +02:00
lana-k
8e856063b8 allow files with underscores on GitHub pages 2021-05-05 23:12:47 +02:00
lana-k
8684b4cef9 remove console.log 2021-05-05 21:46:29 +02:00
lana-k
bcaebd4840 Create an empty database #44 2021-05-05 21:44:44 +02:00
lana-k
4619461af8 change period format 2021-05-05 15:08:54 +02:00
lana-k
9fff1d699a update sql.js #43 2021-05-05 15:08:12 +02:00
lana-k
5ab19c3fae show hint in codemirror on Ctrl+Space 2021-05-04 16:33:37 +02:00
lana-k
cc483f4720 change code structure 2021-05-04 14:13:58 +02:00
lana-k
a07f2d3d99 update plotly 2021-05-02 20:59:03 +02:00
lana-k
b9844b8696 refine pwa app icons 2021-05-02 20:46:27 +02:00
lana-k
464bff3db8 delete screenshots 2021-05-02 20:45:24 +02:00
lana-k
00e434e142 fix loading db after csv:
new tab is not opened now
2021-05-02 14:09:02 +02:00
lana-k
5d6280abec add default table in hint options 2021-05-02 14:04:46 +02:00
lana-k
7a39e905b9 trim csv column names 2021-04-30 20:49:37 +02:00
lana-k
297ea2c18a fix path to service worker 2021-04-30 19:42:26 +02:00
lana-k
1f2327a724 fix global css in index.html 2021-04-30 19:04:08 +02:00
lana-k
6d512422cf Update README.md 2021-04-30 17:57:00 +02:00
lana-k
8ce9a01372 Update README.md 2021-04-30 17:54:54 +02:00
lana-k
acd56a85cb Update README.md 2021-04-30 17:54:12 +02:00
lana-k
a45e218e3f Update README.md 2021-04-30 17:50:01 +02:00
lana-k
a2bc495259 7 sec for tests 2021-04-30 14:58:27 +02:00
lana-k
7f4b167dc2 fix service worker registration #12 2021-04-30 14:14:41 +02:00
lana-k
5ded99e89f TextField: display div with label if label passed 2021-04-29 20:47:09 +02:00
lana-k
a991b02a20 First load loading indicator #42 2021-04-29 20:45:49 +02:00
lana-k
9b6aa3d6c7 add manifest and offline support #12 2021-04-29 16:19:25 +02:00
lana-k
92022f9083 resolve exportToFile in a test 2021-04-28 11:41:25 +02:00
lana-k
15636fed5f increase timeout for tests;
fix warnings in tests
2021-04-28 10:46:40 +02:00
lana-k
9ed53e0d25 Export db #34 2021-04-27 22:51:36 +02:00
lana-k
35baaf2722 Update schema view after script running #38 2021-04-27 15:54:51 +02:00
lana-k
453098b410 Support all CSV media types #37 2021-04-27 13:42:58 +02:00
lana-k
a469de3674 dasharray with units (fix for Firefox) #27 2021-04-24 16:54:16 +02:00
lana-k
24411ac18f fix error handling for web worker in Firefox #27 2021-04-24 16:53:19 +02:00
lana-k
a7ef152140 Enable touch events in headless Firefox 2021-04-24 16:52:15 +02:00
lana-k
97c0c6191b run tests in Firefox 2021-04-24 16:00:31 +02:00
lana-k
9a91dd19bf Fix delimiter highlighting in Firefox #27
input:first-line doesn't work in Firefox.
So, we use input background instead
2021-04-23 16:36:52 +02:00
lana-k
472794e203 fixes in readme #27 2021-04-22 18:29:55 +02:00
lana-k
58d4a7bacd update readme #27 2021-04-22 18:23:07 +02:00
lana-k
d0c624a3cc Show result of the last query in a script #36 2021-04-22 17:01:46 +02:00
lana-k
9e29a12ebb add ctrl+enter for running queries #35 2021-04-22 14:53:14 +02:00
lana-k
fdbac941d5 change the welocome msg #27 2021-04-22 14:11:56 +02:00
lana-k
628e9cee62 add tests for DbUploader #27 2021-04-22 14:04:52 +02:00
lana-k
803622f18f move tests to tests folder
rename util modules
rename DbUpload to DbUploader
add tests for DbUploader component #27
2021-04-21 11:05:56 +02:00
lana-k
edd45b317a add new sql.js module and tests #27 2021-04-19 15:01:40 +02:00
lana-k
6ce5d2b201 add tests for DelimiterSelector #27 2021-04-16 15:14:41 +02:00
lana-k
5c9a5560b7 add test for disabled state for checkBox #27 2021-04-13 21:31:35 +02:00
lana-k
13a8b33815 add tests for database module #27 2021-04-13 11:20:15 +02:00
lana-k
5ba371e339 fix lint errors 2021-04-12 18:25:21 +02:00
lana-k
5db8376f95 add tests for readAsArrayBuffer method #27 2021-04-12 18:23:48 +02:00
lana-k
be56079e4e add tests for LoadingIndicator component #27 2021-04-12 16:06:41 +02:00
lana-k
a7c8c29624 add tests for Logs component #27 2021-04-12 14:28:16 +02:00
lana-k
9ce1c27cf5 fix lint errors 2021-04-11 22:19:14 +02:00
lana-k
b2d21cc859 add test for setDb store mutation #27 2021-04-11 22:11:44 +02:00
lana-k
1945467dc7 restore sinon in afterEach hook 2021-04-11 21:52:09 +02:00
lana-k
73c0936927 add tests for csv module #27 2021-04-11 21:51:44 +02:00
lana-k
8867092601 add tests for dbUtils module #27 2021-04-10 21:19:00 +02:00
lana-k
c7039e144a add test for time,js module #27 2021-04-10 20:50:42 +02:00
lana-k
b30eeb6788 add CSV support #27 2021-04-10 18:24:53 +02:00
lana-k
c2864b4308 add hint and disabled state for TextField 2021-04-08 19:53:15 +02:00
lana-k
ba75685a23 add disabled state for dropDownChevron 2021-04-08 19:52:14 +02:00
lana-k
9314e27d0e add disabled state for clear icon 2021-04-08 19:51:43 +02:00
lana-k
d4d68bb682 add hint-icon component 2021-04-08 19:51:12 +02:00
lana-k
05b642bc86 add preview mode for SqlTable 2021-04-08 19:50:14 +02:00
lana-k
62386d3fc0 add LoadingIndicator component 2021-04-08 19:49:36 +02:00
lana-k
2acfc75da2 add Logs component 2021-04-08 19:43:15 +02:00
lana-k
98cc09741c add styles for disabled secondary buttons 2021-04-08 19:41:42 +02:00
lana-k
abc852624a Changes in CheckBox:
- add disabled state for CheckBox;
- label for CheckBox
2021-04-08 19:39:33 +02:00
lana-k
7791f477cb Some changes in DelimiterSelector:
- disabled state for DelimiterSelector;
- DelimiterSelector emits the value only if it's not empty
2021-04-08 19:37:33 +02:00
lana-k
eb950c1b9c fix toggle buttons in splitpanes 2021-03-21 21:48:33 +01:00
lana-k
e60a28ca23 add DelimiterSelector component 2021-03-21 21:47:59 +01:00
lana-k
4b67fb268b fixes in readme 2021-03-15 22:14:10 +01:00
lana-k
8f445ba570 add more info in readme 2021-03-15 22:01:44 +01:00
lana-k
0bf5300c9d fix timezone 2021-03-13 18:16:11 +01:00
lana-k
a8e12d64a0 tests for MyQueries 2021-03-13 17:09:41 +01:00
lana-k
aa63aa94ee MyQueries refactoring 2021-03-13 17:08:47 +01:00
lana-k
8decda51a4 add tests for splitter and touch events 2021-03-13 16:58:45 +01:00
lana-k
d52f822c15 fix main menu test 2021-03-13 16:58:18 +01:00
lana-k
507e978386 avoid unnecessary $set 2021-03-13 16:57:26 +01:00
lana-k
a457f967c0 add tests for MainMenu component 2021-03-03 22:42:55 +01:00
lana-k
854d2adfca add test to DbUpload
check that it doesn't redirect to /editor if it's already there
2021-03-03 22:33:57 +01:00
lana-k
6118a12672 add ctrl+b on /my-queries page 2021-03-03 22:32:28 +01:00
lana-k
7bd8388fd6 fix lint errors 2021-02-28 21:29:52 +01:00
lana-k
664c43bce1 DbUploader tests 2021-02-28 21:27:49 +01:00
lana-k
95d6d6131e minor changes 2021-02-28 21:27:26 +01:00
lana-k
46757bd5ef exclude router/index.js from coverage 2021-02-28 21:27:10 +01:00
lana-k
43cfc8d815 DbUpload refactoring 2021-02-28 21:26:37 +01:00
lana-k
6cb0d2d95d add tests for Pager 2021-02-26 21:19:13 +01:00
lana-k
8e5e2787c7 add tests for Splitpanes 2021-02-26 21:18:59 +01:00
lana-k
4014aa5730 add tests for splitter.js 2021-02-25 18:43:13 +01:00
lana-k
869da1da74 Splitpanes refactoring 2021-02-25 18:42:57 +01:00
lana-k
3b34f81d56 minor change 2021-02-17 17:58:34 +01:00
lana-k
720f23745f Splitpanes.vue refactoring 2021-02-17 17:57:45 +01:00
lana-k
797430e9f8 minor changes 2021-02-17 16:53:28 +01:00
lana-k
f6559c1015 fix lint errors 2021-02-15 13:58:25 +01:00
lana-k
2974bc6d34 add tests for Chart.vue 2021-02-15 12:40:41 +01:00
lana-k
f3beeb9f1c fix error logs in tests 2021-02-12 22:05:51 +01:00
lana-k
36f0809546 restore sinon 2021-02-12 21:47:39 +01:00
lana-k
896b8af1a2 add tests for chart module 2021-02-12 21:39:47 +01:00
lana-k
7e26446573 add chart module (refactoring) 2021-02-12 18:57:18 +01:00
lana-k
9a7dca3482 lint fixes 2021-02-11 16:53:24 +01:00
lana-k
f6c7c9283e lint fixes 2021-02-11 16:48:37 +01:00
lana-k
840f4fa450 add sqlEditor test; refactoring 2021-02-11 16:45:18 +01:00
lana-k
d68616b543 add Tab tests 2021-02-10 17:46:45 +01:00
lana-k
9e41dab43e import sinon 2021-02-04 16:22:30 +01:00
lana-k
5006f6935a add test for closing browser tab 2021-02-04 16:19:25 +01:00
lana-k
9d38f2a047 add test for Tabs component 2021-02-02 23:48:24 +01:00
lana-k
a787d9afb2 minor changes 2021-02-02 23:39:24 +01:00
lana-k
82592ed69d add plugins in tests 2021-02-02 23:38:09 +01:00
lana-k
3bcf0b9ea6 restore methods on Schema tests 2021-01-30 20:26:09 +01:00
lana-k
cd866fcf50 lint fixes 2021-01-30 20:22:35 +01:00
lana-k
8eb33633e2 add tests for Schema component 2021-01-30 20:21:40 +01:00
lana-k
5c17638a90 add getFileFromUser function 2021-01-30 20:20:51 +01:00
lana-k
7550c1e8bd add tests for tableDescription component 2021-01-28 22:32:27 +01:00
lana-k
82b80e4760 add test for mixins 2021-01-28 17:57:43 +01:00
lana-k
6cf22cef09 add hideTooltip method to mixin 2021-01-28 17:11:21 +01:00
lana-k
a8f49d9187 lint fix 2021-01-27 21:04:43 +01:00
lana-k
d45212733d storedQueries module is covered by tests 2021-01-27 21:00:22 +01:00
lana-k
f640727d96 add tests for deserialiseQueries 2021-01-26 20:36:56 +01:00
lana-k
242b65c446 add readFile test 2021-01-26 19:51:07 +01:00
lana-k
e041e58e7f add importFile test 2021-01-26 19:40:36 +01:00
lana-k
083386383e add readFile to fileUtils 2021-01-26 17:38:19 +01:00
lana-k
3aa9c144e3 refactor import function 2021-01-22 22:43:32 +01:00
lana-k
ba44a6dfc6 fix lint errors 2021-01-21 14:08:06 +01:00
lana-k
8652edc139 refactor reading predefined queries 2021-01-21 13:25:29 +01:00
lana-k
6886b7903f add test for exportToFile 2021-01-21 12:49:10 +01:00
lana-k
1be139d327 add a test for serialiseQueries 2021-01-20 17:17:23 +01:00
lana-k
86825475f0 add fileUtilities module 2021-01-20 17:16:33 +01:00
lana-k
eb1f71608d export refactoring 2021-01-19 22:56:50 +01:00
lana-k
58401edc35 final fix watchers 2021-01-14 20:07:54 +01:00
lana-k
6dede6ee4d another try 2021-01-14 18:57:03 +01:00
lana-k
42199f6ebc ignore node_modules in watch 2021-01-14 18:48:11 +01:00
lana-k
badcefc4f7 no watchers during testing 2021-01-14 18:12:59 +01:00
lana-k
b55dec55ee Fix watchers amount 2021-01-14 17:45:59 +01:00
lana-k
8e73e526ec fix lint errors 2021-01-13 22:39:19 +01:00
lana-k
fd6d7b8b3a minor changes 2021-01-13 22:15:10 +01:00
lana-k
6612f4444b add tests in github actions 2021-01-13 21:51:04 +01:00
lana-k
3168c77c17 add tests for isTabNeedName 2021-01-13 21:12:16 +01:00
lana-k
33a9b261bf use .have.lengthOf in assertions 2021-01-12 21:04:13 +01:00
lana-k
11721590c1 first test for storedQueries module 2021-01-12 20:56:48 +01:00
lana-k
78e803b95d refactor import method 2021-01-06 19:57:02 +01:00
lana-k
8d083a93c4 refactoring manipulations with My queries 2021-01-05 23:09:47 +01:00
lana-k
9035cae19f refactor MainMenu methods 2021-01-04 21:49:30 +01:00
lana-k
e98fa8793b add checkBox tests 2021-01-01 21:14:57 +01:00
lana-k
ef461be3e5 add store tests 2021-01-01 18:47:16 +01:00
lana-k
4c2da33d01 make json valid 2020-12-29 16:08:18 +01:00
lana-k
c3ae115546 use execute method 2020-12-28 12:46:45 +01:00
lana-k
bbcb553fdc fix test coverage 2020-12-28 12:42:57 +01:00
lana-k
08e4f5333d minor changes 2020-12-27 18:31:28 +01:00
lana-k
dc3979584c move sql parsing to dataBase module 2020-12-27 18:30:43 +01:00
lana-k
34764a6e33 remove saveDbName method (refactor) 2020-12-27 18:03:04 +01:00
lana-k
1150b2e7c4 Add hotkeys #6 2020-12-25 18:15:20 +01:00
lana-k
d66eb48088 fix state updating 2020-12-24 15:40:54 +01:00
lana-k
07cc00671f Add Warn about unsaved tab(s) #23 2020-12-24 14:31:45 +01:00
lana-k
c1504dc2b3 fix images for Firefox 2020-12-23 17:41:16 +01:00
lana-k
bc3524e1a7 fix fonts 2020-12-23 15:16:53 +01:00
lana-k
71f585eef5 add new tab only if was not already opened 2020-12-22 17:10:58 +01:00
lana-k
02091dddb7 use close icon component in Tabs 2020-12-22 16:30:14 +01:00
lana-k
9fca9b29dc Fix: Search table error #29 2020-12-22 16:09:03 +01:00
lana-k
94bb793b23 Fix: Tiny SVGs are not embedded #26 2020-12-21 22:22:59 +01:00
lana-k
e2db4e2634 chande button label 2020-12-21 11:23:59 +01:00
lana-k
6e29791892 minor changes 2020-12-20 22:30:40 +01:00
lana-k
068195589a wait for animation and file uploading 2020-12-20 14:29:53 +01:00
lana-k
6b72a937ea Move illustration to DbUpload component 2020-12-20 12:36:09 +01:00
lana-k
43e357de5b fix layout #19 2020-12-20 11:43:33 +01:00
lana-k
00c2fb86c5 add 'load db' illustration and animation #19 2020-12-19 23:28:45 +01:00
lana-k
085813ec50 Fix SQL editor issues #20 2020-12-17 19:23:51 +01:00
lana-k
0339aafe14 Save dialog remembers the name for another tab #22 2020-12-17 18:15:41 +01:00
lana-k
c2a155c561 License file is missing in the build #21 2020-12-16 22:38:05 +01:00
lana-k
5dbffe0c56 Pre-defined query file should be empty #24 2020-12-16 22:13:26 +01:00
lana-k
00d671fac0 Rename connection to loading #25 2020-12-16 22:02:53 +01:00
lana-k
18c8b30bef add coverage to gitignore 2020-12-16 19:15:52 +01:00
lana-k
0df9a7b982 remove unused component 2020-12-16 19:10:43 +01:00
lana-k
0c777b9f30 add proxy and test 2020-12-16 19:05:05 +01:00
lana-k
2aac74fba2 - 2020-12-15 14:45:45 +01:00
lana-k
6a1dcfc187 add karma packages 2020-12-15 14:43:17 +01:00
lana-k
cb49b7b6cb karma attempt 2020-12-15 12:32:05 +01:00
lana-k
a1a330986d small refactor 2020-11-25 22:04:11 +01:00
lana-k
3b43fcddb4 remove unused code 2020-11-25 21:41:38 +01:00
lana-k
5ed3266942 0.6.0 2020-11-20 19:18:42 +01:00
lana-k
debaa21b96 minor changes 2020-11-20 19:12:38 +01:00
lana-k
1996c1d853 Merge branch 'master' of github.com:lana-k/sqliteviz 2020-11-20 19:10:05 +01:00
lana-k
79c3eb7dd2 add favicon #19 2020-11-20 19:09:55 +01:00
lana-k
bd3e3399b3 use svg in readme 2020-11-20 17:10:57 +01:00
lana-k
42d817f261 Merge branch 'master' of github.com:lana-k/sqliteviz 2020-11-20 17:04:12 +01:00
lana-k
37d3f33926 add svg logo #19 2020-11-20 17:03:57 +01:00
lana-k
595199a3c2 add logo to readme #19 2020-11-20 16:23:25 +01:00
lana-k
bf62fcf0b9 add logo #19 2020-11-20 16:13:20 +01:00
lana-k
e1969bf553 fix import in FF; fix table styles in FF 2020-11-16 16:20:13 +01:00
lana-k
3d059ecf0c height limit for My Queries table 2020-11-16 13:20:02 +01:00
lana-k
e72510f236 Make a table/chart area collapsable #18 2020-11-14 23:09:31 +01:00
lana-k
d586e43d6e fix some minor style issues 2020-11-14 23:08:19 +01:00
lana-k
20c1e3f1cc Fix plotly settings panel overflow #14 2020-11-14 20:55:44 +01:00
lana-k
c991691fcb add .sqlite extension in db uploader 2020-11-14 20:36:35 +01:00
lana-k
39151732cf No db in schema sidebar #10 2020-11-13 23:32:37 +01:00
lana-k
92e6150ea5 add licence in package.json 2020-11-13 23:23:53 +01:00
lana-k
d4c233e1ef new splitter style 2020-11-13 23:21:04 +01:00
lana-k
05243ec991 dbuploader is a component now #10 2020-11-13 16:43:21 +01:00
lana-k
ec2b2b21d0 return predefined query 2020-11-13 16:04:09 +01:00
lana-k
1ae68a0043 Create LICENSE 2020-11-13 15:56:22 +01:00
lana-k
19f3e8b74a Empty state for my queries #8 2020-11-12 18:11:36 +01:00
lana-k
f65953a2e1 Add schema tokens in codemirror autocomplit #1 2020-11-12 15:30:37 +01:00
lana-k
c5fa3e903a Fix wrong trigger of autocomplete #15 2020-11-11 22:42:44 +01:00
lana-k
3f0a7597a2 Virtual tables are displayed now #13 2020-11-11 19:45:41 +01:00
lana-k
9912ed24cf new design for tab header and sql editor 2020-11-11 14:41:55 +01:00
lana-k
4c685b6d7c move to dist 2020-11-10 21:37:32 +01:00
lana-k
a37edc501b create an archive 2020-11-10 21:33:35 +01:00
lana-k
46a9d1613b minor changes 2020-11-10 20:12:06 +01:00
lana-k
b08265fab9 minor changes 2020-11-10 20:05:40 +01:00
lana-k
f1b5f5e3c7 rename github action 2020-11-10 18:58:12 +01:00
lana-k
e08fdbecbc fix Create release action 2020-11-10 18:53:42 +01:00
lana-k
a5ba1cb821 add release.yml 2020-11-06 16:58:29 +01:00
lana-k
7da1cb36fa Add tooltips #9 2020-11-06 12:20:44 +01:00
lana-k
57c8fe5bc8 Add table filter in schema sidebar #7 2020-11-05 17:29:38 +01:00
lana-k
e7d3da8869 fade out in schema 2020-11-05 13:48:02 +01:00
lana-k
5dc80751c4 add padding to schema 2020-11-04 22:31:38 +01:00
lana-k
3e52dcac2c move run button to the menu 2020-11-04 22:18:04 +01:00
lana-k
1037185a6a add predefined queries 2020-11-04 19:13:27 +01:00
93 changed files with 642 additions and 20513 deletions

View File

@@ -1,3 +0,0 @@
> 1%
last 2 versions
not dead

View File

@@ -1,5 +0,0 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

View File

@@ -1,28 +0,0 @@
module.exports = {
root: true,
env: {
node: true
},
extends: [
'plugin:vue/essential',
'@vue/standard'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)'
],
env: {
mocha: true
}
}
]
}

View File

@@ -1,29 +0,0 @@
name: Deploy to GitHub Pages
on:
workflow_dispatch:
push:
tags:
- '*'
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: npm install and build
run: |
npm install
npm run build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@3.6.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: build # The branch the action should deploy to.
FOLDER: dist/ # The folder the action should deploy.
CLEAN: false # Automatically remove deleted files from the deploy branch

22
.gitignore vendored
View File

@@ -1,22 +0,0 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

105
Basic-usage.md Normal file
View File

@@ -0,0 +1,105 @@
# Basic usage
## Choose SQLite database or CSV file
You can choose a database or a CSV file right on the welcom page (fig. 1). The
supported file extentions: `.csv`, `.db`,`.sqlite` and `.sqlite3`.
![Fig. 1: Welcome page](./img/Screenshot_welcome.png)
If you choose a CSV file it will be parsed. Then sqliteviz creates a new
database with data from the CSV. You can change parsing settings and table name
in the dialog which is shown automatically if you choose a CSV file (fig. 2).
![Fig. 2: CSV import dialog](./img/Screenshot_csv.png)
If you don't have a database or CSV press `Create empty database` button and
then fill an empty database using DDL and DML statements. A tab with an example
of how to do it will be opened automatically (fig. 3).
![Fig. 3: Workspace (empty database)](./img/Screenshot_editor.png)
Database tables, columns and their types are shown in the left panel of the
`Workspace` (fig. 4).
![Fig. 4: Workspace (not empty database)](./img/Screenshot_editor_with_db.png)
## Create inquiry
### Open new tab
Press `Create` button in the top toolbar or use `Ctrl+b` (`Cmd+b` for MacOS)
keyboard shortcut to open a new tab for an inquiry. An inquiry consists of three
parts: SQL query, result set (result of the query execution) and visualisation
of the result set. A tab consists of two panels. Each of them can show one of
the three parts of inquiry. By default the top panel shows SQL query editor and
the bottom panel shows the result set. You can switch any panel to any other
view with corresponding buttons in the right side toolbar.
* ![](./img/sql.svg) Switch the panel to an SQL query editor. In that
editor you can specify and run not only a `SELECT` statement for getting data
but also DDL/DML statements for modifying the database.
* ![](./img/table.svg) Switch the panel to the result set. Here you
can see the result of the query execution.
* ![](./img/visualisation.svg) Switch the panel to visualisation. This
panel allows building a pivot table and charts from the result set.
> **Note:** The query editor can show you hints: SQL keywords, table and column
> names. In a common case column names are shown in the hint if you specify the
> table name, e.g. `SELECT table_name.`. But if there is only one table in your
> database column names will be always available in the hint. Press `Ctrl+Space`
> to show a hint explicitly.
### Run query
Press ![](./img/run.svg) button in the right side toolbar of an SQL
editor panel or use `Ctrl+r` or `Ctrl+Enter` (`Cmd+r` or `Cmd+Enter` for MacOS)
keyboard shortcut to execute a query in the current opened tab.
> **Note:** Running is not available if a query for the current tab is not
> specified.
The query result will be displayed in the result panel (fig. 4).
### Create visualisation
After running a query switch any panel to the visualisation. Switch to the
disired type of visualisation with buttons in the right side toolbar of the
visualisation panel.
* ![](./img/chart.svg) Switch to a chart type visualisation.
* ![](./img/pivot.svg) Switch to a pivot type visualisation.
> **Note:** All unsaved changes in the current visualisation will be lost when
> you switch to the other visualisation type.
A pivot table can be represented as a regular or multi-header table or
visualised with a chart.
Read more details of working with pivot in [Pivot tables][2].
All customised charts in sqliteviz are created with a `react-chart-editor`
component (fig. 5). The same component with some additional features is used in
Plotly Chart Studio. Explore its [documentation][1] to learn how to build charts
with `react-chart-editor`.
![Fig. 5: Visualisation with a chart](./img/Screenshot_chart.png)
You can save any visualisation as an image by clicking ![](./img/camera.svg).
## Save inquiry
Press `Save` button in the top toolbar or use `Ctrl+s` (`Cmd+s` for MacOS)
keyboard shortcut to save an inquiry in the current opened tab to local storage
of your browser.
After that, the inquiry will be in the list on `Inquiries` page.
> **Note:** Only the text of the SQL query and the visualisation settings will
> be saved. The result of the query execution won't be saved.
[1]: https://plotly.com/chart-studio-help/tutorials/#basic
[2]: ../Pivot-table

10
Diagnostic-information.md Normal file
View File

@@ -0,0 +1,10 @@
# Diagnostic information
SQLite running in sqliteviz is compiled with particular [options][1] that can
enable or disable some SQLite features. You can get a list of them in `App
info` dialog (fig. 1) by clicking on ![](./img/info.svg) icon in the top
toolbar.
![Fig. 1: App info dialog](./img/Screenshot_app_info.png)
[1]: https://sqlite.org/compile.html

View File

@@ -0,0 +1,6 @@
# Export current database
Sqliteviz allows running not only `SELECT` statements but DML/DDL statements
too. You can save database modifications into a `.sqlite` file by clicking on
icon ![](./img/file-export.svg) next to the database name on `Workspace`
page.

30
Home.md Normal file
View File

@@ -0,0 +1,30 @@
Welcome to the sqliteviz wiki!
# For users
1. [Installation][0]
2. [Basic usage][1]
3. [Multiple CSV file import][9]
4. [Manage inquiries][2]
5. [Export current database][4]
6. [Pivot table][3]
7. [Predefined inquiries][5]
8. [Diagnostic information][6]
## Examples and tutorials
1. [How to rename tables and columns after CSV import][8]
2. [How to build a pivot table in SQL(ite)][10]
# For developers
1. [Integrate predefined inquiries][7]
[0]: Installation
[1]: Basic-usage
[2]: Manage-inquiries
[3]: Pivot-table
[4]: Export-current-database
[5]: Predefined-inquiries
[6]: Diagnostic-information
[7]: Integrate-predefined-inquiries
[8]: How-to-rename-tables-and-columns-after-CSV-import
[9]: Multiple-CSV-file-import
[10]: How-to-build-a-pivot-table-in-SQLite

View File

@@ -0,0 +1,137 @@
# How to build a pivot table in SQLite
This how-to explores how to build pivot tables in SQLite, which doesn't have a
special constructs like `PIVOT` or `CROSSTAB` in its SQL dialect.
## Static-column pivot table
If the columns of a pivot table are known beforehand, it's possible to write a
standard, say SQL-92, query that would produce a pivot table in its result set.
This example uses World Bank [country indicators][1]. This query calculates
average fertility and life expectancy for a few country groups.
```sql
SELECT
"Country Name",
AVG(IIF(
FLOOR(year / 10) = 196 AND "Indicator Name" LIKE 'Fertility rate%',
value,
NULL
)) AS "FR 196x",
AVG(IIF(
FLOOR(year / 10) = 196 AND "Indicator Name" LIKE 'Life expectancy%',
value,
NULL
)) AS "LE 196x",
AVG(IIF(
FLOOR(year / 10) = 197 AND "Indicator Name" LIKE 'Fertility rate%',
value,
NULL
)) AS "FR 197x",
AVG(IIF(
FLOOR(year / 10) = 197 AND "Indicator Name" LIKE 'Life expectancy%',
value,
NULL
)) AS "LE 197x",
AVG(IIF(
FLOOR(year / 10) = 198 AND "Indicator Name" LIKE 'Fertility rate%',
value,
NULL
)) AS "FR 198x",
AVG(IIF(
FLOOR(year / 10) = 198 AND "Indicator Name" LIKE 'Life expectancy%',
value,
NULL
)) AS "LE 198x",
AVG(IIF(
FLOOR(year / 10) = 199 AND "Indicator Name" LIKE 'Fertility rate%',
value,
NULL
)) AS "FR 199x",
AVG(IIF(
FLOOR(year / 10) = 199 AND "Indicator Name" LIKE 'Life expectancy%',
value,
NULL
)) AS "LE 199x",
AVG(IIF(
FLOOR(year / 10) = 200 AND "Indicator Name" LIKE 'Fertility rate%',
value,
NULL
)) AS "FR 200x",
AVG(IIF(
FLOOR(year / 10) = 200 AND "Indicator Name" LIKE 'Life expectancy%',
value,
NULL
)) AS "LE 200x"
FROM country_indicators
WHERE "Country Name" IN(
'Arab World',
'Central Europe and the Baltics',
'East Asia & Pacific',
'European Union',
'Latin America & Caribbean',
'High income',
'Middle income',
'Low income'
)
GROUP BY 1
ORDER BY
CASE "Country Name"
WHEN 'High income' THEN 1
WHEN 'Middle income' THEN 2
WHEN 'Low income' THEN 3
WHEN 'European Union' THEN 4
WHEN 'Central Europe and the Baltics' THEN 5
WHEN 'East Asia & Pacific' THEN 6
WHEN 'Latin America & Caribbean' THEN 7
WHEN 'Arab World' THEN 8
ELSE 99
END
```
## Dynamic-column pivot table
SQLite in sqliteviz is built with [pivot_vtab][2] extension. The same result set
can be produced with this, arguably simpler and more maintainable, query.
```sql
CREATE VIRTUAL TABLE temp.pivot USING pivot_vtab(
(
WITH t(country_name) AS (VALUES
('High income'),
('Middle income'),
('Low income'),
('European Union'),
('Central Europe and the Baltics'),
('East Asia & Pacific'),
('Latin America & Caribbean'),
('Arab World')
)
SELECT country_name FROM t
),
(
SELECT
FLOOR(year / 10) || '|' || "Indicator Name" column_key,
CASE
WHEN "Indicator Name" LIKE 'Fertility rate%' THEN 'FR'
WHEN "Indicator Name" LIKE 'Life expectancy%' THEN 'LE'
END || ' ' || FLOOR(year / 10) || 'x' column_name
FROM country_indicators
WHERE
"Indicator Name" LIKE 'Fertility rate%'
OR "Indicator Name" LIKE 'Life expectancy%'
GROUP BY 1
),
(
SELECT AVG(value)
FROM country_indicators
WHERE
"Country Name" = :country_name
AND FLOOR(year / 10) || '|' || "Indicator Name" = :column_key
)
);
SELECT * FROM pivot
```
[1]: https://github.com/plotly/datasets/blob/master/country_indicators.csv
[2]: https://github.com/jakethaw/pivot_vtab

View File

@@ -0,0 +1,54 @@
# How to rename tables and columns after CSV import
## Rename columns
If sqliteviz parses CSV without `Use first row as column headers` option then
it will name the columns like `col1`, `col2` etc. You can easily rename the
columns after import with `ALTER TABLE` statements like this:
```sql
ALTER TABLE your_table_name
RENAME COLUMN current_column_name TO new_column_name;
```
### Column rename example
There is a table `dots` with columns `col1`, `col2`, `col3`. Here are the steps
to rename the columns to `x`, `y` and `z` respectively:
- Click `Create` in the top toolbar
- In the opened query editor write a script
```sql
ALTER TABLE dots
RENAME COLUMN col1 TO x;
ALTER TABLE dots
RENAME COLUMN col2 TO y;
ALTER TABLE dots
RENAME COLUMN col3 TO z;
```
- Click ![](./img/run.svg) to run the script
## Rename table
```sql
ALTER TABLE current_table_name
RENAME TO new_table_name;
```
### Table rename example
There is a table `dots`. Here are the steps to rename it to `point`:
- Click `Create` in the top toolbar
- In the opened query editor write a script
```sql
ALTER TABLE dots RENAME TO point
```
- Click ![](./img/run.svg) to run the script

16
Installation.md Normal file
View File

@@ -0,0 +1,16 @@
# Installation
The latest release of sqliteviz is running on [Github pages][1].
Basically, you don't need to install sqliteviz. But if you want you can install
it and use it as a regular desktop application with the following steps:
1. Open sqliteviz with [Chrome browser][2]
2. At the top right of the address bar, click `Install`
3. Confirm installation
See more about PWA on [Google Chrome Help][3].
[1]: https://lana-k.github.io/sqliteviz
[2]: https://www.google.com/chrome
[3]: https://support.google.com/chrome/answer/9658361?hl=en&ref_topic=7439636

View File

@@ -0,0 +1,12 @@
# Integrate predefined inquiries
If you run sqliteviz on your own server you can specify predefined inquiries.
These inquiries will appear in `Inquiries` list for all users working with
sqliteviz on your server.
To create a list of predefined inquiries choose inquiries in `Inquiries` list
and export them to `inquiries.json`. Then (re)place this file on the server in
the same directory as `index.html`.
A user can't edit, rename or delete a predefined inquiry. The rest operations
are available.

39
Manage-inquiries.md Normal file
View File

@@ -0,0 +1,39 @@
# Manage inquiries
## Organise
You can find all inquiries that you saved in `Inquiries` (fig. 1).
![Fig. 1: Inquiries](./img/Screenshot_my_inquiries.png)
To manipulate one inquiry hover the cursor over the row with the inquiry and
choose the action:
* ![](./img/rename.svg) rename an inquiry
* ![](./img/copy.svg) duplicate an inquiry
* ![](./img/file-export.svg) export an inquiry to JSON file
* ![](./img/delete.svg) delete an inquiry
To edit a query or visualisation settings of an inquiry click on the respective
row. You will be redirected to `Workspace` where the chosen inquiry will be
opened in a tab.
> **Note:** After opening an inquiry there will be no visualisation for it even
> if you specified it and saved. That is so because there is no data to build
> the visualisation. Run the query and all saved chart settings will be applied.
You can also delete or export a group of inquiries to a JSON file. Select
inquiries with checkboxes and press `Delete`/`Export` button above the grid
(fig. 2).
![Fig. 2: Inquiries: a group of inquiries is selected](./img/Screenshot_group.png)
> **Note:** Some operations are not available for predefined inquiries. Read
> [Predefined inquiries][1] for details.
## Import
Click `Import` button on `Inquiries` page to import inquiries from a JSON file
generated by export.
[1]: ../Predefined-inquiries

View File

@@ -0,0 +1,12 @@
# Multiple CSV file import
Sometimes it's useful to import several CSV files as tables in one database. For
example, to be able to `JOIN` them in SQL.
In sqliteviz you can not only create a database from a CSV file, but also add
another table from CSV to the existing database.
- Click ![](./img/add-csv.svg) icon in the schema panel on `Workspace`
page
- Choose a CSV file
- Import it with `CSV import` dialog.

53
Pivot-table.md Normal file
View File

@@ -0,0 +1,53 @@
# Pivot table
## Pivot table UI
Sqliteviz allows building pivot tables and visualizing them. To build a pivot
run a query to get data. Then open visualisation panel by clicking ![](./img/visualisation.svg)
in any of the two side toolbars and choose a pivot mode by clicking ![](./img/pivot.svg).
A pivot visualisation has the following settings:
- Columns choose one or more column names from the result set. The values in
the chosen columns will be column names of the pivot table.
- Rows choose one or more column names from the result set. The values in the
chosen columns will be row names of the pivot table.
- Order of columns and rows.
- Aggregator and its arguments a function which will be used for pivot cell
calculation. An aggregator can have from zero to two arguments. An aggregator
argument is one of the columns of the result set.
- View pivot table visualisation. It can be a table, a heatmap, a chart,
etc. See some examples of different views of the same pivot table below.
![Fig. 1: Table](./img/Screenshot_pivot_table.png)
![Fig. 2: Heatmap](./img/Screenshot_pivot_heatmap.png)
![Fig. 3: Horizontal Stacked Bar Chart](./img/Screenshot_pivot_barchart.png)
There are several built-in chart views for a pivot. But you can build your own
with `Custom chart` view (fig. 4).
![Fig. 4: Custom Chart](./img/Screenshot_pivot_custom chart.png)
> **Note:** You can switch to other pivot views and back to `Custom chart`
> all your custom chart settings will be remembered. But if you switch the
> visualisation mode from pivot to any other mode, unsaved changes will be lost.
You can save any visualisation as an image by clicking ![](./img/camera.svg).
## Pivot table SQL
Pivot table (in the form of a result set) can be built on the SQL-level and,
technically speaking, can be visualised as any other result set. Practically
though there are a couple of challenges with that:
1. Visualising a dataset of long/tall shape is much more convenient in Plotly
(chart editor) rather than one of wide/fat shape.
2. SQLite doesn't have a special constructs like `PIVOT` or `CROSSTAB` in
its SQL dialect.
[How to build a pivot table in SQL(ite)][1] explores two options with static
(or beforehand-known) and dynamic columns.
[1]: How-to-build-a-pivot-table-in-SQLite

16
Predefined-inquiries.md Normal file
View File

@@ -0,0 +1,16 @@
# Predefined inquiries
Predefined inquiries come out of the box on the sqliteviz instance. In sqliteviz
deployed on [Github Pages][1] there are no predefined inquiries, but you may
see them if you use sqliteviz integrated into another app.
These inquiries are shown in `Inqueries` list with a special label on the mouse
over (fig. 1).
![Fig. 1: Predefined inquiry](./img/Screenshot_predefined.png)
As a user, you can't rename or delete a predefined inquiry. You can't save
changes in a predefined inquiry, but you can save them as a new inquiry. The
rest operations, copy and export, are available.
[1]: https://lana-k.github.io/sqliteviz

View File

@@ -1,21 +0,0 @@
# sqliteviz
**Note: This is a work-in-progress project.**
Sqliteviz is a single-page application for fully client-side visualisation of SQLite databases.
It's a kind of middleground between [Plotly Falcon][1] and [Redash][2].
It is built on top of [react-chart-editor][3] and [sql.js][4] in [Vue.js][5].
## Features
1. Ad-hoc and prepared visualisation of a SQLite database using flexibility
of SQL and richness of Plotly's `react-chart-editor`
2. Visualisation pallete, SQL and chart definitions, kept in local
storage with import/export
3. Integration-side provided pallete
[1]: https://github.com/plotly/falcon
[2]: https://github.com/getredash/redash
[3]: https://github.com/plotly/react-chart-editor
[4]: https://github.com/sql-js/sql.js
[5]: https://github.com/vuejs/vue

View File

@@ -1,5 +0,0 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

BIN
img/Screenshot_app_info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
img/Screenshot_chart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
img/Screenshot_csv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
img/Screenshot_editor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
img/Screenshot_group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
img/Screenshot_result.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
img/Screenshot_welcome.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

10
img/add-csv.svg Normal file
View File

@@ -0,0 +1,10 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.6573 1.5H2.59985C1.77485 1.5 1.09985 2.175 1.09985 3V13.6649C1.09985 14.4899 1.77485 15.1649 2.59985 15.1649H9.84V13.6649H8.87866V9.08244H13.6573V9.83777H15.1573V3C15.1573 2.17 14.4873 1.5 13.6573 1.5ZM13.6573 7.58244V3H8.87866V7.58244H13.6573ZM7.37866 3H2.59985V7.58244H7.37866V3ZM2.59985 9.08244V13.6649H7.37866V9.08244H2.59985ZM13.1702 10.8434H15.6702V13.1717H18.0001V15.6717H15.6702V18H13.1702V15.6717H10.8401V13.1717H13.1702V10.8434Z" fill="#A2B1C6"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="18" height="18" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 739 B

5
img/camera.svg Normal file
View File

@@ -0,0 +1,5 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9 5.51953C6.57686 5.51953 4.60547 7.49092 4.60547 9.91406C4.60547 12.3372 6.57686 14.3086 9 14.3086C11.4231 14.3086 13.3945 12.3372 13.3945 9.91406C13.3945 7.49092 11.4231 5.51953 9 5.51953ZM9 12.9023C7.35226 12.9023 6.01172 11.5618 6.01172 9.91406C6.01172 8.26632 7.35226 6.92578 9 6.92578C10.6477 6.92578 11.9883 8.26632 11.9883 9.91406C11.9883 11.5618 10.6477 12.9023 9 12.9023Z" fill="#A2B1C6"/>
<path d="M15.8906 3.41016H13.304C13.2221 3.41016 13.1483 3.36547 13.1104 3.29319L12.3948 1.78945C12.3928 1.78534 12.3908 1.78126 12.3887 1.77718C12.1117 1.22312 11.5548 0.878906 10.9353 0.878906H7.11478C6.49529 0.878906 5.93835 1.22312 5.66135 1.77722C5.65928 1.7813 5.65731 1.78538 5.65534 1.78949L4.9397 3.2933C4.90173 3.36547 4.82797 3.41016 4.74609 3.41016H2.10938C0.946266 3.41016 0 4.35642 0 5.51953V15.0117C0 16.1748 0.946266 17.1211 2.10938 17.1211H15.8906C17.0537 17.1211 18 16.1748 18 15.0117V5.51953C18 4.35642 17.0537 3.41016 15.8906 3.41016ZM16.5938 15.0117C16.5938 15.3994 16.2783 15.7148 15.8906 15.7148H2.10938C1.72167 15.7148 1.40625 15.3994 1.40625 15.0117V5.51953C1.40625 5.13183 1.72167 4.81641 2.10938 4.81641H4.74609C5.36555 4.81641 5.92249 4.47223 6.19952 3.91816C6.2016 3.91409 6.20357 3.90997 6.20557 3.90586L6.92121 2.40205C6.95914 2.32984 7.0329 2.28516 7.11478 2.28516H10.9353C11.0172 2.28516 11.091 2.32984 11.1289 2.40202L11.8445 3.90582C11.8465 3.90994 11.8485 3.91405 11.8506 3.91813C12.1276 4.47219 12.6846 4.81637 13.304 4.81637H15.8906C16.2783 4.81637 16.5938 5.13179 16.5938 5.5195V15.0117Z" fill="#A2B1C6"/>
<path d="M15.1875 6.22266H13.7812V7.62891H15.1875V6.22266Z" fill="#A2B1C6"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

8
img/chart.svg Normal file
View File

@@ -0,0 +1,8 @@
<svg width="19" height="18" viewBox="0 0 19 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.41943 16V10H10.4194V16H8.41943Z" fill="#A2B1C6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.41943 16L2.41943 10H4.41943V16H2.41943Z" fill="#A2B1C6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.4194 16V7H13.4194V16H11.4194Z" fill="#A2B1C6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.4194 16V8H16.4194V16H14.4194Z" fill="#A2B1C6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.41943 12V16H5.41943V12H7.41943Z" fill="#A2B1C6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.4332 1.80676L16.6265 6.00001L15.9194 6.70712L12.4055 3.19326L5.93169 9.1691L1.71436 5.55424L2.36515 4.79499L5.90707 7.83092L12.4332 1.80676Z" fill="#A2B1C6"/>
</svg>

After

Width:  |  Height:  |  Size: 831 B

View File

Before

Width:  |  Height:  |  Size: 643 B

After

Width:  |  Height:  |  Size: 643 B

View File

Before

Width:  |  Height:  |  Size: 447 B

After

Width:  |  Height:  |  Size: 447 B

View File

Before

Width:  |  Height:  |  Size: 346 B

After

Width:  |  Height:  |  Size: 346 B

3
img/info.svg Normal file
View File

@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11 9H13V7H11V9ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM12 2C10.6868 2 9.38642 2.25866 8.17317 2.7612C6.95991 3.26375 5.85752 4.00035 4.92893 4.92893C3.05357 6.8043 2 9.34784 2 12C2 14.6522 3.05357 17.1957 4.92893 19.0711C5.85752 19.9997 6.95991 20.7362 8.17317 21.2388C9.38642 21.7413 10.6868 22 12 22C14.6522 22 17.1957 20.9464 19.0711 19.0711C20.9464 17.1957 22 14.6522 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7362 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2V2ZM11 17H13V11H11V17Z" fill="#A2B1C6"/>
</svg>

After

Width:  |  Height:  |  Size: 754 B

6
img/pivot.svg Normal file
View File

@@ -0,0 +1,6 @@
<svg width="19" height="18" viewBox="0 0 19 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.7661 5.13901L18.3407 9.43008H16.5161V12.8467C16.5161 13.7957 16.2783 14.6451 15.6714 15.2521C15.0645 15.859 14.215 16.0967 13.2661 16.0967H9.84942V17.9214L5.55835 15.3467L9.84942 12.7721V14.5967H13.2661C13.9838 14.5967 14.3844 14.4178 14.6108 14.1914C14.8372 13.965 15.0161 13.5645 15.0161 12.8467V9.43008H13.1914L15.7661 5.13901Z" fill="#A2B1C6"/>
<path d="M6.41943 0H18.4194V4H6.41943V0Z" fill="#A2B1C6"/>
<path d="M0.419434 6H4.41943V18H0.419434V6Z" fill="#A2B1C6"/>
<path d="M0.419434 0H4.41943V4H0.419434V0Z" fill="#A2B1C6"/>
</svg>

After

Width:  |  Height:  |  Size: 687 B

View File

Before

Width:  |  Height:  |  Size: 444 B

After

Width:  |  Height:  |  Size: 444 B

3
img/run.svg Normal file
View File

@@ -0,0 +1,3 @@
<svg width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.1624 6.94358L0.770043 12.9436L0.770043 0.943573L11.1624 6.94358Z" fill="#A2B1C6"/>
</svg>

After

Width:  |  Height:  |  Size: 199 B

11
img/sql.svg Normal file
View File

@@ -0,0 +1,11 @@
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M4.5 1.51343H10.5L15 6.01343V8.45284H13.5V6.76343H9.75V3.01343H4.5V8.45284H3V3.01343C3 2.18843 3.675 1.51343 4.5 1.51343Z" fill="#A2B1C6"/>
<path d="M4.28369 14.8127C4.28369 14.5872 4.20312 14.4114 4.04199 14.2854C3.88379 14.1594 3.604 14.0291 3.20264 13.8943C2.80127 13.7595 2.47314 13.6292 2.21826 13.5032C1.38916 13.0959 0.974609 12.5364 0.974609 11.8245C0.974609 11.47 1.07715 11.158 1.28223 10.8884C1.49023 10.616 1.7832 10.405 2.16113 10.2556C2.53906 10.1033 2.96387 10.0271 3.43555 10.0271C3.89551 10.0271 4.30713 10.1091 4.67041 10.2732C5.03662 10.4373 5.3208 10.6716 5.52295 10.9763C5.7251 11.2781 5.82617 11.6238 5.82617 12.0134H4.28809C4.28809 11.7527 4.20752 11.5505 4.04639 11.407C3.88818 11.2634 3.67285 11.1917 3.40039 11.1917C3.125 11.1917 2.90674 11.2532 2.74561 11.3762C2.5874 11.4963 2.5083 11.6501 2.5083 11.8376C2.5083 12.0017 2.59619 12.1511 2.77197 12.2859C2.94775 12.4177 3.25684 12.5554 3.69922 12.699C4.1416 12.8396 4.50488 12.9919 4.78906 13.156C5.48047 13.5544 5.82617 14.1038 5.82617 14.804C5.82617 15.3635 5.61523 15.803 5.19336 16.1223C4.77148 16.4417 4.19287 16.6013 3.45752 16.6013C2.93896 16.6013 2.46875 16.509 2.04688 16.3245C1.62793 16.137 1.31152 15.8821 1.09766 15.5598C0.886719 15.2346 0.78125 14.8611 0.78125 14.4392H2.32812C2.32812 14.782 2.41602 15.0354 2.5918 15.1995C2.77051 15.3606 3.05908 15.4412 3.45752 15.4412C3.7124 15.4412 3.91309 15.387 4.05957 15.2786C4.20898 15.1672 4.28369 15.012 4.28369 14.8127ZM12.0444 13.446C12.0444 14.0378 11.9463 14.5549 11.75 14.9973C11.5537 15.4368 11.2827 15.7898 10.937 16.0564L11.9697 16.8738L11.0161 17.6824L9.64062 16.575C9.51172 16.5925 9.38281 16.6013 9.25391 16.6013C8.70898 16.6013 8.22559 16.4753 7.80371 16.2234C7.38184 15.9714 7.05225 15.6111 6.81494 15.1423C6.58057 14.6736 6.45898 14.1345 6.4502 13.5251V13.1868C6.4502 12.5569 6.56445 12.0032 6.79297 11.5256C7.02441 11.0481 7.35254 10.679 7.77734 10.4182C8.20508 10.1575 8.69434 10.0271 9.24512 10.0271C9.78711 10.0271 10.2705 10.156 10.6953 10.4138C11.1201 10.6716 11.4497 11.0393 11.6841 11.5168C11.9214 11.9915 12.0415 12.5364 12.0444 13.1516V13.446ZM10.4756 13.178C10.4756 12.5422 10.3687 12.0603 10.1548 11.7322C9.94385 11.4011 9.64062 11.2356 9.24512 11.2356C8.83789 11.2356 8.53174 11.3982 8.32666 11.7234C8.12158 12.0486 8.01758 12.5247 8.01465 13.1516V13.446C8.01465 14.0759 8.11865 14.5593 8.32666 14.8962C8.53467 15.2302 8.84375 15.3972 9.25391 15.3972C9.64648 15.3972 9.94678 15.2317 10.1548 14.9006C10.3657 14.5696 10.4727 14.0935 10.4756 13.4724V13.178ZM14.3735 15.3269H17.0586V16.5134H12.8311V10.115H14.3735V15.3269Z" fill="#A2B1C6"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="18" height="18" fill="white" transform="translate(0 0.0134277)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

7
img/table.svg Normal file
View File

@@ -0,0 +1,7 @@
<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.0286 2.66757H3.97119C3.14619 2.66757 2.47119 3.34257 2.47119 4.16757V14.8324C2.47119 15.6574 3.14619 16.3324 3.97119 16.3324H15.0286C15.8613 16.3324 16.5286 15.6576 16.5286 14.8324V4.16757C16.5286 3.33757 15.8586 2.66757 15.0286 2.66757ZM15.03 4.16757H3.96997V14.8276H15.03V4.16757Z" fill="#A2B1C6"/>
<line x1="7.52295" y1="3.81403" x2="7.52295" y2="15.1996" stroke="#A2B1C6" stroke-width="1.5"/>
<line x1="11.5137" y1="3.80042" x2="11.5137" y2="15.1859" stroke="#A2B1C6" stroke-width="1.5"/>
<line x1="2.98926" y1="7.22595" x2="16.0105" y2="7.22595" stroke="#A2B1C6" stroke-width="1.5"/>
<line x1="2.98926" y1="11.3483" x2="16.0105" y2="11.3483" stroke="#A2B1C6" stroke-width="1.5"/>
</svg>

After

Width:  |  Height:  |  Size: 841 B

12
img/visualisation.svg Normal file
View File

@@ -0,0 +1,12 @@
<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M2.03345 13.6725L5.8465 10.2694L9.25264 13.2145L14.0613 8.16519L17.2235 11.38" stroke="#A2B1C6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="6.00049" cy="6.50339" r="1.5" fill="#A2B1C6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.536 1.71786L2.46546 1.71298C1.64046 1.71298 0.965462 2.38798 0.965462 3.21298L0.964111 15.7821C0.964111 16.6071 1.63911 17.2821 2.46411 17.2821L16.5347 17.287C17.3674 17.287 18.0347 16.6121 18.0347 15.787L18.036 3.21786C18.036 2.38786 17.366 1.71786 16.536 1.71786ZM16.5374 3.21786L2.46424 3.21298L2.46289 15.7772L16.536 15.7821L16.5374 3.21786Z" fill="#A2B1C6"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="18" height="18" fill="white" transform="translate(0.5 0.5)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 909 B

57
index.md Executable file
View File

@@ -0,0 +1,57 @@
---
description: ''
sidebar: 'docs'
next: '/docs/installation/'
---
# Introduction
Docc is a starter theme for [Gridsome](https://gridsome.org/) which is a static site generator powered by Vue. It allows you to quickly start writing your technical documentation for any kind of project.
## Fast by default
This is the catchphrase of Gridsome and true in any sense of the word. Static site generators output plain html files and have other great features like image processing and lazy-loading. After Serving the initial html, Gridsome site turn into a snappy single page application.
If I may quote Gridsome themselves:
> Gridsome builds ultra performance into every page automatically. You get code splitting, asset optimization, progressive images, and link prefetching out of the box. With Gridsome you get almost perfect page speed scores by default.
In combination with [Netlify](https://www.netlify.com/) this theme gives you a perfect Lighthouse score out of the box.
## Simple Navigation
Any good documentation has great navigation. This theme has support for an organized sidebar fore cross-page navigation as well as an autmatic generated table of contents for each page in your documentation.
## Search
The search component which is shipped with this theme, automatically indexes all headlines in your markdown pages and provides instant client side search powered by [Fuse.js](https://fusejs.io/).
## Dark Mode
This seems to be a must have for any site in current year. Click the icon at the top of the page and try it out for yourself!
## TailwindCSS
This starter uses [TailwindCSS](https://tailwindcss.com/) for layout and styling. You can easily configure it by editing the `tailwind.config.js` file. [PurgeCSS](https://purgecss.com/) is included as well to keep the bundle size as low as possible and the website fast and snappy!
### Changing Colors
The most inportant colors are defined in the `src/layouts/Default.vue` file at the top of the `style` block via CSS variables. If you want to change the primary color to orange for example, you would simply touch that value there.
```css
:rrot {
--color-ui-primary: theme('colors.orange.600');
}
```
## Make it your own
Of course this is just a starter to quickly get you going. After downloading and installing you can do whatever you want with this theme. Check out the `src` folder and take a look at the components.
Docc uses [TailwindCSS](https://tailwindcss.com/). Colors and spacing can easily configured. To change the accent color, you only need to touch a single line in the code.
Don't like how something was designed or implemented? Just change the code and **make it your way**.
### Contribute
If you find any spelling mistakes or have improvements to offer, I am open to anyone who has ideas and wants to contribute to this starter theme.

17488
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,48 +0,0 @@
{
"name": "sqliteviz",
"version": "0.3.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "NODE_OPTIONS=--max_old_space_size=4096 vue-cli-service build",
"test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint"
},
"dependencies": {
"codemirror": "^5.57.0",
"core-js": "^3.6.5",
"nanoid": "^3.1.12",
"plotly.js": "^1.57.1",
"react": "^16.13.1",
"react-chart-editor": "^0.42.0",
"react-dom": "^16.13.1",
"sql.js": "^1.3.0",
"sqlite-parser": "^1.0.1",
"vue": "^2.6.11",
"vue-codemirror": "^4.0.6",
"vue-js-modal": "^2.0.0-rc.6",
"vue-router": "^3.2.0",
"vuejs-paginate": "^2.1.0",
"vuera": "^0.2.7",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.4.0",
"@vue/cli-plugin-eslint": "^4.4.0",
"@vue/cli-plugin-router": "^4.4.0",
"@vue/cli-plugin-unit-mocha": "^4.4.0",
"@vue/cli-plugin-vuex": "^4.4.0",
"@vue/cli-service": "^4.4.0",
"@vue/eslint-config-standard": "^5.1.2",
"@vue/test-utils": "^1.0.3",
"babel-eslint": "^10.1.0",
"chai": "^4.1.2",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -1,17 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

30
sidebar.json Normal file
View File

@@ -0,0 +1,30 @@
[{
"sections": [{
"title": "For users",
"items": [
"/docs/",
"/docs/installation/",
"/docs/basic-usage/",
"/docs/multiple-csv-file-import/",
"/docs/manage-inquiries/",
"/docs/export-current-database/",
"/docs/pivot-table/",
"/docs/predefined-inquiries/",
"/docs/diagnostic-information/"
]
},
{
"title": "Examples and tutorials",
"items": [
"/docs/how-to-build-a-pivot-table-in-sq-lite/",
"/docs/how-to-rename-tables-and-columns-after-csv-import/"
]
},
{
"title": "For developers",
"items": [
"/docs/integrate-predefined-inquiries/"
]
}
]
}]

View File

@@ -1,16 +0,0 @@
<template>
<div id="app">
<router-view/>
</div>
</template>
<style>
#app, * {
font-family: Open-Sans, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
margin: 0;
}
</style>

View File

@@ -1,17 +0,0 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="0.5" y="0.5" width="17" height="17" rx="2.5" fill="#119DFF" stroke="#0D76BF"/>
<g filter="url(#filter0_d)">
<path d="M15.75 5.25L6.75 14.25L2.625 10.125L3.6825 9.0675L6.75 12.1275L14.6925 4.1925L15.75 5.25Z" fill="white"/>
</g>
<defs>
<filter id="filter0_d" x="0.625" y="3.1925" width="17.125" height="14.0575" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.164706 0 0 0 0 0.247059 0 0 0 0 0.372549 0 0 0 0.7 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
</filter>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 981 B

View File

@@ -1,17 +0,0 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="0.5" y="0.5" width="17" height="17" rx="2.5" fill="#F3F6FA" stroke="#C8D4E3"/>
<g filter="url(#filter0_d)">
<path d="M15.75 5.24988L6.75 14.2499L2.625 10.1249L3.6825 9.06738L6.75 12.1274L14.6925 4.19238L15.75 5.24988Z" fill="#119DFF"/>
</g>
<defs>
<filter id="filter0_d" x="0.625" y="3.19238" width="17.125" height="14.0575" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.164706 0 0 0 0 0.247059 0 0 0 0 0.372549 0 0 0 0.45 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
</filter>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 996 B

View File

@@ -1,3 +0,0 @@
<svg width="8" height="12" viewBox="0 0 8 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.721924 9.93097L4.85292 5.79997L0.721924 1.66897L1.99992 0.399973L7.39992 5.79997L1.99992 11.2L0.721924 9.93097Z" fill="#506784"/>
</svg>

Before

Width:  |  Height:  |  Size: 243 B

View File

@@ -1,3 +0,0 @@
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z" fill="#A2B1C6"/>
</svg>

Before

Width:  |  Height:  |  Size: 232 B

View File

@@ -1,3 +0,0 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 10.5V12.75C3 14.25 5.2875 15.54 8.25 15.75V13.5825L8.3475 13.5C5.34 13.32 3 12.045 3 10.5ZM9 9.75C5.685 9.75 3 8.4075 3 6.75V9C3 10.6575 5.685 12 9 12C9.2925 12 9.5775 12 9.87 12L12.75 9.09C11.55 9.54 10.2825 9.75 9 9.75ZM9 2.25C5.685 2.25 3 3.5925 3 5.25C3 6.9075 5.685 8.25 9 8.25C12.315 8.25 15 6.9075 15 5.25C15 3.5925 12.315 2.25 9 2.25ZM15.75 8.3475C15.6375 8.3475 15.5325 8.3925 15.4575 8.475L14.7075 9.225L16.245 10.725L16.995 9.975C17.1525 9.825 17.16 9.57 16.995 9.3975L16.065 8.475C15.99 8.3925 15.885 8.3475 15.78 8.3475H15.75ZM14.28 9.66L9.75 14.205V15.75H11.295L15.84 11.1975L14.28 9.66Z" fill="#A2B1C6"/>
</svg>

Before

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -1,63 +0,0 @@
button {
box-sizing: border-box;
height: 36px;
padding: 0 12px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
}
button:focus {
outline: none;
}
button.primary {
background: var(--color-accent);
border: 1px solid var(--color-accent-shade);
border-radius: var(--border-radius-big);
min-width: 83px;
color: var(--color-text-light);
text-shadow: var(--shadow);
}
button.primary:hover {
background: var(--color-accent-shade);
border: 1px solid var(--color-accent-shade);
color: var(--color-text-light);
text-shadow: var(--shadow);
}
button.primary:disabled {
background: var(--color-bg-light-2);
border: 1px solid var(--color-border);
color: var(--color-text-light-2);
text-shadow: none;
cursor: default;
}
button.secondary {
background: white;
border: 1px solid var(--color-border);
border-radius: var(--border-radius-big);
min-width: 83px;
color: var(--color-text-base);
}
button.secondary:hover {
border: 1px solid var(--color-text-light-2);
color: var(--color-text-active);
}
button.toolbar {
background: transparent;
border: none;
color: var(--color-text-base);
padding: 0;
}
button.toolbar:hover {
color: var(--color-accent);
}

View File

@@ -1,40 +0,0 @@
.dialog {
border-radius: var(--border-radius-big);
box-shadow: 0px 2px 9px rgba(80, 103, 132, 0.8);
}
.dialog-header {
height: 46px;
line-height: 46px;
padding: 0 22px 0 12px;
color: var(--color-text-base);
font-size: 16px;
font-weight: 600;
display: flex;
justify-content: space-between;
align-items: center;
}
.dialog-body {
min-height: 60px;
background-color: var(--color-bg-light);
padding: 24px;
border-top: 1px solid var(--color-border-light);
color: var(--color-text-base);
font-size: 13px;
}
.dialog-buttons-container {
display: flex;
justify-content: flex-end;
background-color: var(--color-bg-light);
padding: 24px;
}
.dialog-buttons-container button {
margin-left: 16px;
}
.vm--overlay {
background-color: rgba(162, 177, 198, 0.5);
}

View File

@@ -1,17 +0,0 @@
/* width */
::-webkit-scrollbar {
width: 5px;
height: 5px;
}
/* Track */
::-webkit-scrollbar-track {
background: transparent;
border-radius: 5px;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: var(--color-accent);
border-radius: 10px;
}

View File

@@ -1,78 +0,0 @@
.rounded-bg {
padding: 40px 5px 5px;
background-color: white;
border-radius: 5px;
position: relative;
border: 1px solid var(--color-border-light);
box-sizing: border-box;
}
.header-container {
overflow: hidden;
position: absolute;
top: -1px;;
left: -1px;
width: calc(100% + 2px);
padding-left: 7px;
box-sizing: border-box;
background-color: var(--color-bg-dark);
border-radius: 5px 5px 0 0;
}
.header-container > div {
display: flex;
width: fit-content;
padding-right: 10px;
}
.table-container {
width: 100%;
overflow: auto;
}
table {
min-width: 100%;
margin-top: -40px;
border-collapse: collapse;
}
thead th, .fixed-header {
font-size: 14px;
font-weight: 600;
box-sizing: border-box;
background-color: var(--color-bg-dark);
color: var(--color-text-light);
border-right: 1px solid var(--color-border-light);
}
tbody td {
font-size: 13px;
background-color:white;
color: var(--color-text-base);
box-sizing: border-box;
border-bottom: 1px solid var(--color-border-light);
border-right: 1px solid var(--color-border-light);
}
td, th, .fixed-header {
padding: 12px 24px;
white-space: nowrap;
}
tbody tr td:last-child,
thead tr th:last-child,
.header-container div .fixed-header:last-child {
border-right: none;
}
td > div.cell-data {
width: -webkit-max-content;
width: -moz-max-content;
width: max-content;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.table-footer {
display: flex;
justify-content: space-between;
padding: 6px 12px;
}
.table-footer-count {
font-size: 11px;
color: var(--color-text-base);
}

View File

@@ -1,42 +0,0 @@
:root {
--color-white: #ffffff;
--color-gray-light: #F3F6FA;
--color-gray-light-2: #DFE8F3;
--color-gray-light-3: #C8D4E3;
--color-gray-light-4:#EBF0F8;
--color-gray-light-5:#f8f8f9;
--color-gray-medium: #A2B1C6;
--color-gray-dark: #506784;
--color-blue-medium: #119DFF;
--color-blue-dark: #0D76BF;
--color-blue-dark-2: #2A3F5F;
--color-red: #EF553B;
--color-yellow: #FBEFCB;
--color-bg-light: var(--color-gray-light);
--color-bg-light-2: var(--color-gray-light-2);
--color-bg-light-3: var(--color-gray-light-5);
--color-bg-dark: var(--color-gray-dark);
--color-bg-warning: var(--color-yellow);
--color-accent: var(--color-blue-medium);
--color-accent-shade: var(--color-blue-dark);
--color-border-light: var(--color-gray-light-2);
--color-border: var(--color-gray-light-3);
--color-text-light: var(--color-white);
--color-text-light-2: var(--color-gray-medium);
--color-text-base: var(--color-gray-dark);
--color-text-active: var(--color-blue-dark-2);
--color-text-error: var(--color-red);
--shadow: 0 1px 2px rgba(42, 63, 95, 0.7);
--border-radius-big: 5px;
--border-radius-medium: 3px;
--border-radius-medium-2: 4px;
--border-radius-small: 2px;
}

View File

@@ -1,131 +0,0 @@
<template>
<div class="chart-container">
<div class="chart-worning" v-show="!sqlResult && visible">
There is no data to build a chart. Run your sql query and make sure the result is not empty.
</div>
<PlotlyEditor
v-show="visible"
:data="state.data"
:layout="state.layout"
:frames="state.frames"
:config="{ editable: true, displaylogo: false }"
:dataSources="dataSources"
:dataSourceOptions="dataSourceOptions"
:plotly="plotly"
@onUpdate="update"
:useResizeHandler="true"
:debug="true"
:advancedTraceTypeSelector="true"
class="chart"
:style="{ height: !sqlResult ? 'calc(100% - 40px)' : '100%' }"
/>
</div>
</template>
<script>
import plotly from 'plotly.js/dist/plotly'
import 'react-chart-editor/lib/react-chart-editor.min.css'
import PlotlyEditor from 'react-chart-editor'
import dereference from 'react-chart-editor/lib/lib/dereference'
export default {
name: 'Chart',
props: ['sqlResult', 'initChart', 'visible'],
components: {
PlotlyEditor
},
data () {
return {
plotly: plotly,
state: this.initChart || {
data: [],
layout: {},
frames: []
}
}
},
computed: {
dataSources () {
if (!this.sqlResult) {
return {}
}
const dataSorces = {}
const matrix = this.sqlResult.values
const [row] = matrix
const transposedMatrix = row.map((value, column) => matrix.map(row => row[column]))
this.sqlResult.columns.forEach((column, index) => {
dataSorces[column] = transposedMatrix[index]
})
return dataSorces
},
dataSourceOptions () {
return Object.keys(this.dataSources).map(name => ({
value: name,
label: name
}))
}
},
watch: {
dataSources () {
// we need to update state.data in order to update the graph
// https://github.com/plotly/react-chart-editor/issues/948
dereference(this.state.data, this.dataSources)
}
},
methods: {
update (data, layout, frames) {
this.state = { data, layout, frames }
this.$emit('update')
},
getChartSatateForSave () {
// we don't need to save the data, only settings
// so we modify state.data using dereference
const stateCopy = JSON.parse(JSON.stringify(this.state))
const emptySources = {}
for (const key in this.dataSources) {
emptySources[key] = []
}
dereference(stateCopy.data, emptySources)
return stateCopy
}
}
}
</script>
<style scoped>
.chart-container {
height: calc(100% - 89px);
}
.chart-worning {
background-color: var(--color-bg-warning);
height: 40px;
line-height: 40px;
color: var(--color-text-base);
font-size: 13px;
padding: 0 24px;
}
.chart {
border-top: 1px solid var(--color-border);
}
>>> .editor_controls .sidebar__item:before {
width: 0;
}
>>> .sidebar {
width: 120px;
min-width: 120px;
max-width: 120px;
}
>>> .editor_controls__wrapper>.panel,
>>> .editor_controls .panel__empty {
width: 315px;
}
>>> .editor_controls .sidebar__group__title {
padding-left: 10px;
}
>>> .editor_controls .sidebar__item {
padding-left: 32px;
}
</style>

View File

@@ -1,72 +0,0 @@
<template>
<div class="checkbox-container" @click.stop="onClick">
<div v-show="!checked" class="unchecked" />
<img
v-show="checked && theme === 'accent'"
:src="require('@/assets/images/checkbox_checked.svg')"
/>
<img
v-show="checked && theme === 'light'"
:src="require('@/assets/images/checkbox_checked_light.svg')"
/>
</div>
</template>
<script>
export default {
name: 'checkBox',
props: {
theme: {
type: String,
required: false,
default: 'accent',
validator: (value) => {
return ['accent', 'light'].includes(value)
}
},
init: {
type: Boolean,
required: false,
default: false
}
},
data () {
return {
checked: this.init
}
},
watch: {
checked () {
this.$emit('change', this.checked)
}
},
methods: {
onClick () {
this.checked = !this.checked
this.$emit('click', this.checked)
}
}
}
</script>
<style scoped>
.checkbox-container {
display: inline-block;
cursor: pointer;
}
.unchecked {
width: 18px;
height: 18px;
background-color: white;
border: 1px solid var(--color-border);
border-radius: var(--border-radius-medium);
box-sizing: border-box;
}
.unchecked:hover {
background-color: var(--color-bg-light);
}
img {
display: block;
}
</style>

View File

@@ -1,106 +0,0 @@
<template>
<nav>
<div>
<router-link to="/editor">Editor</router-link>
<router-link to="/my-queries">My queries</router-link>
</div>
<div>
<button
v-if="$store.state.tabs.length > 0"
class="primary"
:disabled="$store.state.currentTab && !$store.state.currentTab.isUnsaved"
@click="saveQuery"
>
Save
</button>
<button class="primary" @click="createNewQuery">Create</button>
</div>
</nav>
</template>
<script>
import { nanoid } from 'nanoid'
export default {
name: 'MainMenu',
created () {
this.$root.$on('createNewQuery', this.createNewQuery)
},
methods: {
createNewQuery () {
const tab = {
id: nanoid(),
name: null,
tempName: this.$store.state.untitledLastIndex
? `Untitled ${this.$store.state.untitledLastIndex}`
: 'Untitled',
isUnsaved: true
}
this.$store.commit('addTab', tab)
this.$store.commit('setCurrentTabId', tab.id)
this.$store.commit('updateUntitledLastIndex')
},
saveQuery () {
const currentQuery = this.$store.state.currentTab
const isFromScratch = !this.$store.state.currentTab.initName
const value = {
id: currentQuery.id,
query: currentQuery.query,
chart: currentQuery.getChartSatateForSave()
}
if (isFromScratch) {
value.name = prompt('query name')
// TODO: create dialog
this.$store.commit('updateTabName', { index: currentQuery.tabIndex, newName: value.name })
value.createdAt = new Date()
} else {
value.name = currentQuery.initName
}
let myQueries = JSON.parse(localStorage.getItem('myQueries'))
if (!myQueries) {
myQueries = [value]
} else if (isFromScratch) {
myQueries.push(value)
} else {
const queryIndex = myQueries.findIndex(query => query.id === currentQuery.id)
value.createdAt = myQueries[queryIndex].createdAt
myQueries[queryIndex] = value
}
localStorage.setItem('myQueries', JSON.stringify(myQueries))
currentQuery.isUnsaved = false
}
}
}
</script>
<style scoped>
nav {
height: 68px;
display: flex;
justify-content: space-between;
align-items: center;
background-color: var(--color-bg-light);
border-bottom: 1px solid var(--color-border-light);
box-sizing: border-box;
position: fixed;
top: 0;
left: 0;
width: 100vw;
padding: 0 52px;
}
a {
font-size: 18px;
color: var(--color-text-base);
text-transform: none;
text-decoration: none;
margin-right: 28px;
}
a.router-link-active {
color: var(--color-accent);
}
button {
margin-left: 16px;
}
</style>

View File

@@ -1,97 +0,0 @@
<template>
<paginate
:page-count="pageCount"
:page-range="5"
:margin-pages="1"
:prev-text="chevron"
:next-text="chevron"
:no-li-surround="true"
container-class="paginator-continer"
page-link-class="paginator-page-link"
active-class="paginator-active-page"
break-view-link-class="paginator-break"
next-link-class="paginator-next"
prev-link-class="paginator-prev"
disabled-class="paginator-disabled"
v-model="page"
/>
</template>
<script>
import Paginate from 'vuejs-paginate'
export default {
name: 'Pager',
components: { Paginate },
props: ['pageCount', 'value'],
data () {
return {
page: this.value,
chevron: `
<svg width="9" height="9" viewBox="0 0 8 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.721924 9.93097L4.85292 5.79997L0.721924 1.66897L1.99992 0.399973L7.39992 5.79997L1.99992 11.2L0.721924 9.93097Z" fill="#506784"/>
</svg>
`
}
},
watch: {
page () {
this.$emit('input', this.page)
},
value () {
this.page = this.value
}
}
}
</script>
<style scoped>
.paginator-continer {
display: flex;
align-items: center;
}
>>> .paginator-page-link {
padding: 2px 3px;
margin: 0 5px;
display: block;
color: var(--color-text-base);
font-size: 11px;
}
>>> .paginator-page-link:hover {
color: var(--color-text-active);
}
>>> .paginator-page-link:active,
>>> .paginator-page-link:visited,
>>> .paginator-page-link:focus,
>>> .paginator-next:active,
>>> .paginator-next:visited,
>>> .paginator-next:focus,
>>> .paginator-prev:active,
>>> .paginator-prev:visited,
>>> .paginator-prev:focus {
outline: none;
}
>>> .paginator-active-page,
>>> .paginator-active-page:hover {
color: var(--color-accent);
}
>>> .paginator-break:hover,
>>> .paginator-disabled:hover {
cursor: default;
}
>>> .paginator-prev svg {
transform: rotate(180deg);
}
>>> .paginator-next:hover path,
>>> .paginator-prev:hover path {
fill: var(--color-text-active);
}
>>> .paginator-disabled path,
>>> .paginator-disabled:hover path {
fill: var(--color-text-light-2);
}
</style>

View File

@@ -1,136 +0,0 @@
<template>
<div>
<text-field placeholder="Search table" width="100%"/>
<div id="db">
<div @click="schemaVisible = !schemaVisible" class="db-name">
<svg
:style="{transform: schemaVisible ? 'rotate(90deg)' : 'rotate(0)'}"
class="chevron-icon"
width="9"
height="9"
viewBox="0 0 8 12"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0.721924 9.93097L4.85292 5.79997L0.721924 1.66897L1.99992 0.399973L7.39992 5.79997L1.99992 11.2L0.721924 9.93097Z"
:fill="schemaVisible ? '#506784' : 'rgba(80, 103, 132, 0.5)'"
/>
</svg>
{{ dbName }}
</div>
<div class="db-edit">
<input type="file" id="actual-btn" ref="dbfile" hidden @change="changeDb"/>
<label for="actual-btn">
<svg
class="db-edit-icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M3 10.5V12.75C3 14.25 5.2875 15.54 8.25 15.75V13.5825L8.3475 13.5C5.34 13.32 3 12.045 3 10.5ZM9 9.75C5.685 9.75 3 8.4075 3 6.75V9C3 10.6575 5.685 12 9 12C9.2925 12 9.5775 12 9.87 12L12.75 9.09C11.55 9.54 10.2825 9.75 9 9.75ZM9 2.25C5.685 2.25 3 3.5925 3 5.25C3 6.9075 5.685 8.25 9 8.25C12.315 8.25 15 6.9075 15 5.25C15 3.5925 12.315 2.25 9 2.25ZM15.75 8.3475C15.6375 8.3475 15.5325 8.3925 15.4575 8.475L14.7075 9.225L16.245 10.725L16.995 9.975C17.1525 9.825 17.16 9.57 16.995 9.3975L16.065 8.475C15.99 8.3925 15.885 8.3475 15.78 8.3475H15.75ZM14.28 9.66L9.75 14.205V15.75H11.295L15.84 11.1975L14.28 9.66Z"
fill="#A2B1C6"/>
</svg>
</label>
<span class="db-edit-tooltip">Change database</span>
</div>
</div>
<div v-show="schemaVisible" class="schema">
<table-description
v-for="(table, index) in schema"
:key="index"
:name="table[0]"
:sql="table[1]"
/>
</div>
</div>
</template>
<script>
import TableDescription from '@/components/TableDescription'
import TextField from '@/components/TextField'
export default {
name: 'Schema',
components: { TableDescription, TextField },
data () {
return {
schemaVisible: true
}
},
computed: {
schema () {
return this.$store.state.schema
},
dbName () {
return this.$store.state.dbName
}
},
methods: {
changeDb () {
this.$db.loadDb(this.$refs.dbfile.files[0])
}
}
}
</script>
<style scoped>
.schema {
margin-left: 12px;
}
.schema, .db-name {
color: var(--color-text-base);
font-size: 13px;
white-space: nowrap;
}
#db {
display: flex;
align-items: center;
}
.db-name {
cursor: pointer;
}
>>> .chevron-icon {
-webkit-transition: transform .15s ease-in-out;
transition: transform .15s ease-in-out;
}
.db-name:hover .chevron-icon path,
>>> .table-name:hover .chevron-icon path {
fill: #506784;
}
.db-edit {
position: relative;
}
.db-edit-icon {
display: block;
}
.db-edit-icon:hover path{
fill: var(--color-accent);
cursor: pointer;
}
.db-edit-tooltip {
visibility: hidden;
background-color: rgba(80, 103, 132, 0.75);
color: #fff;
text-align: center;
font-size: 11px;
padding: 0 6px;
line-height: 19px;;
position: absolute;
z-index: 5;
height: 19px;
left: 24px;
top: -12px;
border-radius: var(--border-radius-medium);
white-space: nowrap;
}
.db-edit:hover .db-edit-tooltip {
visibility: visible;
}
</style>

View File

@@ -1,301 +0,0 @@
<template>
<div
ref="container"
:class="[
'splitpanes',
`splitpanes--${horizontal ? 'horizontal' : 'vertical'}`,
{ 'splitpanes--dragging': touch.dragging }
]"
>
<div class="movable-splitter" ref="movableSplitter" :style="movableSplitterStyle" />
<div
class="splitpanes__pane"
ref="left"
:size="paneBefore.size"
max-size="30"
:style="styles[0]"
>
<slot name="left-pane" />
</div>
<!-- Splitter start-->
<div
class="splitpanes__splitter"
@mousedown="onMouseDown"
@touchstart="onMouseDown"
>
<div class="toggle-btn" @click="toggleFirstPane">
<img
class="direction-icon"
:src="require('@/assets/images/chevron.svg')"
:style="directionIconStyle"
>
</div>
</div>
<!-- splitter end -->
<div
class="splitpanes__pane"
ref="right"
:style="styles[1]"
>
<slot name="right-pane" />
</div>
</div>
</template>
<script>
export default {
name: 'Splitpanes',
props: {
horizontal: { type: Boolean, default: false },
before: { type: Object },
after: { type: Object }
},
data () {
return {
container: null,
paneBefore: this.before,
paneAfter: this.after,
beforeMinimising: this.before.size,
touch: {
mouseDown: false,
dragging: false
},
movableSplitter: {
top: 0,
left: 0,
visibility: 'hidden'
}
}
},
computed: {
styles () {
return [
{ [this.horizontal ? 'height' : 'width']: `${this.paneBefore.size}%` },
{ [this.horizontal ? 'height' : 'width']: `${this.paneAfter.size}%` }
]
},
movableSplitterStyle () {
const style = { ...this.movableSplitter }
style.top += '%'
style.left += '%'
return style
},
expanded () {
return this.paneBefore.size !== 0
},
directionIconStyle () {
const translation = 'translate(-50%, -50%)'
if (this.horizontal) {
return {
transform: `${translation} ${this.expanded ? 'rotate(-90deg)' : 'rotate(90deg)'}`
}
} else {
return {
transform: `${translation} ${this.expanded ? 'rotate(180deg)' : ''}`
}
}
}
},
methods: {
bindEvents () {
document.addEventListener('mousemove', this.onMouseMove, { passive: false })
document.addEventListener('mouseup', this.onMouseUp)
// Passive: false to prevent scrolling while touch dragging.
if ('ontouchstart' in window) {
document.addEventListener('touchmove', this.onMouseMove, { passive: false })
document.addEventListener('touchend', this.onMouseUp)
}
},
unbindEvents () {
document.removeEventListener('mousemove', this.onMouseMove, { passive: false })
document.removeEventListener('mouseup', this.onMouseUp)
if ('ontouchstart' in window) {
document.removeEventListener('touchmove', this.onMouseMove, { passive: false })
document.removeEventListener('touchend', this.onMouseUp)
}
},
onMouseDown () {
this.bindEvents()
this.touch.mouseDown = true
},
onMouseMove (event) {
if (this.touch.mouseDown) {
// Prevent scrolling while touch dragging (only works with an active event, eg. passive: false).
event.preventDefault()
this.touch.dragging = true
this.$set(this.movableSplitter, 'visibility', 'visible')
this.moveSplitter(event)
}
},
onMouseUp () {
this.touch.mouseDown = false
if (this.touch.dragging) {
const dragPercentage = this.horizontal
? this.movableSplitter.top
: this.movableSplitter.left
this.paneBefore.size = dragPercentage
this.paneAfter.size = 100 - dragPercentage
this.movableSplitter = {
top: 0,
left: 0,
visibility: 'hidden'
}
}
// Keep dragging flag until click event is finished (click happens immediately after mouseup)
// in order to prevent emitting `splitter-click` event if splitter was dragged.
setTimeout(() => {
this.touch.dragging = false
this.unbindEvents()
}, 100)
},
// Get the cursor position relative to the splitpane container.
getCurrentMouseDrag (event) {
const rect = this.container.getBoundingClientRect()
const { clientX, clientY } = ('ontouchstart' in window && event.touches)
? event.touches[0]
: event
return {
x: clientX - rect.left,
y: clientY - rect.top
}
},
// Returns the drag percentage of the splitter relative to the 2 panes it's inbetween.
// if the sum of size of the 2 cells is 60%, the dragPercentage range will be 0 to 100% of this 60%.
getCurrentDragPercentage (drag) {
drag = drag[this.horizontal ? 'y' : 'x']
// In the code bellow 'size' refers to 'width' for vertical and 'height' for horizontal layout.
const containerSize = this.container[this.horizontal ? 'clientHeight' : 'clientWidth']
return drag * 100 / containerSize
},
moveSplitter (event) {
const dragPercentage = this.getCurrentDragPercentage(this.getCurrentMouseDrag(event))
const paneBefore = this.paneBefore
const paneAfter = this.paneAfter
const paneBeforeMaxReached = paneBefore.max < 100 && (dragPercentage >= paneBefore.max)
const paneAfterMaxReached = paneAfter.max < 100 && (dragPercentage <= 100 - paneAfter.max)
const dir = this.horizontal ? 'top' : 'left'
// Prevent dragging beyond pane max.
if (paneBeforeMaxReached || paneAfterMaxReached) {
if (paneBeforeMaxReached) {
this.$set(this.movableSplitter, dir, paneBefore.max)
} else {
this.$set(this.movableSplitter, dir, Math.max(100 - paneAfter.max, 0))
}
} else {
this.$set(this.movableSplitter, dir, Math.min(Math.max(dragPercentage, 0), paneBefore.max))
}
},
toggleFirstPane () {
if (this.paneBefore.size > 0) {
this.beforeMinimising = this.paneBefore.size
this.paneBefore.size = 0
} else {
this.paneBefore.size = this.beforeMinimising
}
this.paneAfter.size = 100 - this.paneBefore.size
}
},
mounted () {
this.container = this.$refs.container
}
}
</script>
<style>
.splitpanes {
display: flex;
height: 100%;
position: relative;
}
.splitpanes--vertical {flex-direction: row;}
.splitpanes--horizontal {flex-direction: column;}
.splitpanes--dragging * {user-select: none;}
.splitpanes__pane {
width: 100%;
height: 100%;
overflow: auto;
}
/* Splitter */
.splitpanes--vertical > .splitpanes__splitter,
.splitpanes--vertical.splitpanes--dragging {
cursor: col-resize;
}
.splitpanes--horizontal > .splitpanes__splitter,
.splitpanes--horizontal.splitpanes--dragging {
cursor: row-resize;
}
.splitpanes__splitter {
touch-action: none;
background-color: var(--color-bg-light-2);
box-sizing: border-box;
position: relative;
flex-shrink: 0;
z-index: 1;
}
.movable-splitter {
position: absolute;
background-color:rgba(162, 177, 198, 0.5);
}
.splitpanes--vertical > .splitpanes__splitter,
.splitpanes--vertical .movable-splitter {
width: 3px;
z-index: 5;
height: 100%
}
.splitpanes--horizontal > .splitpanes__splitter,
.splitpanes--horizontal .movable-splitter {
height: 3px;
width: 100%;
}
.splitpanes__splitter .toggle-btn {
background-color: var(--color-bg-light-2);
border-radius: var(--border-radius-small);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.splitpanes__splitter .toggle-btn:hover {
cursor: pointer;
}
.splitpanes--vertical .toggle-btn {
height: 68px;
width: 15px;
}
.splitpanes--horizontal .toggle-btn {
width: 68px;
height: 15px;
}
.splitpanes__splitter .toggle-btn .direction-icon {
position: absolute;
top: 50%;
left: 50%;
}
</style>

View File

@@ -1,82 +0,0 @@
<template>
<div class="codemirror-container">
<codemirror v-model="query" :options="cmOptions" @changes="onCmChange" />
</div>
</template>
<script>
import CM from 'codemirror'
import { codemirror } from 'vue-codemirror'
import 'codemirror/lib/codemirror.css'
import 'codemirror/mode/sql/sql.js'
import 'codemirror/theme/neo.css'
import 'codemirror/addon/hint/show-hint.js'
import 'codemirror/addon/hint/show-hint.css'
import 'codemirror/addon/hint/sql-hint.js'
export default {
name: 'SqlEditor',
props: ['value'],
components: {
codemirror
},
data () {
return {
query: this.value,
cmOptions: {
// codemirror options
tabSize: 4,
mode: 'text/x-mysql',
theme: 'neo',
lineNumbers: true,
line: true
},
result: null
}
},
watch: {
query () {
this.$emit('input', this.query)
}
},
methods: {
onCmChange (editor) {
// Don't show autocomplete after a space or semicolon
const ch = editor.getTokenAt(editor.getCursor()).string.slice(-1)
if (!ch || ch === ' ' || ch === ';') {
return
}
const hintOptions = {
// tables: this.state.tables,
completeSingle: false,
completeOnSingleClick: true
}
// editor.hint.sql is defined when importing codemirror/addon/hint/sql-hint
// (this is mentioned in codemirror addon documentation)
// Reference the hint function imported here when including other hint addons
// or supply your own
CM.showHint(editor, CM.hint.sql, hintOptions)
}
}
}
</script>
<style scoped>
.codemirror-container {
flex-grow: 1;
min-height: 0;
}
>>> .vue-codemirror {
height: 100%;
max-height: 100%;
}
>>> .CodeMirror {
border: 1px solid var(--color-border);
border-radius: var(--border-radius-big);
height: 100%;
max-height: 100%;
}
</style>

View File

@@ -1,110 +0,0 @@
<template>
<div>
<div class="rounded-bg">
<div class="header-container" ref="header-container">
<div>
<div
v-for="(th, index) in header"
class="fixed-header"
:style="{ width: `${th.width}px` }"
:key="index"
>
{{ th.name }}
</div>
</div>
</div>
<div
class="table-container"
ref="table-container"
@scroll="onScrollTable"
:style="{maxHeight: `${height}px`}"
>
<table ref="table">
<thead>
<tr>
<th v-for="(th,index) in data.columns" :key="index" ref="th">
<div class="cell-data" :style="cellStyle">{{ th }}</div>
</th>
</tr>
</thead>
<tbody>
<tr v-for="(row,index) in currentPageData" :key="index">
<td v-for="(value, valIndex) in row" :key="valIndex">
<div class="cell-data" :style="cellStyle">{{ value }}</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="table-footer">
<div class="table-footer-count">
{{ data.values.length}} {{data.values.length === 1 ? 'row' : 'rows'}} retrieved
</div>
<pager v-show="pageCount > 1" :page-count="pageCount" v-model="currentPage" />
</div>
</div>
</template>
<script>
import Pager from '@/components/Pager'
export default {
name: 'SqlTable',
components: { Pager },
props: ['data', 'height'],
data () {
return {
header: null,
tableWidth: null,
currentPage: 1
}
},
computed: {
cellStyle () {
const eq = this.tableWidth / this.data.columns.length
return { maxWidth: `${Math.max(eq, 100)}px` }
},
pageSize () {
return Math.max(Math.floor(this.height / 40), 20)
},
pageCount () {
return Math.ceil(this.data.values.length / this.pageSize)
},
currentPageData () {
const start = (this.currentPage - 1) * this.pageSize
return this.data.values.slice(start, start + this.pageSize)
}
},
methods: {
calculateHeadersWidth () {
this.tableWidth = this.$refs['table-container'].offsetWidth
this.$nextTick(() => {
this.header = this.$refs.th.map(th => {
return { name: th.innerText, width: th.offsetWidth }
})
})
},
onScrollTable () {
this.$refs['header-container'].scrollLeft = this.$refs['table-container'].scrollLeft
},
functionName () {
}
},
mounted () {
new ResizeObserver(this.calculateHeadersWidth).observe(this.$refs.table)
this.calculateHeadersWidth()
},
watch: {
currentPageData: 'calculateHeadersWidth',
data () {
this.currentPage = 1
}
}
}
</script>
<style scoped>
</style>

View File

@@ -1,209 +0,0 @@
<template>
<div class="tab-content-container" v-show="isActive">
<splitpanes
class="query-results-splitter"
horizontal
:before="{ size: 50, max: 50 }"
:after="{ size: 50, max: 100 }"
>
<template #left-pane>
<div class="query-editor">
<sql-editor v-model="query" />
<div class="run-btn-container">
<button
class="primary run-btn"
@click="execute"
:disabled="!$store.state.schema || !query"
>
Run
</button>
</div>
</div>
</template>
<template #right-pane>
<div id="bottomPane" ref="bottomPane">
<view-switcher :view.sync="view" />
<div v-show="view === 'table'" class="table-view">
<div v-show="result === null && !isGettingResults && !error" class="table-preview">
Run your query and get results here
</div>
<div v-show="isGettingResults" class="table-preview">
Fetching results...
</div>
<div v-show="result === undefined && !isGettingResults && !error" class="table-preview">
No rows retrieved according to your query
</div>
<div v-show="error" class="table-preview error">
{{ error }}
</div>
<sql-table v-if="result" :data="result" :height="tableViewHeight" />
</div>
<chart
:visible="view === 'chart'"
:sql-result="result"
:init-chart="initChart"
ref="chart"
@update="isUnsaved = true"
/>
</div>
</template>
</splitpanes>
</div>
</template>
<script>
import SqlTable from '@/components/SqlTable'
import SqlEditor from '@/components/SqlEditor'
import Splitpanes from '@/components/Splitpanes'
import ViewSwitcher from '@/components/ViewSwitcher'
import Chart from '@/components/Chart'
export default {
name: 'TabContent',
props: ['id', 'initName', 'initQuery', 'initChart', 'tabIndex'],
components: {
SqlEditor,
SqlTable,
Splitpanes,
ViewSwitcher,
Chart
},
data () {
return {
query: this.initQuery,
result: null,
view: 'table',
tableViewHeight: 0,
isUnsaved: !this.initName,
isGettingResults: false,
error: null
}
},
computed: {
isActive () {
return this.id === this.$store.state.currentTabId
}
},
created () {
this.$store.commit('setCurrentTab', this)
},
mounted () {
new ResizeObserver(this.handleResize).observe(this.$refs.bottomPane)
this.calculateTableHeight()
},
watch: {
isActive () {
if (this.isActive) {
this.$store.commit('setCurrentTab', this)
}
},
query () {
this.isUnsaved = true
},
isUnsaved () {
this.$store.commit('updateTabState', { index: this.tabIndex, newValue: this.isUnsaved })
}
},
methods: {
// Run a command in the database
execute () {
// this.$refs.output.textContent = 'Fetching results...' */
this.isGettingResults = true
this.result = null
this.error = null
this.$db.execute(this.query + ';')
.then(result => {
this.result = result
})
.catch(err => {
this.error = err
})
.finally(() => {
this.isGettingResults = false
})
},
handleResize () {
if (this.view === 'chart') {
// hack react-chart editor: hidden and show in order to make the graph resize
this.view = 'not chart'
this.$nextTick(() => {
this.view = 'chart'
})
}
this.calculateTableHeight()
},
calculateTableHeight () {
const bottomPane = this.$refs.bottomPane
// 88 - view swittcher height
// 42 - table footer width
// 30 - desirable space after the table
// 5 - padding-bottom of rounded table container
// 40 - height of table header
const freeSpace = bottomPane.offsetHeight - 88 - 42 - 30 - 5 - 40
this.tableViewHeight = freeSpace - (freeSpace % 40)
},
getChartSatateForSave () {
return this.$refs.chart.getChartSatateForSave()
}
}
}
</script>
<style scoped>
.tab-content-container {
padding-top: 6px;
background-color: var(--color-bg-light);
border-top: 1px solid var(--color-border-light);
margin-top: -1px;
}
#bottomPane {
height: 100%;
}
.query-results-splitter {
height: calc(100vh - 110px);
background-color: var(--color-bg-light);
}
.run-btn {
margin-top: 24px;
}
.query-editor {
padding: 52px 52px 24px;
display: flex;
flex-direction: column;
height: 100%;
max-height: 100%;
box-sizing: border-box;
min-height: 190px;
}
.run-btn-container {
text-align: right;
}
.table-view {
margin: 0 52px;
height: calc(100% - 88px);
position: relative;
}
.table-preview {
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
color: var(--color-text-base);
font-size: 13px;
}
.table-preview.error {
color: var(--color-text-error);
}
.table-preview.error::first-letter {
text-transform: capitalize;
}
</style>

View File

@@ -1,84 +0,0 @@
<template>
<div>
<div @click="colVisible = !colVisible" class="table-name">
<svg
:style="{transform: colVisible ? 'rotate(90deg)' : 'rotate(0)'}"
class="chevron-icon"
width="9"
height="9"
viewBox="0 0 8 12"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0.721924 9.93097L4.85292 5.79997L0.721924 1.66897L1.99992 0.399973L7.39992 5.79997L1.99992 11.2L0.721924 9.93097Z"
:fill="colVisible ? '#506784' : 'rgba(80, 103, 132, 0.5)'"
/>
</svg>
{{ name }}
</div>
<div v-show="colVisible" class="columns">
<div v-for="(col, index) in columns" :key="index" class="column">
{{ col.name }}
<span class="column-type">{{ col.type }}</span>
</div>
</div>
</div>
</template>
<script>
import sqliteParser from 'sqlite-parser'
export default {
name: 'TableDescription',
props: ['name', 'sql'],
data () {
return {
colVisible: false
}
},
computed: {
ast () {
return sqliteParser(this.sql)
},
columns () {
const columns = []
this.ast.statement[0].definition.forEach(item => {
if (item.variant === 'column') {
let type = item.datatype.variant
if (item.datatype.args) {
type = type + '(' + item.datatype.args.expression[0].value
if (item.datatype.args.expression.length === 2) {
type = type + ', ' + item.datatype.args.expression[1].value
}
type = type + ')'
}
columns.push({ name: item.name, type: type })
}
})
return columns
}
}
}
</script>
<style scoped>
.table-name, .column {
margin-top: 11px;
}
.table-name:hover {
cursor: pointer;
}
.columns {
margin-left: 24px;
}
.column-type {
display: inline-block;
background-color: var(--color-gray-light-4);
border: 1px solid var(--color-border);
border-radius: var(--border-radius-small);
padding: 2px 6px;
font-size: 11px;
text-transform: uppercase;
}
</style>

View File

@@ -1,157 +0,0 @@
<template>
<div id="tabs-container">
<div id="tabs__header" v-if="tabs.length > 0">
<div
v-for="(tab, index) in tabs"
:key="tab.id"
@click="selectTab(tab.id)"
:class="[{'tab__selected': (tab.id === selectedIndex)}, 'tab']"
>
<div class="tab-name">
<span v-show="tab.isUnsaved">*</span>
<span v-if="tab.name">{{ tab.name }}</span>
<span v-else class="tab-untitled">{{ tab.tempName }}</span>
</div>
<div>
<svg
class="close-icon"
@click.stop="closeTab(index)"
width="10"
height="10"
viewBox="0 0 14 14"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z"
fill="#A2B1C6"/>
</svg>
</div>
</div>
</div>
<tab-content
v-for="(tab, index) in tabs"
:key="tab.id"
:id="tab.id"
:init-name="tab.name"
:init-query="tab.query"
:init-chart="tab.chart"
:tab-index="index"
/>
<div v-if="tabs.length === 0" id="start-guide">
<span class="link" @click="$root.$emit('createNewQuery')">Create</span>
a new query from scratch or open the one from
<router-link class="link" to="/my-queries">My queries</router-link>
</div>
</div>
</template>
<script>
import TabContent from '@/components/TabContent'
export default {
components: {
TabContent
},
data () {
return {
}
},
computed: {
tabs () {
return this.$store.state.tabs
},
selectedIndex () {
return this.$store.state.currentTabId
}
},
methods: {
selectTab (id) {
this.$store.commit('setCurrentTabId', id)
},
closeTab (index) {
this.$store.commit('deleteTab', index)
}
}
}
</script>
<style>
#tabs-container {
position: relative;
height: 100%;
}
#tabs__header {
display: flex;
margin: 0;
max-width: 100%;
overflow: hidden;
}
#tabs__header .tab {
height: 36px;
background-color: var(--color-bg-light);
border-right: 1px solid var(--color-border-light);
border-bottom: 1px solid var(--color-border-light);
line-height: 36px;
font-size: 14px;
color: var(--color-text-base);
padding: 0 12px;
box-sizing: border-box;
position: relative;
max-width: 200px;
display: flex;
flex-shrink: 1;
min-width: 0;
}
#tabs__header .tab-name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex-shrink: 1;
}
#tabs__header div:hover {
cursor: pointer;
}
#tabs__header .tab__selected {
color: var(--color-text-active);
font-weight: 600;
border-bottom: none;
}
#tabs__header .tab__selected:hover {
cursor: default;
}
#tabs__header .tab__selected:before {
content: '';
position: absolute;
width: 100%;
height: 5px;
background-color: var(--color-accent);
top: 0;
left: 0;
}
.close-icon {
margin-left: 5px;
}
.close-icon:hover path {
fill: var(--color-text-base);
cursor: pointer;
}
#start-guide {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: var(--color-text-base);
font-size: 14px;
text-align: center;
}
.link {
color: var(--color-accent);
text-decoration: none;
cursor: pointer;
}
</style>

View File

@@ -1,63 +0,0 @@
<template>
<div>
<div :class="['text-field-label', { error: errorMsg }]">{{ label }}</div>
<input
type="text"
:placeholder="placeholder"
:class="{ error: errorMsg }"
:style="{ width: width }"
:value="value"
@input="$emit('input', $event.target.value)"
/>
<div class="text-field-error">{{ errorMsg }}</div>
</div>
</template>
<script>
export default {
name: 'textField',
props: ['placeholder', 'label', 'errorMsg', 'value', 'width']
}
</script>
<style scoped>
input {
background: var(--color-white);
border: 1px solid var(--color-border);
color: var(--color-text-base);
border-radius: var(--border-radius-medium-2);
height: 36px;
padding: 0 8px;
font-size: 13px;
box-sizing: border-box;
}
input::placeholder {
color: var(--color-text-light-2);
}
input:focus {
outline: none;
}
input.error {
border-color: var(--color-text-error);
}
.text-field-label {
font-size: 12px;
color: var(--color-text-base);
padding-left: 8px;
margin-bottom: 2px;
}
.text-field-label.error {
color: var(--color-text-error);
}
.text-field-error {
color: var(--color-text-error);
font-size: 12px;
padding-left: 8px;
margin-top: 2px;
}
</style>

View File

@@ -1,67 +0,0 @@
<template>
<div class="view-switcher">
<div
:class="['table-mode', {'active-mode': view === 'table'}]"
@click="$emit('update:view','table')"
>
Table
</div>
<div
:class="['chart-mode', {'active-mode': view === 'chart'}]"
@click="$emit('update:view','chart')"
>
Chart
</div>
</div>
</template>
<script>
export default {
name: 'ViewSwitcher',
props: ['view']
}
</script>
<style scoped>
.view-switcher {
height: 28px;
display: flex;
padding: 30px;
justify-content: center;
}
.view-switcher div {
height: 100%;
width: 136px;
box-sizing: border-box;
line-height: 28px;
font-size: 12px;
cursor: pointer;
background: var(--color-white);
border: 1px solid var(--color-border);
color: var(--color-text-base);
text-align: center;
font-weight: 400;
}
.view-switcher div:hover {
background-color: var(--color-bg-light);
color: var(--color-text-active);
}
.view-switcher div.active-mode {
background: var(--color-accent);
border: 1px solid var(--color-accent-shade);
color: var(--color-text-light);
text-shadow: var(--shadow);
z-index: 1;
font-weight: 600;
}
.view-switcher div.active-mode:hover {
background: var(--color-accent-shade);
}
.table-mode {
border-radius: var(--border-radius-medium) 0 0 var(--border-radius-medium);
}
.chart-mode {
margin-left: -1px;
border-radius: 0 var(--border-radius-medium) var(--border-radius-medium) 0;
}
</style>

View File

@@ -1,20 +0,0 @@
<template>
<svg @click.stop="$emit('click')" class="icon" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z" fill="#A2B1C6"/>
</svg>
</template>
<script>
export default {
name: 'CloseIcon'
}
</script>
<style scoped>
.icon {
cursor: pointer;
}
.icon:hover path {
fill: var(--color-text-active);
}
</style>

View File

@@ -1,21 +0,0 @@
<template>
<svg @click.stop="$emit('click')" class="icon" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.25 15.75H6V5.25H14.25V15.75ZM14.25 3.75H6C5.60218 3.75 5.22064 3.90804 4.93934 4.18934C4.65804 4.47064 4.5 4.85218 4.5 5.25V15.75C4.5 16.1478 4.65804 16.5294 4.93934 16.8107C5.22064 17.092 5.60218 17.25 6 17.25H14.25C14.6478 17.25 15.0294 17.092 15.3107 16.8107C15.592 16.5294 15.75 16.1478 15.75 15.75V5.25C15.75 4.85218 15.592 4.47064 15.3107 4.18934C15.0294 3.90804 14.6478 3.75 14.25 3.75ZM12 0.75H3C2.60218 0.75 2.22064 0.908035 1.93934 1.18934C1.65804 1.47064 1.5 1.85218 1.5 2.25V12.75H3V2.25H12V0.75Z" fill="#A2B1C6"/>
</svg>
</template>
<script>
export default {
name: 'CopyIcon'
}
</script>
<style scoped>
.icon {
vertical-align: middle;
margin: 0 12px;
}
.icon:hover path {
fill: var(--color-accent);
}
</style>

View File

@@ -1,22 +0,0 @@
<template>
<svg @click.stop="$emit('click')" class="icon" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.75 2.25V3H3V4.5H3.75V14.25C3.75 14.6478 3.90804 15.0294 4.18934 15.3107C4.47064 15.592 4.85218 15.75 5.25 15.75H12.75C13.1478 15.75 13.5294 15.592 13.8107 15.3107C14.092 15.0294 14.25 14.6478 14.25 14.25V4.5H15V3H11.25V2.25H6.75ZM5.25 4.5H12.75V14.25H5.25V4.5ZM6.75 6V12.75H8.25V6H6.75ZM9.75 6V12.75H11.25V6H9.75Z" fill="#A2B1C6"/>
</svg>
</template>
<script>
export default {
name: 'DeleteIcon'
}
</script>
<style scoped>
.icon {
vertical-align: middle;
margin: 0 0 0 12px;
}
.icon:hover path {
fill: var(--color-accent);
}
</style>

View File

@@ -1,22 +0,0 @@
<template>
<svg @click.stop="$emit('click')" class="icon" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.5 1.5H4.5C3.675 1.5 3 2.175 3 3V15C3 15.825 3.675 16.5 4.5 16.5H13.5C14.325 16.5 15 15.825 15 15V6L10.5 1.5ZM13.5 15H4.5V3H9.75V6.75H13.5V15ZM12 8.25V13.575L10.425 12L8.325 14.1L6.225 12L8.325 9.9L6.675 8.25H12Z" fill="#A2B1C6"/>
</svg>
</template>
<script>
export default {
name: 'ExportIcon'
}
</script>
<style scoped>
.icon {
vertical-align: middle;
margin: 0 12px;
}
.icon:hover path {
fill: var(--color-accent);
}
</style>

View File

@@ -1,22 +0,0 @@
<template>
<svg @click.stop="$emit('click')" class="icon" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.545 6.75L11.25 7.455L4.44 14.25H3.75V13.56L10.545 6.75ZM13.245 2.25C13.0575 2.25 12.8625 2.325 12.72 2.4675L11.3475 3.84L14.16 6.6525L15.5325 5.28C15.825 4.9875 15.825 4.5 15.5325 4.2225L13.7775 2.4675C13.6275 2.3175 13.44 2.25 13.245 2.25ZM10.545 4.6425L2.25 12.9375V15.75H5.0625L13.3575 7.455L10.545 4.6425Z" fill="#A2B1C6"/>
</svg>
</template>
<script>
export default {
name: 'RenameIcon'
}
</script>
<style scoped>
.icon {
vertical-align: middle;
margin: 0 12px 0 6px;
}
.icon:hover path {
fill: var(--color-accent);
}
</style>

View File

@@ -1,46 +0,0 @@
import store from '@/store'
import router from '@/router'
const worker = new Worker('js/worker.sql-wasm.js')
export default {
loadDb (file) {
const dbName = file.name
store.commit('saveDbName', dbName)
const f = file
const r = new FileReader()
r.onload = () => {
worker.onmessage = () => {
const getSchemaSql = `
SELECT name, sql
FROM sqlite_master
WHERE type='table' AND name NOT LIKE 'sqlite_%';`
worker.onmessage = event => {
store.commit('saveSchema', event.data.results[0].values)
if (router.currentRoute.path !== '/editor') {
router.push('/editor')
}
}
worker.postMessage({ action: 'exec', sql: getSchemaSql })
}
store.commit('saveDbFile', r.result)
try {
worker.postMessage({ action: 'open', buffer: r.result }, [r.result])
} catch (exception) {
worker.postMessage({ action: 'open', buffer: r.result })
}
}
r.readAsArrayBuffer(f)
},
execute (commands) {
return new Promise((resolve, reject) => {
worker.onmessage = (event) => {
if (event.data.error) {
reject(event.data.error)
}
// if it was more than one select - take only the first one
resolve(event.data.results[0])
}
worker.postMessage({ action: 'exec', sql: commands })
})
}
}

View File

@@ -1,24 +0,0 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { VuePlugin } from 'vuera'
import VModal from 'vue-js-modal'
import db from '@/dataBase'
import '@/assets/styles/variables.css'
import '@/assets/styles/buttons.css'
import '@/assets/styles/tables.css'
import '@/assets/styles/dialogs.css'
Vue.use(VuePlugin)
Vue.use(VModal)
Vue.config.productionTip = false
Vue.prototype.$db = db
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

View File

@@ -1,39 +0,0 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import Editor from '../views/Editor'
import MyQueries from '../views/MyQueries'
import DbUpload from '../views/DbUpload'
import MainView from '../views/MainView'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'Welcome',
component: DbUpload
},
{
path: '/',
name: 'MainView',
component: MainView,
children: [
{
path: '/editor',
name: 'Editor',
component: Editor
},
{
path: '/my-queries',
name: 'MyQueries',
component: MyQueries
}
]
}
]
const router = new VueRouter({
routes
})
export default router

View File

@@ -1,66 +0,0 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
schema: null,
dbFile: null,
dbName: null,
tabs: [],
currentTab: null,
currentTabId: null,
untitledLastIndex: 0
},
mutations: {
saveSchema (state, schema) {
state.schema = schema
},
saveDbFile (state, file) {
state.dbFile = file
},
saveDbName (state, name) {
state.dbName = name
},
addTab (state, tab) {
state.tabs.push(tab)
},
updateTabName (state, { index, newName }) {
const tab = state.tabs[index]
tab.name = newName
Vue.set(state.tabs, index, tab)
},
updateTabState (state, { index, newValue }) {
console.log(index, newValue)
const tab = state.tabs[index]
tab.isUnsaved = newValue
Vue.set(state.tabs, index, tab)
},
deleteTab (state, index) {
if (state.tabs[index].id !== state.currentTabId) {
} else if (index < state.tabs.length - 1) {
state.currentTabId = state.tabs[index + 1].id
} else if (index > 0) {
state.currentTabId = state.tabs[index - 1].id
} else {
state.currentTabId = null
state.untitledLastIndex = 0
}
state.tabs.splice(index, 1)
},
setCurrentTabId (state, id) {
state.currentTabId = id
},
setCurrentTab (state, tab) {
state.currentTab = tab
},
updateUntitledLastIndex (state) {
state.untitledLastIndex += 1
}
},
actions: {
},
modules: {
}
})

View File

@@ -1,93 +0,0 @@
<template>
<div id="dbloader-container">
<h1>Sqliteviz</h1>
<label for="assetsFieldHandle">
<div id="drop-area" @dragover="dragover" @dragleave="dragleave" @drop="drop">
<input
type="file"
id="assetsFieldHandle"
@change="loadDb"
ref="file"
accept=".db"
/>
<div>
Drop the database file to upload here or click to choose a file from your computer.
</div>
</div>
</label>
<div id="error" class="error"></div>
<button id ="skip" class="secondary" @click="$router.push('/editor')">
Skip database connection for now
</button>
</div>
</template>
<script>
export default {
name: 'DbUpload',
methods: {
loadDb () {
this.$db.loadDb(this.$refs.file.files[0])
},
dragover (event) {
event.preventDefault()
// TODO: Add some visual stuff to show the user can drop its files
if (!event.currentTarget.classList.contains('bg-green-300')) {
event.currentTarget.classList.remove('bg-gray-100')
event.currentTarget.classList.add('bg-green-300')
}
},
dragleave (event) {
// Clean up
event.currentTarget.classList.add('bg-gray-100')
event.currentTarget.classList.remove('bg-green-300')
},
drop (event) {
event.preventDefault()
this.$refs.file.files = event.dataTransfer.files
this.loadDb()
// Clean up
event.currentTarget.classList.add('bg-gray-100')
event.currentTarget.classList.remove('bg-green-300')
}
}
}
</script>
<style scoped>
#dbloader-container {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
h1 {
color: var(--color-accent);
}
label {
display: inline-block;
border: 1px dashed var(--color-border);
padding: 8px;
border-radius: var(--border-radius-big);
}
#drop-area {
width: 628px;
height: 490px;
background-color: var(--color-bg-light-3);
border-radius: var(--border-radius-big);
color: var(--color-text-base);
font-size: 13px;
padding: 200px 144px;
text-align: center;
box-sizing: border-box;
}
input {
display: none;
}
#skip {
position: absolute;
bottom: 50px;
}
</style>

View File

@@ -1,38 +0,0 @@
<template>
<div>
<splitpanes
class="schema-tabs-splitter"
:before="{ size: 20, max: 30 }"
:after="{ size: 80, max: 100 }"
>
<template #left-pane>
<schema />
</template>
<template #right-pane>
<tabs />
</template>
</splitpanes>
</div>
</template>
<script>
import Splitpanes from '@/components/Splitpanes'
import Schema from '@/components/Schema'
import Tabs from '@/components/Tabs'
export default {
name: 'Editor',
components: {
Schema,
Splitpanes,
Tabs
}
}
</script>
<style>
.schema-tabs-splitter {
height: 100%;
margin-left: 6px;
}
</style>

View File

@@ -1,25 +0,0 @@
<template>
<div>
<main-menu />
<keep-alive include="Editor">
<router-view id="main-view" />
</keep-alive>
</div>
</template>
<script>
import MainMenu from '@/components/MainMenu'
import '@/assets/styles/scrollbars.css'
export default {
name: 'MainView',
components: { MainMenu }
}
</script>
<style scoped>
#main-view {
margin-top: 68px;
height: calc(100vh - 68px);
overflow-y: auto;
}
</style>

View File

@@ -1,467 +0,0 @@
<template>
<div>
<div id="my-queries-content">
<div id="my-queries-toolbar">
<div id="toolbar-buttons">
<input
ref="importFile"
type="file"
accept=".json"
id="import-file"
@change="importQueries"
/>
<button class="toolbar">
<label for="import-file">
Import
</label>
</button>
<button
class="toolbar"
v-show="selectedQueriesCount > 0"
@click="exportQuery(selectedQueriesIds)"
>
Export
</button>
<button
class="toolbar"
v-show="selectedQueriesCount > 0"
@click="showDeleteDialog(selectedQueriesIds)"
>
Delete
</button>
</div>
<div id="toolbar-search">
<text-field placeholder="Search query by name" width="300px" v-model="filter"/>
</div>
</div>
<div class="rounded-bg">
<div class="header-container">
<div>
<div class="fixed-header" ref="name-th">
<check-box ref="mainCheckBox" theme="light" @click="toggleSelectAll"/>
<div class="name-th">Name</div>
</div>
<div class="fixed-header">
Created at
</div>
</div>
</div>
<div
class="table-container"
ref="table-container"
>
<table ref="table">
<tbody>
<tr v-for="(query, index) in showedQueries" :key="query.id" @click="openQuery(index)">
<td ref="name-td">
<div class="cell-data">
<check-box
ref="rowCheckBox"
:init="selectAll || selectedQueriesIds.has(query.id)"
@change="toggleRow($event, query.id)"
/>
<div class="name">{{ query.name }}</div>
</div>
</td>
<td>
<div class="second-column">
<div class="date-container">{{ query.createdAt | date }}</div>
<div class="icons-container">
<rename-icon @click="showRenameDialog(query.id)" />
<copy-icon @click="duplicateQuery(index)"/>
<export-icon @click="exportQuery(index)"/>
<delete-icon @click="showDeleteDialog(query.id)"/>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!--Rename Query dialog -->
<modal name="rename" classes="dialog" height="auto">
<div class="dialog-header">
Rename query
<close-icon @click="$modal.hide('rename')"/>
</div>
<div class="dialog-body">
<text-field
label="New query name"
:error-msg="errorMsg"
v-model="newName"
width="100%"
/>
</div>
<div class="dialog-buttons-container">
<button class="secondary" @click="$modal.hide('rename')">Cancel</button>
<button class="primary" @click="renameQuery">Rename</button>
</div>
</modal>
<!--Delete Query dialog -->
<modal name="delete" classes="dialog" height="auto">
<div class="dialog-header">
Delete {{ deleteGroup ? 'queries' : 'query' }}
<close-icon @click="$modal.hide('delete')"/>
</div>
<div
v-if="
deleteGroup || (
currentQueryIndex !== null
&& currentQueryIndex >= 0
&& currentQueryIndex < queries.length
)
"
class="dialog-body"
>
Are you sure you want to delete
{{ deleteGroup
? `${selectedQueriesCount} ${selectedQueriesCount > 1 ? 'queries' : 'query'}`
: `"${queries[currentQueryIndex].name}"`
}}?
</div>
<div class="dialog-buttons-container">
<button class="secondary" @click="$modal.hide('delete')">Cancel</button>
<button class="primary" @click="deleteQuery">Delete</button>
</div>
</modal>
<a ref="downloader" />
</div>
</template>
<script>
import RenameIcon from '@/components/svg/rename'
import CopyIcon from '@/components/svg/copy'
import ExportIcon from '@/components/svg/export'
import DeleteIcon from '@/components/svg/delete'
import CloseIcon from '@/components/svg/close'
import TextField from '@/components/TextField'
import CheckBox from '@/components/CheckBox'
import { nanoid } from 'nanoid'
export default {
name: 'MyQueries',
components: {
RenameIcon,
CopyIcon,
ExportIcon,
DeleteIcon,
CloseIcon,
TextField,
CheckBox
},
data () {
return {
queries: [],
filter: null,
newName: null,
currentQueryId: null,
errorMsg: null,
selectedQueriesIds: new Set(),
selectedQueriesCount: 0,
selectAll: false,
deleteGroup: false
}
},
computed: {
showedQueries () {
if (!this.filter) {
return this.queries
} else {
return this.queries.filter(query => query.name.toUpperCase().indexOf(this.filter.toUpperCase()) >= 0)
}
},
currentQueryIndex () {
return this.queries.findIndex(query => query.id === this.currentQueryId)
}
},
created () {
this.queries = JSON.parse(localStorage.getItem('myQueries'))
},
mounted () {
new ResizeObserver(this.calcNameWidth).observe(this.$refs.table)
this.calcNameWidth()
},
filters: {
date (value) {
if (!value) {
return ''
}
const dateOptions = { year: 'numeric', month: 'long', day: 'numeric' }
const timeOptions = {
hour12: false,
hour: '2-digit',
minute: '2-digit'
}
return new Date(value).toLocaleDateString('en-GB', dateOptions) + ' ' +
new Date(value).toLocaleTimeString('en-GB', timeOptions)
}
},
methods: {
calcNameWidth () {
this.$refs['name-th'].style = `width: ${this.$refs['name-td'][0].offsetWidth}px`
},
openQuery (index) {
const tab = this.showedQueries[index]
tab.isUnsaved = false
this.$store.commit('addTab', tab)
this.$store.commit('setCurrentTabId', tab.id)
this.$router.push('/editor')
},
showRenameDialog (id) {
this.errorMsg = null
this.currentQueryId = id
this.newName = this.queries[this.currentQueryIndex].name
this.$modal.show('rename')
},
renameQuery () {
if (!this.newName) {
this.errorMsg = 'Query name can\'t be empty'
return
}
const currentQuery = this.queries[this.currentQueryIndex]
currentQuery.name = this.newName
this.$set(this.queries, this.currentQueryIndex, currentQuery)
this.$modal.hide('rename')
this.saveQueriesInLocalStorage()
const tabIndex = this.findTabIndex(currentQuery.id)
if (tabIndex >= 0) {
this.$store.commit('updateTabName', { index: tabIndex, newName: this.newName })
}
},
duplicateQuery (index) {
const newQuery = JSON.parse(JSON.stringify(this.showedQueries[index]))
newQuery.name = newQuery.name + ' Copy'
newQuery.id = nanoid()
newQuery.createdAt = new Date()
this.queries.push(newQuery)
if (this.selectAll) {
this.selectedQueriesIds.add(newQuery.id)
this.selectedQueriesCount = this.selectedQueriesIds.size
}
this.saveQueriesInLocalStorage()
},
showDeleteDialog (id) {
this.deleteGroup = typeof id !== 'string'
if (!this.deleteGroup) {
this.currentQueryId = id
}
this.$modal.show('delete')
},
deleteQuery () {
this.$modal.hide('delete')
if (!this.deleteGroup) {
this.queries.splice(this.currentQueryIndex, 1)
const tabIndex = this.findTabIndex(this.currentQueryId)
if (tabIndex >= 0) {
this.$store.commit('deleteTab', tabIndex)
}
if (this.selectedQueriesIds.has(this.currentQueryId)) {
this.selectedQueriesIds.delete(this.currentQueryId)
}
} else {
this.queries = this.selectAll
? []
: this.queries.filter(query => !this.selectedQueriesIds.has(query.id))
const tabs = this.$store.state.tabs
for (let i = tabs.length - 1; i >= 0; i--) {
if (this.selectedQueriesIds.has(tabs[i].id)) {
this.$store.commit('deleteTab', i)
}
}
this.selectedQueriesIds.clear()
}
this.selectedQueriesCount = this.selectedQueriesIds.size
this.saveQueriesInLocalStorage()
},
findTabIndex (id) {
return this.$store.state.tabs.findIndex(tab => tab.id === id)
},
exportQuery (index) {
let data
let name
// single operation
if (typeof index === 'number') {
console.log('single')
data = JSON.parse(JSON.stringify(this.showedQueries[index]))
name = data.name
delete data.id
delete data.createdAt
} else {
// group operation
data = this.selectAll
? JSON.parse(JSON.stringify(this.queries))
: this.queries.filter(query => this.selectedQueriesIds.has(query.id))
name = 'My sqliteviz queries'
data.forEach(query => {
delete query.id
delete query.createdAt
})
}
// export data to file
const downloader = this.$refs.downloader
const json = JSON.stringify(data, null, 4)
const blob = new Blob([json], { type: 'octet/stream' })
const url = window.URL.createObjectURL(blob)
downloader.href = url
downloader.download = `${name}.json`
downloader.click()
window.URL.revokeObjectURL(url)
},
importQueries () {
const file = this.$refs.importFile.files[0]
const reader = new FileReader()
reader.onload = () => {
let importedQueries = JSON.parse(event.target.result)
if (!Array.isArray(importedQueries)) {
importedQueries = [importedQueries]
}
importedQueries.forEach(query => {
query.id = nanoid()
query.createdAt = new Date()
if (this.selectAll) {
this.selectedQueriesIds.add(query.id)
this.selectedQueriesCount = this.selectedQueriesIds.size
}
})
this.queries = this.queries.concat(importedQueries)
this.saveQueriesInLocalStorage()
this.$refs.importFile.value = null
}
reader.readAsText(file)
},
saveQueriesInLocalStorage () {
localStorage.setItem('myQueries', JSON.stringify(this.queries))
},
toggleSelectAll (checked) {
this.selectAll = checked
this.$refs.rowCheckBox.forEach(item => { item.checked = checked })
this.selectedQueriesIds = checked ? new Set(this.queries.map(query => query.id)) : new Set()
this.selectedQueriesCount = this.selectedQueriesIds.size
},
toggleRow (checked, id) {
if (checked) {
this.selectedQueriesIds.add(id)
} else {
if (this.selectedQueriesIds.size === this.queries.length) {
this.$refs.mainCheckBox.checked = false
this.selectAll = false
}
this.selectedQueriesIds.delete(id)
}
this.selectedQueriesCount = this.selectedQueriesIds.size
}
}
}
</script>
<style scoped>
#my-queries-content {
padding: 52px;
}
#my-queries-toolbar {
display: flex;
justify-content: space-between;
margin-bottom: 18px;
margin: 0 auto 8px;
max-width: 1500px;
width: 100%;
}
.rounded-bg {
margin: 0 auto;
max-width: 1500px;
width: 100%;
}
.fixed-header:first-child {
display: flex;
align-items: center;
padding-left: 12px;
}
.fixed-header:first-child .name-th {
margin-left: 24px;
}
table {
margin-top: 0;
}
tbody tr td {
min-width: 0;
line-height: 40px;
}
tbody tr td:first-child {
width: 70%;
max-width: 0;
padding: 0 12px;
}
tbody tr td:last-child {
width: 30%;
max-width: 0;
padding: 0 24px;
}
tbody .cell-data {
display: flex;
align-items: center;
max-width: 100%;
}
tbody .cell-data div.name {
overflow: hidden;
text-overflow: ellipsis;
margin-left: 24px;
}
tbody tr:hover td {
cursor: pointer;
}
tbody tr:hover td {
color: var(--color-text-active);
}
.second-column {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
max-width: 100%;
}
.icons-container {
display: none;
}
.date-container {
flex-shrink: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}
tbody tr:hover .icons-container {
display: block;
}
.dialog input {
width: 100%;
}
a, #import-file {
display: none;
}
button.toolbar {
margin-right: 16px;
}
button label {
display: block;
line-height: 36px;
}
button label:hover {
cursor: pointer;
}
</style>

View File

@@ -1,13 +0,0 @@
import { expect } from 'chai'
import { shallowMount } from '@vue/test-utils'
import HelloWorld from '@/components/HelloWorld.vue'
describe('HelloWorld.vue', () => {
it('renders props.msg when passed', () => {
const msg = 'new message'
const wrapper = shallowMount(HelloWorld, {
propsData: { msg }
})
expect(wrapper.text()).to.include(msg)
})
})

View File

@@ -1,15 +0,0 @@
const CopyPlugin = require('copy-webpack-plugin')
module.exports = {
publicPath: '',
configureWebpack: {
plugins: [
new CopyPlugin([
// This wasm file will be fetched dynamically when we initialize sql.js
// It is important that we do not change its name, and that it is in the same folder as the js
{ from: 'node_modules/sql.js/dist/sql-wasm.wasm', to: 'js/' },
{ from: 'node_modules/sql.js/dist/worker.sql-wasm.js', to: 'js/' }
])
]
}
}