Compare commits
1050 Commits
Author | SHA1 | Date | |
---|---|---|---|
fe39c1d388 | |||
d114f8a651 | |||
84168d1d75 | |||
498a9b48e2 | |||
01f607cd40 | |||
efe134a059 | |||
40cb4dd98d | |||
a142d3c4d7 | |||
89da957a49 | |||
05c2f9836c | |||
ebc325ae0c | |||
39326eb52e | |||
df681147aa | |||
ffc645ba5e | |||
1fb1205319 | |||
c90ab0e880 | |||
9dc700e13e | |||
6950d0ce5a | |||
4df14c3693 | |||
c05be8304f | |||
31c575dad9 | |||
040657d5ca | |||
5043fafa93 | |||
8eb127e458 | |||
d044a02cb7 | |||
8cb2c197c8 | |||
c50d17e82b | |||
|
7c186d2dee | ||
0f219cf9b7 | |||
75c5a34095 | |||
48877534d1 | |||
c22413fde9 | |||
77ab8d8a03 | |||
4386c6ab95 | |||
19205e0736 | |||
4fc4ddd1d6 | |||
49b63bc6f2 | |||
44eb507a12 | |||
1590ffaff0 | |||
3c1bae540f | |||
44bb75bc60 | |||
8bb5bb93cf | |||
f64a12a8e9 | |||
da25823868 | |||
a9fcfd57ec | |||
e2307341f3 | |||
09a372e96d | |||
f4da28cca0 | |||
89745b7391 | |||
104b7c928b | |||
|
427360d826 | ||
e29d86b409 | |||
|
0bfa14e1c9 | ||
88ba55ec02 | |||
aaff4cf4fe | |||
35c54aee84 | |||
be2e9b21f5 | |||
2262278393 | |||
531e17889a | |||
a07ed58004 | |||
00dc59a76d | |||
2f883bfeb2 | |||
7ff16fccce | |||
|
3625fbc1b0 | ||
|
deee0d637b | ||
8c6950cebd | |||
46167e4473 | |||
c32a4415d1 | |||
1c3d7aa30b | |||
664d18efc1 | |||
cc941dfc04 | |||
1d151e9349 | |||
addd9fba28 | |||
a00c19d300 | |||
9551afbd2d | |||
1ead76c028 | |||
d3da15aa13 | |||
f3b5de38c4 | |||
|
d4b6d2e9d1 | ||
|
e2c106e4e0 | ||
eb60899e6e | |||
1d367d468d | |||
8ecaedbf6c | |||
|
dd1eebd4ec | ||
8c83b3f144 | |||
985e5d3527 | |||
78902639eb | |||
cb038b374a | |||
eafdb1cc3d | |||
91e0630513 | |||
bf768c3800 | |||
0b1aa3dd29 | |||
ec75f9546a | |||
9bc9adb7cf | |||
b4d14d98db | |||
c21bd6075c | |||
44647f5b55 | |||
3f9e6d85ca | |||
6a6f43a718 | |||
f12a04b052 | |||
abf829867e | |||
b71f04e5aa | |||
7725fafe85 | |||
ed3d35f131 | |||
e0946f04f7 | |||
0891e7be8c | |||
f312cf5f85 | |||
05e0d310ec | |||
|
1e0b2b4cae | ||
5ee728cfe4 | |||
a91fa8ff54 | |||
|
2c13433900 | ||
dcc2a4c51c | |||
7537dff401 | |||
853ee1f572 | |||
cf9c7c600a | |||
73b88cad9e | |||
d2eb31a63d | |||
d6b36b1f80 | |||
|
d66b932683 | ||
20f5497034 | |||
d4ed886489 | |||
|
aaa14f112a | ||
|
e0f3ff6939 | ||
72a328785c | |||
4c2a1998a9 | |||
8e705706ae | |||
56b0a4815c | |||
a9a4344a71 | |||
ec5ab73b19 | |||
71a5b5c828 | |||
4519829aa2 | |||
a703dcc53e | |||
36e98e0742 | |||
a45d76e8b4 | |||
7702ca025f | |||
f632a0f189 | |||
e97da37103 | |||
6573fe69ac | |||
902c29ffa5 | |||
5f57a9f60d | |||
822af44a47 | |||
e42c424a13 | |||
0a3a4827dd | |||
a80d227400 | |||
cfd82c8f41 | |||
91d0735a5f | |||
93ce619782 | |||
8f01740475 | |||
869c75f654 | |||
|
14aff67d2d | ||
174579bf8c | |||
0eab0a7140 | |||
a103617ce8 | |||
61ec3cbd4e | |||
1765d9fd0b | |||
329656ff1d | |||
|
067a6f3507 | ||
d12c6f5210 | |||
89e8d9fcdb | |||
ee623b0a0f | |||
33a4663694 | |||
c37138c6f5 | |||
e754877ee6 | |||
ed38a9e7ff | |||
6bad032f0d | |||
d214c1f35b | |||
77d9cac092 | |||
cba2ce2e37 | |||
bd46d17424 | |||
5b33419b64 | |||
00242697a1 | |||
85cec05f70 | |||
5fa8bf38e4 | |||
23acf00def | |||
be70b5be7f | |||
7fc01227e7 | |||
1c666a07d8 | |||
|
49abd1ea7f | ||
|
d3b9e08446 | ||
20b814378b | |||
8ce1d1a964 | |||
d151c7254e | |||
26aad519df | |||
31b7999bba | |||
caf776bd55 | |||
a7d5e1973c | |||
8870304c15 | |||
2007305ff0 | |||
e97401e27d | |||
62f6fd16d5 | |||
cdca6eaa35 | |||
34e8d3e5b1 | |||
6c8a36e947 | |||
99b1c1be12 | |||
3991382153 | |||
|
3b57b7ef3b | ||
|
45d599ad7f | ||
9082960310 | |||
|
5398964190 | ||
5d5f1da97b | |||
84826ff4c0 | |||
c95c593c74 | |||
5a50ba88e8 | |||
c5baf2b0d3 | |||
a082514f88 | |||
c826888b0d | |||
8a55b36527 | |||
b0d464952f | |||
|
7c45203636 | ||
|
71b0736d0d | ||
|
42bc9196ff | ||
|
f7e04d6333 | ||
45b2eb2934 | |||
9ee1b3023d | |||
79d9acb471 | |||
e02565c0d9 | |||
ff272440bd | |||
e62f280528 | |||
6d6151814e | |||
58611bf07f | |||
d494b17df7 | |||
ae377a6c3c | |||
cc5910b88f | |||
|
2b436d8613 | ||
|
1869e6a148 | ||
d1bfa282c3 | |||
|
302c66457d | ||
|
0043d07708 | ||
|
e0f85f469f | ||
|
a037d0cc01 | ||
|
5582a12bbf | ||
|
22622df2cf | ||
|
745d551cc9 | ||
a93e71d751 | |||
2a7433da16 | |||
fd5dca2450 | |||
da6481f458 | |||
c7417809f4 | |||
5cb8ec65ad | |||
e4c5d9b404 | |||
bfdb463390 | |||
9fcc7d1cef | |||
70cb92521f | |||
981d31957f | |||
619478c072 | |||
eb1afed108 | |||
0fa22fbe72 | |||
5e4abd3e81 | |||
|
81d897c7b3 | ||
|
b148c210a6 | ||
75aa299f8d | |||
f4795eb92a | |||
18b66b5032 | |||
cdbadbb11a | |||
47e1f27bb8 | |||
4be0f6bbbc | |||
ff8bb45d6d | |||
0d52282aa8 | |||
e9dedfaf32 | |||
9f0ec5e0ce | |||
|
1174bab0cc | ||
9dd685b062 | |||
0821586bb3 | |||
350d53642e | |||
|
88eb9f7ab8 | ||
|
b0195260c3 | ||
|
dfe3728269 | ||
daef6f91b0 | |||
d61acf8a00 | |||
8b04a2b7dd | |||
6780401cb7 | |||
b8e734d827 | |||
4f8bc26349 | |||
|
3eb781021c | ||
|
3cca3ed2b3 | ||
434b9f8284 | |||
690cdcb2eb | |||
c50cbc577f | |||
6af0c33461 | |||
e60789f320 | |||
afa23f3ef1 | |||
7c4b605467 | |||
443170bbb1 | |||
3450497010 | |||
|
eaf38df1b7 | ||
a9f88e5784 | |||
472fa6f430 | |||
f82db96f34 | |||
79f32ca442 | |||
ce0f278caf | |||
6adc93e1cd | |||
5e2ad8c377 | |||
d85662cb7d | |||
e3907914f2 | |||
c6c14fbf2b | |||
3975359292 | |||
9a0f982723 | |||
b4d9821300 | |||
75a41769bf | |||
5dbc127b51 | |||
a315eeae6c | |||
25a6fded2e | |||
42fcded9f1 | |||
186cb85d2e | |||
fc1d6fba7f | |||
cbef7489b2 | |||
96d6913a7a | |||
|
744c623914 | ||
0b861d962d | |||
6cc098c6f0 | |||
40828cb3ff | |||
6086ca4a80 | |||
d92facf518 | |||
|
e9643a0d6b | ||
|
cc609a7051 | ||
796f61bf2f | |||
0f9c991f53 | |||
638a88a1fb | |||
026d74c8c8 | |||
77f8cac6cf | |||
d6fadf5db0 | |||
408ddeda56 | |||
88cd097ec0 | |||
f12e6a96dd | |||
a8ca8f2f76 | |||
|
6fcae957e1 | ||
|
1cd2d8abf3 | ||
ed3c5fe559 | |||
|
9601c59392 | ||
|
14d20a30c1 | ||
42376b4bc6 | |||
e9079adb25 | |||
86f011f34f | |||
bb02479b71 | |||
a67071e284 | |||
8f3efabb69 | |||
db628f7722 | |||
e4bd747381 | |||
88eb113e53 | |||
9109b2c328 | |||
dd070d008d | |||
ee415da127 | |||
f0d368e3e3 | |||
4be55f3fe9 | |||
fd00ea42ee | |||
50b4411e9a | |||
|
cd0a5dc034 | ||
|
9fd427c4ff | ||
f3759b6541 | |||
191a354020 | |||
|
7dc314eecf | ||
|
330a80fe70 | ||
|
b2ce533b82 | ||
|
12ce6b1135 | ||
|
71c5829702 | ||
1c4d5b05b3 | |||
e85197a2cc | |||
|
abf2b92e6e | ||
|
3be826df4b | ||
9db6bfd255 | |||
|
110adf90de | ||
|
40e4fbda15 | ||
8e983ad2cb | |||
|
6305752ad1 | ||
cc02e2c5a8 | |||
|
f4a63eae2a | ||
763be8532d | |||
|
a6f5645a22 | ||
|
bbe13f27dc | ||
f444746f46 | |||
b4af645941 | |||
a5c8daa5b8 | |||
1a9fc37285 | |||
f0351e5b94 | |||
9bda4e71b7 | |||
7c00055034 | |||
4479a9600b | |||
|
7a6bd8bdbd | ||
ad713fcf35 | |||
251795e2d2 | |||
45cda7a7cc | |||
b7039553cc | |||
ddee68b4c2 | |||
573ac6d42e | |||
265f28b4d9 | |||
1990d9a3d4 | |||
748d44977e | |||
4051eff382 | |||
4276586e11 | |||
832fb0fb03 | |||
328ab61757 | |||
95d15de1bd | |||
7dcd4441c4 | |||
d81e0911ab | |||
5bfff649e9 | |||
76743e8f7c | |||
4ed2f9a939 | |||
c5eb73ed3f | |||
fa3f3e1fd8 | |||
2c7c97852f | |||
48ebf23bd1 | |||
64deedc5ad | |||
9f033fb994 | |||
401cb49687 | |||
1356011ba3 | |||
0cfd7938ee | |||
745b55a942 | |||
eef7c1dcec | |||
aa8fc545d7 | |||
a780c7e0ff | |||
|
9a1bb0599f | ||
|
d847870f67 | ||
cd24371576 | |||
|
6ef565cf07 | ||
46b45c8ab6 | |||
f28531a225 | |||
8fb1f0803e | |||
020ce36312 | |||
b4545b178f | |||
d9a3eab015 | |||
2ab49c218d | |||
|
8f9385d508 | ||
|
4e9f8d16ee | ||
0c002918eb | |||
3d56ec7b49 | |||
48c3e6afc4 | |||
|
50a5c8fe1e | ||
b0d1f115c9 | |||
a59f77f618 | |||
e7a1858091 | |||
648a51efe8 | |||
38962c4807 | |||
|
43e4cdd4cf | ||
|
91046c1ac1 | ||
|
63f8b9b6a1 | ||
|
ed476d9b5c | ||
|
f41d8c0480 | ||
e3b54a8be1 | |||
|
c2c0394624 | ||
8a6f5eac59 | |||
a5fdcc1a85 | |||
1df21da47c | |||
8da0224876 | |||
359e14a9eb | |||
813aa320d9 | |||
aaa5549609 | |||
35cb7e1dc4 | |||
992a033cb2 | |||
5267b37eaf | |||
8fe30d8b6d | |||
37ccb6b00d | |||
e8af2d24a8 | |||
d7f1aa97af | |||
c46224635a | |||
cc99491fe4 | |||
fe8435531e | |||
5d48fe08c7 | |||
4437d44486 | |||
9fe3680bbb | |||
da1947e4ef | |||
37a848df9d | |||
|
9816965e18 | ||
98165cacaa | |||
7ad3096b4e | |||
7d345cf795 | |||
f40e9c592e | |||
7671c585f5 | |||
93b4a7063b | |||
3efeb45c46 | |||
3fc227d2de | |||
604b371920 | |||
fd321beece | |||
9fe4e6b9e3 | |||
|
57bf90481b | ||
|
6062a32c1c | ||
94c899eb82 | |||
44a4ca75bd | |||
|
c8e1605b08 | ||
60e5556a3e | |||
f2fcc98839 | |||
c54438d6d3 | |||
b3f10220b3 | |||
d19f475fc2 | |||
795db96319 | |||
b5fee79e90 | |||
|
5532ddbda9 | ||
3369d3dc2d | |||
fd25f881f9 | |||
5ca3a22dc5 | |||
5c668249cf | |||
39b9a59143 | |||
|
d25c62b4da | ||
|
8cf738bac8 | ||
534659f9ae | |||
c00fd1381f | |||
17c6686163 | |||
bc0c5a76ba | |||
2b16c0ece4 | |||
|
ba1416dce2 | ||
13adf0a767 | |||
cacab55f55 | |||
|
3189d625e3 | ||
|
f71ed39b88 | ||
409ed54608 | |||
d9d3bf2bc9 | |||
9e9de7b5c5 | |||
|
b2a5b40c03 | ||
729aa9781a | |||
cd1ebacf89 | |||
a08074b446 | |||
0cd182546b | |||
89fdd210ca | |||
|
0de2321920 | ||
|
e2cf6e8c21 | ||
|
430490ad93 | ||
|
a35566f273 | ||
3679121c25 | |||
|
7657d05edf | ||
|
1ddf8f0dbe | ||
9506bb862a | |||
4cfab365c2 | |||
8d0aa73d1e | |||
30b487c37f | |||
aef17be36c | |||
ea65d8eee7 | |||
|
7dc33c78aa | ||
|
69cd083054 | ||
|
91788054e6 | ||
|
968a67ce3d | ||
f9ee7d0450 | |||
|
0e15c39797 | ||
adf407c1ba | |||
8a86344484 | |||
d2d0c3ca41 | |||
|
9046b858b1 | ||
46987faea8 | |||
|
dd25827e40 | ||
4069ade36d | |||
c8594c0549 | |||
7359c3b5bd | |||
4195b8416f | |||
9407a29922 | |||
2fcd080bd4 | |||
26446fb7ed | |||
2480c76a08 | |||
1f0ec57789 | |||
|
76e5849c78 | ||
db1641b74f | |||
165c54f663 | |||
|
a5ca3ea204 | ||
|
add95292ad | ||
7a63608f54 | |||
7ea7b369ab | |||
258fffa958 | |||
0849c5131f | |||
|
cce59d0ca8 | ||
94a53fec6c | |||
13aa47cd44 | |||
85f625daf7 | |||
7de3bb9346 | |||
e43a0ba0b4 | |||
|
638cd4bfb7 | ||
3959333662 | |||
abd46aa322 | |||
d4888ad8fb | |||
6bfc229b77 | |||
d31b051f4b | |||
95b60df8fc | |||
ed5189fdc1 | |||
265ed66d25 | |||
09c07acd5c | |||
3c5a69adc9 | |||
0203f69e95 | |||
9a2498862c | |||
|
3a26d4f509 | ||
ce08cbd8b5 | |||
|
d91ffcccca | ||
6115eb9409 | |||
3fd26a0523 | |||
e217d5181b | |||
dcf368b350 | |||
21e3e79ddf | |||
2918c3cb92 | |||
3ad190b18c | |||
d5b2bde2ea | |||
a42348ef5c | |||
8b93c49778 | |||
0842e00098 | |||
6cef02bebb | |||
|
334c7a31d2 | ||
bc82289d54 | |||
c9fa941578 | |||
4048df3c7b | |||
198368605b | |||
8f0ac26b69 | |||
b35fc5b78b | |||
622b519cbb | |||
71e2c911ae | |||
756d49b259 | |||
14c64c537c | |||
97b3563e25 | |||
e834fe31ac | |||
065de3a0a2 | |||
1573de5b1f | |||
04fc1bbee0 | |||
dea378014d | |||
3abff36136 | |||
70354aa828 | |||
372049ae64 | |||
5d271be062 | |||
07ee1ae828 | |||
cbe0e2980a | |||
0fba50c6ec | |||
420255cdd4 | |||
a8a47ed5f7 | |||
425f0663f9 | |||
e106d100b5 | |||
d7fdf53932 | |||
62f7e57d0c | |||
14577d14bb | |||
f5f2a697e8 | |||
a0105cf1c3 | |||
77c5d28032 | |||
d1d8592f79 | |||
1f828f69a0 | |||
adc5477673 | |||
1e543aa6b0 | |||
c41e059b0b | |||
e6ef5ffa56 | |||
d67d122270 | |||
b837e2fc68 | |||
a73a2f483e | |||
0a9983d30d | |||
58b91ebfe0 | |||
e78ca2417e | |||
e1855a262d | |||
6b725b1d40 | |||
f6faad98f8 | |||
320aa8ba04 | |||
9f0280b991 | |||
04fa320820 | |||
f7c3aa883d | |||
f7a74df009 | |||
003c02b1fb | |||
ef21ea7448 | |||
525c964c62 | |||
7845e3e501 | |||
0c29e0d566 | |||
d38097d056 | |||
c87b8dc738 | |||
ed6e7fa72d | |||
f0fa7c81b7 | |||
5bb4e496f2 | |||
01057332b0 | |||
ab382dfbcd | |||
88c4cdc8e2 | |||
15ff211a41 | |||
5c855a520a | |||
7488bc7a17 | |||
|
fd85cf43a2 | ||
a87079cd17 | |||
14d5842056 | |||
f19f9e23a2 | |||
0252a064d9 | |||
439356a019 | |||
c6897af22d | |||
7e40dbfba3 | |||
27a153ef43 | |||
56fcc2650b | |||
9622dbec6b | |||
a0ab63bdb5 | |||
8cd76e711c | |||
9af71a6e34 | |||
e7b3c28826 | |||
7570b0add8 | |||
|
1801bef019 | ||
0db5ebd7bf | |||
5c21b67b3d | |||
08d5b1b329 | |||
61a42d51f5 | |||
d96907ca2d | |||
75bbd5f66e | |||
faa07a077c | |||
7ca69e51ae | |||
d868c772b9 | |||
a69bdeb20d | |||
51db2795bb | |||
2d278aa14e | |||
f74bca7bb4 | |||
978a7c5f5b | |||
0110756204 | |||
7df0cf8389 | |||
3aef7e953e | |||
a975df38dd | |||
a0a025e450 | |||
7cc5e7b67f | |||
e2ebb04a90 | |||
e579f37438 | |||
3829b94bf7 | |||
5c8ee66f43 | |||
b77e77f3bb | |||
1d5614278c | |||
8a20befd09 | |||
4133fc452f | |||
690a4541f9 | |||
71910ca5c8 | |||
cce5adbac7 | |||
e6d67fcb0c | |||
e83b80afc9 | |||
8742fa10f0 | |||
ab54eb086f | |||
308f69f12e | |||
2f30bafa33 | |||
|
1716077182 | ||
5562e73e75 | |||
8a7cc2a14f | |||
9ca059d979 | |||
c9ccf786cd | |||
5e9c88a7fd | |||
e0e6483d1f | |||
66227569f4 | |||
faa799c8ea | |||
acc1eeb094 | |||
865dad80df | |||
f502620779 | |||
f61d7eeaf4 | |||
e71c7568c0 | |||
79f033e524 | |||
310cfaa3c2 | |||
6f93e1f9ab | |||
04bdd085a5 | |||
c568acae14 | |||
7a46a119d8 | |||
f1636f1528 | |||
f839d5cd3c | |||
8f4f1d393c | |||
ab17c6d4bf | |||
b4b2f3d0cf | |||
7a766f04e6 | |||
f6b77d1243 | |||
840241c3cc | |||
0f10c9e824 | |||
1e37f2a96f | |||
0d6137195d | |||
d26f168250 | |||
5efcad4d3f | |||
0a872e7023 | |||
0e425a9c6d | |||
434711a360 | |||
854472c7a3 | |||
9a7cd90d5c | |||
026400d242 | |||
4bd8cbbf6c | |||
1382bc9300 | |||
ae103e5477 | |||
6b0b8b19d7 | |||
475397ca34 | |||
7a62131cc7 | |||
c7663be338 | |||
496490b14a | |||
|
672573d8c2 | ||
d923453919 | |||
0435279604 | |||
79cef61fea | |||
dec334737f | |||
84c3692e95 | |||
5dc0b0bea4 | |||
19d16e46bb | |||
3baf6fa173 | |||
29e2d92b5b | |||
bebba64d06 | |||
9dfe7cca22 | |||
35ef070725 | |||
370ad6a536 | |||
5822b3df43 | |||
5208ec171b | |||
6e332da425 | |||
bf3367b41d | |||
ecfb732c26 | |||
fd4f032a6f | |||
1b09909126 | |||
04cd806954 | |||
773cb36ca1 | |||
ccacd3e2c3 | |||
15948b30c9 | |||
3dcb5d4f14 | |||
|
64d93d7c40 | ||
|
2d85295093 | ||
|
cd58e2d8ca | ||
d87495822e | |||
|
8720bcdad6 | ||
1df57dc705 | |||
86240fb53c | |||
1d363f755e | |||
0d77aee3eb | |||
a41cf1ab56 | |||
5ceddb8e00 | |||
16e17b39b6 | |||
20cba6ee9b | |||
9ffd443a66 | |||
f82dbd24dc | |||
6eb2977568 | |||
cafb65560a | |||
532d963019 | |||
1b0a63ff31 | |||
c22187c305 | |||
dcccb544f9 | |||
7d2ace9456 | |||
2584c9b9c2 | |||
a6b75ad0dc | |||
90fd9db917 | |||
c0f54b9514 | |||
cd31413256 | |||
b33199ea59 | |||
dea5ec7513 | |||
be816e8588 | |||
1e938adc5d | |||
8735a0c5f9 | |||
3dde1c109e | |||
d0b3e1b1b8 | |||
c20bff7bcb | |||
9f5ec0276c | |||
55932fe115 | |||
d374372e20 | |||
bb5f44681f | |||
49a4e1cb7b | |||
c2f76e490a | |||
e349dd5eab | |||
280697698e | |||
0783f8b57e | |||
c981244d7a | |||
dcb135dd01 | |||
99f7511c4d | |||
fe4c8e12b3 | |||
21728a663d | |||
9ca03f4625 | |||
affb7288b0 | |||
614e0d3275 | |||
feef5e30ee | |||
82c25711b6 | |||
2ca2988832 | |||
e3f259c6e8 | |||
e7401cc96e | |||
13b9840f3d | |||
d20414b692 | |||
22a8c25717 | |||
db47b4040a | |||
e89911b185 | |||
fccfe92453 | |||
d465e18dba | |||
ffb1712a59 | |||
9f6a183d9b | |||
1f80a64fe1 | |||
fc651149b9 | |||
964570247f | |||
8a6c59f7ce | |||
4d844fe2c9 | |||
d892fa6fb3 | |||
8c9e4f6e96 | |||
966ca60c89 | |||
9bbe218f90 | |||
a1c6be372b | |||
7d0c929fb8 | |||
25d72e3952 | |||
b232a3bb5f | |||
e9a26c1bc0 | |||
76c5c0c680 | |||
ddfb713124 | |||
0081a4167c | |||
239cb4488f | |||
fb5adbe676 | |||
9cd51c8d8b | |||
8dfaa3b7be | |||
5d7efa75b7 | |||
4862d51fba | |||
07f60c3917 | |||
049143d143 | |||
db4430609e | |||
71b4310117 | |||
201fad9265 | |||
45351faeae | |||
b4ead6992c | |||
b1ea32b680 | |||
39ca1974bc | |||
777b73fa6f | |||
4494e637f7 | |||
219da0aba4 | |||
7e8167154f | |||
3aa2159a1a | |||
76d92cd106 | |||
c8545a250b | |||
dbab06fcb8 | |||
b54fefbf25 | |||
9a1bf32128 | |||
110b0b414c | |||
2f58007af4 | |||
9b60bfff8d | |||
3b37b7432e | |||
7c4ca999ce | |||
94c4952319 | |||
014257147e | |||
970de4962b | |||
b5a828309f | |||
5b21d17f3a | |||
2c6e35288f | |||
bcadac6e95 | |||
|
18a93ef1aa | ||
6c62052b47 | |||
9d5ebefdce | |||
34ebc6b72d | |||
288ff4c1a1 | |||
a176174b8d | |||
0f69d1dbb7 | |||
0386bbac50 | |||
b0576acdf6 | |||
9a190854fe | |||
2aace28e80 | |||
02c03e3d26 | |||
a0d85520fb | |||
ede6fe81ce | |||
4e72bb1587 | |||
15417e8a77 | |||
88ab7c5a62 | |||
5940b0b842 | |||
574d493908 | |||
af96647603 | |||
ab70ff239e | |||
bacf458936 | |||
379d6c169a | |||
|
36352f8028 | ||
04fcaf2f6e | |||
8b914446b0 | |||
a11bac504c | |||
b9ed8dd610 | |||
1cf6485896 | |||
4bc9bbfb34 | |||
4923128236 | |||
8ff6e70145 | |||
afcf1c86ed | |||
0200ae4a0f | |||
dbe7b9dd23 | |||
ceab4ef243 | |||
1e7d4ca347 | |||
c0a32c040e | |||
f150508547 | |||
49d71722e2 | |||
59a50bc014 | |||
41d75b127c | |||
0cbea9d100 | |||
e351c903a8 | |||
6e55f27b23 | |||
27fd9ec203 | |||
0ec2710872 | |||
3bcd02fc4e | |||
aa33850286 | |||
82fdc0bcd7 | |||
d695c9f8d2 | |||
b32132ad84 | |||
3126625461 | |||
ab307f82b1 | |||
0df2b836b1 | |||
6611aad840 | |||
8c4aaec167 | |||
b7053bdf80 | |||
b6b7be098a | |||
56f2a27f00 | |||
dcf469ebed | |||
d94b49febf | |||
3b4f1475df | |||
155154b43d | |||
a95b8d188c | |||
cb1fce6f99 | |||
0014f48079 | |||
fc35f271d7 | |||
65ad0e954d | |||
8cafade8b1 | |||
d13b708377 | |||
206597e5b8 | |||
c5458159d1 | |||
1476e899d1 | |||
797ab70e7c | |||
f81312aeb0 | |||
3ed5ea023e | |||
9291a7a7b4 | |||
5cfdc9b92d | |||
15b08d7ea8 | |||
acebe435ff | |||
5712b80022 | |||
d38583262e | |||
e0e2131981 | |||
7470bddd70 | |||
33d1fa2290 | |||
a4122b4eaa | |||
e6602d1bfa | |||
f8cf90a89e | |||
41505bde65 | |||
8ebc3bce92 | |||
45e9cdc591 | |||
3cbfc0e148 | |||
a47e9e1b1f | |||
e95d29c7c3 | |||
e954f04828 | |||
|
85c800f85b | ||
|
e0482244d7 | ||
27769f204f | |||
dfb24c65f3 | |||
0fe71572a5 | |||
db577bfef0 | |||
0805b96a75 | |||
e49823f5c4 | |||
76351005b4 | |||
3e5770f7de | |||
242ddec744 | |||
07654039b6 | |||
249926b8e0 | |||
ae47a978c1 | |||
|
bc53b0b332 | ||
d4175bcbda | |||
c9ba2e5962 | |||
2e49d86677 | |||
c393f86947 | |||
a0b96aa06c | |||
2dc16e8ea8 | |||
ee183886f6 | |||
cef6f681c8 | |||
ea9b489f5f | |||
1658432fd3 | |||
a8cd17748f | |||
580105e9f3 | |||
0626f6f775 | |||
12f5e479f3 | |||
04804b07c7 | |||
053418ee90 | |||
426628f268 | |||
d4ecaf65e5 | |||
27d114beef | |||
936de04cd3 | |||
b7c779eef6 | |||
d560c384f5 | |||
9ecd88870d | |||
07d1e82325 | |||
ce25cd0a31 | |||
319d9beef1 | |||
|
4272efe73b | ||
ed5cf0a8e4 | |||
c70e5b422c | |||
0bf2c8dc9d | |||
d563cec70d | |||
6ee4ef4b8b |
181
.all-contributorsrc
Normal file
@@ -0,0 +1,181 @@
|
||||
{
|
||||
"projectName": "antares",
|
||||
"projectOwner": "antares-sql",
|
||||
"repoType": "github",
|
||||
"repoHost": "https://github.com",
|
||||
"files": [
|
||||
"README.md"
|
||||
],
|
||||
"imageSize": 100,
|
||||
"commit": false,
|
||||
"commitConvention": "angular",
|
||||
"contributors": [
|
||||
{
|
||||
"login": "Fabio286",
|
||||
"name": "Fabio Di Stasio",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/31471771?v=4",
|
||||
"profile": "https://fabiodistasio.it/",
|
||||
"contributions": [
|
||||
"code",
|
||||
"translation",
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "toriphes",
|
||||
"name": "Giulio Ganci",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/4192159?v=4",
|
||||
"profile": "https://www.linkedin.com/in/giulioganci/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "digitalgopnik",
|
||||
"name": "Christian Ratz",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/2630316?v=4",
|
||||
"profile": "https://christianratz.de/",
|
||||
"contributions": [
|
||||
"code",
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "reverb6821",
|
||||
"name": "Giuseppe Gigliotti",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/55198803?v=4",
|
||||
"profile": "https://reverb6821.github.io/",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Mohd-PH",
|
||||
"name": "Mohd-PH",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9362157?v=4",
|
||||
"profile": "https://github.com/Mohd-PH",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "hongkfui",
|
||||
"name": "hongkfui",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/37477191?v=4",
|
||||
"profile": "https://github.com/hongkfui",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "MrAnyx",
|
||||
"name": "Robin",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/44176707?v=4",
|
||||
"profile": "https://github.com/MrAnyx",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "daeleduardo",
|
||||
"name": "Daniel Eduardo",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/8599078?v=4",
|
||||
"profile": "https://github.com/daeleduardo",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "datlechin",
|
||||
"name": "Ngô Quốc Đạt",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/56961917?v=4",
|
||||
"profile": "https://ngoquocdat.com/",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "IsamuSugi",
|
||||
"name": "Isamu Sugiura",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/7746658?v=4",
|
||||
"profile": "https://github.com/IsamuSugi",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Occhioverde",
|
||||
"name": "Riccardo Sacchetto",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/18429412?v=4",
|
||||
"profile": "http://rsacchetto.nexxontech.it/",
|
||||
"contributions": [
|
||||
"platform"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "kilianstallz",
|
||||
"name": "Kilian Stallinger",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5290318?v=4",
|
||||
"profile": "https://kilianstallinger.com",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "wenj91",
|
||||
"name": "文杰",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/12549338?v=4",
|
||||
"profile": "https://github.com/wenj91",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "goYou",
|
||||
"name": "goYou",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/62732795?v=4",
|
||||
"profile": "https://github.com/goYou",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "raliqala",
|
||||
"name": "Topollo",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/30502407?v=4",
|
||||
"profile": "https://github.com/raliqala",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "SmileYzn",
|
||||
"name": "Cleverson",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5851851?v=4",
|
||||
"profile": "https://github.com/SmileYzn",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "fredatgithub",
|
||||
"name": "fred",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/6720055?v=4",
|
||||
"profile": "https://github.com/fredatgithub",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "xak666",
|
||||
"name": "xaka_xak",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/38811437?v=4",
|
||||
"profile": "https://github.com/xak666",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
"skipCi": true
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
/node_modules
|
||||
/assets/vendor
|
||||
/out
|
||||
/dist
|
||||
node_modules
|
||||
assets
|
||||
out
|
||||
dist
|
||||
build
|
71
.eslintrc
@@ -6,25 +6,36 @@
|
||||
},
|
||||
"extends": [
|
||||
"standard",
|
||||
"plugin:vue/recommended"
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:vue/vue3-recommended"
|
||||
],
|
||||
"parser": "vue-eslint-parser",
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint",
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"ecmaVersion": 9,
|
||||
"sourceType": "module"
|
||||
"sourceType": "module",
|
||||
"requireConfigFile": false
|
||||
},
|
||||
"plugins": [
|
||||
"vue",
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"space-infix-ops": "off",
|
||||
"object-curly-newline": "off",
|
||||
"indent": [
|
||||
"error",
|
||||
3,
|
||||
{ "SwitchCase": 1 }
|
||||
{
|
||||
"SwitchCase": 1
|
||||
}
|
||||
],
|
||||
"linebreak-style": [
|
||||
"error",
|
||||
"unix"
|
||||
],
|
||||
"brace-style": [
|
||||
"error",
|
||||
"error",
|
||||
"stroustrup"
|
||||
],
|
||||
"quotes": [
|
||||
@@ -36,26 +47,50 @@
|
||||
"always"
|
||||
],
|
||||
"curly": [
|
||||
"error",
|
||||
"error",
|
||||
"multi-or-nest"
|
||||
],
|
||||
"no-console": "off",
|
||||
"no-undef": "off",
|
||||
"vue/no-side-effects-in-computed-properties": "off",
|
||||
"vue/multi-word-component-names": "off",
|
||||
"vue/require-default-prop": "off",
|
||||
"vue/comment-directive": "off",
|
||||
"vue/no-v-html": "off",
|
||||
"vue/html-indent": ["error", 3, {
|
||||
"attribute": 1,
|
||||
"baseIndent": 1,
|
||||
"closeBracket": 0,
|
||||
"ignores": []
|
||||
}],
|
||||
"vue/max-attributes-per-line": ["error", {
|
||||
"singleline": 2,
|
||||
"multiline": {
|
||||
"max": 1,
|
||||
"allowFirstLine": false
|
||||
"vue/html-indent": [
|
||||
"error",
|
||||
3,
|
||||
{
|
||||
"attribute": 1,
|
||||
"baseIndent": 1,
|
||||
"closeBracket": 0,
|
||||
"ignores": []
|
||||
}
|
||||
}]
|
||||
],
|
||||
"vue/max-attributes-per-line": [
|
||||
"error",
|
||||
{
|
||||
"singleline": {
|
||||
"max": 2
|
||||
},
|
||||
"multiline": {
|
||||
"max": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/member-delimiter-style": [
|
||||
"warn",
|
||||
{
|
||||
"multiline": {
|
||||
"delimiter": "semi",
|
||||
"requireLast": true
|
||||
},
|
||||
"singleline": {
|
||||
"delimiter": "semi",
|
||||
"requireLast": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-var-requires": "off"
|
||||
}
|
||||
}
|
6
.gitattributes
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
* text eol=lf
|
||||
*.jpg binary
|
||||
*.png binary
|
||||
*.gif binary
|
||||
*.ico binary
|
||||
*.icns binary
|
2
.github/FUNDING.yml
vendored
@@ -1,7 +1,7 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [fabio286]
|
||||
patreon: fabio286
|
||||
patreon: #fabio286
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
|
23
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -3,7 +3,7 @@ name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
assignees: Fabio286
|
||||
|
||||
---
|
||||
|
||||
@@ -12,6 +12,7 @@ A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
@@ -23,16 +24,18 @@ A clear and concise description of what you expected to happen.
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
**Application (please complete the following information):**
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
- App client [e.g. MySQL]
|
||||
- App version [e.g. 0.5.2]
|
||||
- Installation source: [e.g. exe, Linux Store, AppImage, dmg]
|
||||
|
||||
**Environment (please complete the following information):**
|
||||
|
||||
- OS name: [e.g. Windows 11]
|
||||
- OS version [e.g. 21H2]
|
||||
- DB name [e.g. MariaDB]
|
||||
- DB version [e.g. 10.3.34]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
|
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -3,7 +3,7 @@ name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
assignees: Fabio286
|
||||
|
||||
---
|
||||
|
||||
|
4
.github/dependabot.yml
vendored
@@ -6,6 +6,8 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "npm"
|
||||
allow:
|
||||
- dependency-type: "production"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
interval: "monthly"
|
||||
|
37
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Build & release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm i
|
||||
|
||||
- name: "Build"
|
||||
run: npm run build
|
||||
|
||||
- name: Release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "build/*.AppImage,build/*.yml,build/*.deb,build/*.dmg,build/*.blockmap,build/*.zip,build/*.exe"
|
||||
allowUpdates: true
|
||||
draft: true
|
||||
generateReleaseNotes: true
|
5
.github/workflows/codeql-analysis.yml
vendored
@@ -31,11 +31,6 @@ jobs:
|
||||
# a pull request then we can checkout the head.
|
||||
fetch-depth: 2
|
||||
|
||||
# If this run was triggered by a pull request event, then checkout
|
||||
# the head of the pull request instead of the merge commit.
|
||||
- run: git checkout HEAD^2
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
|
31
.github/workflows/create-artifact-linux.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Create artifact [LINUX]
|
||||
|
||||
on:
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: npm install & build
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: linux-build
|
||||
retention-days: 3
|
||||
path: |
|
||||
build
|
||||
!build/*-unpacked
|
||||
!build/.icon-ico
|
31
.github/workflows/create-artifact-macos.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Create artifact [MAC]
|
||||
|
||||
on:
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: npm install & build
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: macos-build
|
||||
retention-days: 3
|
||||
path: |
|
||||
build
|
||||
!build/*-unpacked
|
||||
!build/.icon-ico
|
26
.github/workflows/test-e2e-linux.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Test end-to-end [LINUX]
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm i
|
||||
|
||||
- name: Run tests
|
||||
run: npm run test:e2e
|
13
.gitignore
vendored
@@ -1,9 +1,10 @@
|
||||
.DS_Store
|
||||
dist/
|
||||
node_modules/
|
||||
dist
|
||||
build
|
||||
misc/*
|
||||
!misc/.gitkeep
|
||||
node_modules
|
||||
thumbs.db
|
||||
.idea/
|
||||
.vscode
|
||||
TODO.md
|
||||
NOTES.md
|
||||
*.txt
|
||||
package-lock.json
|
||||
*.heapsnapshot
|
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": [
|
||||
"stylelint-config-standard"
|
||||
"stylelint-config-standard",
|
||||
"stylelint-config-recommended-vue"
|
||||
],
|
||||
"fix": true,
|
||||
"formatter": "verbose",
|
||||
@@ -8,7 +9,10 @@
|
||||
"stylelint-scss"
|
||||
],
|
||||
"rules": {
|
||||
"at-rule-no-unknown": null
|
||||
"at-rule-no-unknown": null,
|
||||
"no-descending-specificity": null,
|
||||
"font-family-no-missing-generic-family-keyword": null,
|
||||
"declaration-colon-newline-after": "always-multi-line"
|
||||
},
|
||||
"syntax": "scss"
|
||||
}
|
38
.travis.yml
@@ -1,38 +0,0 @@
|
||||
language: node_js
|
||||
node_js: 12
|
||||
|
||||
before_install:
|
||||
- npm install
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
- app/node_modules
|
||||
- $HOME/.cache/electron
|
||||
- $HOME/.cache/electron-builder
|
||||
- $HOME/.npm/_prebuilds
|
||||
|
||||
env:
|
||||
global:
|
||||
- ELECTRON_CACHE=$HOME/.cache/electron
|
||||
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- stage: Test
|
||||
script:
|
||||
- npm test
|
||||
- stage: Deploy Linux & Windows
|
||||
if: tag IS present
|
||||
os: linux
|
||||
services: docker
|
||||
script:
|
||||
- docker run --rm --env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|NPM_|CI|CIRCLE|TRAVIS|APPVEYOR_|CSC_|_TOKEN|_KEY|AWS_|STRIP|BUILD_') -v ${PWD}:/project -v ~/.cache/electron:/root/.cache/electron -v ~/.cache/electron-builder:/root/.cache/electron-builder electronuserland/builder:wine /bin/bash -c "npm run build -- --linux --win -p always"
|
||||
before_cache:
|
||||
- rm -rf $HOME/.cache/electron-builder/wine
|
||||
- stage: Deploy Mac
|
||||
if: tag IS present
|
||||
os: osx
|
||||
osx_image: xcode10.2
|
||||
script:
|
||||
- npm run build -- -p always
|
7
.versionrc.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"types": [
|
||||
{"type":"feat","section":"Features"},
|
||||
{"type":"perf","section":"Improvements"},
|
||||
{"type":"fix","section":"Bug Fixes"}
|
||||
]
|
||||
}
|
39
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Electron: Main",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"port": 9222,
|
||||
"protocol": "inspector",
|
||||
"request": "attach",
|
||||
"sourceMaps": true,
|
||||
"type": "node",
|
||||
"timeout": 1000000
|
||||
},
|
||||
{
|
||||
"name": "Electron: Renderer",
|
||||
"port": 9223,
|
||||
"request": "attach",
|
||||
"sourceMaps": true,
|
||||
"type": "chrome",
|
||||
"webRoot": "${workspaceFolder}"
|
||||
},
|
||||
{
|
||||
"name": "Electron: Worker",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"port": 9224,
|
||||
"protocol": "inspector",
|
||||
"request": "attach",
|
||||
"sourceMaps": true,
|
||||
"type": "node",
|
||||
"timeout": 1000000
|
||||
}
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
"name": "Electron: All",
|
||||
"configurations": ["Electron: Main", "Electron: Renderer"]
|
||||
}
|
||||
]
|
||||
}
|
14
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"conventionalCommits.scopes": [
|
||||
"UI",
|
||||
"core",
|
||||
"MySQL",
|
||||
"PostgreSQL",
|
||||
"SQLite",
|
||||
"Windows",
|
||||
"translation",
|
||||
"Linux",
|
||||
"MacOS"
|
||||
],
|
||||
"svg.preview.background": "transparent"
|
||||
}
|
1326
CHANGELOG.md
133
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,133 @@
|
||||
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, caste, color, religion, or sexual
|
||||
identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall
|
||||
community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of
|
||||
any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email address,
|
||||
without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
fabio286@gmail.com.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series of
|
||||
actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or permanent
|
||||
ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within the
|
||||
community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.1, available at
|
||||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||
|
||||
Community Impact Guidelines were inspired by
|
||||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
||||
[https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
100
CONTRIBUTING.md
Normal file
@@ -0,0 +1,100 @@
|
||||
# Contributors Guide
|
||||
|
||||
Antares SQL is an application based on [Electron.js](https://www.electronjs.org/) that uses [Vue.js](https://vuejs.org/) and [Spectre.css](https://picturepan2.github.io/spectre/) as frontend frameworks.
|
||||
For the build process it takes advantage of [electron-builder](https://www.electron.build/).
|
||||
This application uses [Pinia🍍](https://pinia.vuejs.org/) as application state manager and [electron-store](https://github.com/sindresorhus/electron-store) to save the various settings on disc.
|
||||
This guide aims to provide useful information and guidelines to everyone wants to contribute with this open-source project.
|
||||
For every other question related to this project please [contact me](https://github.com/Fabio286).
|
||||
|
||||
## Project Structure
|
||||
|
||||
The main files of the application are located inside `src` folder and are groupped in three subfolders.
|
||||
|
||||
### `common`
|
||||
|
||||
This folder contains small libraries, classes and objects. The purpose of `common` folder is to group together utilities used by **renderer** and **main** processes.
|
||||
Noteworthy is the `customizations` folder that contains clients related customizations. Those settings are merged with `default.js` that lists every option.
|
||||
Client related customizations are stored on Pinia and can be accessed by `customizations` property of current workspace object, or importing `common/customizations`.
|
||||
|
||||
An use case of customizations object can be the following:
|
||||
|
||||
```js
|
||||
computed: {
|
||||
defaultEngine () {
|
||||
if (this.workspace.customizations.engines)
|
||||
return this.workspace.engines.find(engine => engine.isDefault).name;
|
||||
return '';
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In this case the computed property `defaultEngine` returns the default engine for MySQL client, or an empty string with PostgreSQL that doesn't have engines.
|
||||
Customization properties are also useful **if some features are ready for one client but not others**.
|
||||
|
||||
### `main`
|
||||
|
||||
Inside this folder are located all files required by main process.
|
||||
`ipc-handlers` subfolder includes all IPC handlers for events sent from renderer process.
|
||||
`libs` subfolder includes classes related to clients and **query and connection logics**.
|
||||
**Everything above client's class level should be "client agnostic"** with a neutral and uniformed api interface
|
||||
|
||||
### `renderer`
|
||||
|
||||
In this folder is located the structure of Vue frontend application.
|
||||
|
||||
## Build
|
||||
|
||||
The command to build Antares SQL locally is `npm run build`.
|
||||
|
||||
## Conventions
|
||||
|
||||
### Electron
|
||||
|
||||
- **kebab-case** for IPC event names.
|
||||
|
||||
### Vue
|
||||
|
||||
- **PascalCase** for file names (with .vue extension) and including components inside others (`<MyComponent/>`).
|
||||
- "**Base**" prefix for [base component names](https://vuejs.org/v2/style-guide/#Base-component-names-strongly-recommended).
|
||||
- "**The**" prefix for [single-instance component names](https://vuejs.org/v2/style-guide/#Single-instance-component-names-strongly-recommended).
|
||||
- [Tightly coupled component names](https://vuejs.org/v2/style-guide/#Tightly-coupled-component-names-strongly-recommended).
|
||||
- [Order of words in component names](https://vuejs.org/v2/style-guide/#Order-of-words-in-component-names-strongly-recommended).
|
||||
- **kebab-case** in templates for property and event names.
|
||||
|
||||
### Code Style
|
||||
|
||||
The project includes [ESlint](https://eslint.org/) and [StyleLint](https://stylelint.io/) config files with style rules. I recommend to set the lint on-save option in your code editor.
|
||||
Alternatively you can launch following commands to lint the project.
|
||||
|
||||
Check if all the style rules have been followed:
|
||||
|
||||
```console
|
||||
npm run lint
|
||||
```
|
||||
|
||||
Apply style rules globally if possible:
|
||||
|
||||
```console
|
||||
npm run lint:fix
|
||||
```
|
||||
|
||||
### Other recommendations
|
||||
|
||||
Please, use if possible **template literals** to compose strings and **avoid unnecessary dependencies**.
|
||||
|
||||
### Commits
|
||||
|
||||
The commit style adopted for this project is [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
|
||||
Basicly it's important to have **single scoped commits with a prefix** that follows this style because Antares SQL uses [standard-version](https://github.com/conventional-changelog/standard-version) to generate new releases and [CHANGELOG.md](https://github.com/Fabio286/antares/blob/master/CHANGELOG.md) file to track all notable changes.
|
||||
For Visual Studio Code users may be useful [Conventional Commits](https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits) extension.
|
||||
|
||||
## Debug
|
||||
|
||||
**Debug mode**:
|
||||
|
||||
```console
|
||||
npm run debug
|
||||
```
|
||||
|
||||
After running the debug mode Antares will listen on port 9222 (main process) for a debugger.
|
||||
On **Visual Studio Code** just launch "*Electron: Main*" configurations after running Antares in debug mode.
|
144
README.md
@@ -1,76 +1,150 @@
|
||||
|
||||
<!-- markdownlint-disable -->
|
||||
<p align="center">
|
||||
<img width="800" src="https://raw.githubusercontent.com/Fabio286/antares/master/docs/screen-alpha.png">
|
||||
<img width="800" src="https://raw.githubusercontent.com/Fabio286/antares/master/docs/gh-logo.png">
|
||||
</p>
|
||||
<!-- markdownlint-restore -->
|
||||
|
||||
# Antares SQL Client
|
||||
|
||||
 [](https://travis-ci.com/EStarium/antares)  
|
||||
  [](https://actions-badge.atrox.dev/fabio286/antares/goto) [](https://snapcraft.io/antares) [](https://snapcraft.io/antares) [](https://twitter.com/AntaresSQL) [](https://www.treedom.net/en/user/fabio-di-stasio/event/antares-for-the-planet)
|
||||
|
||||
Antares is an SQL client based on [Electron.js](https://github.com/electron/electron) and [Vue.js](https://github.com/vuejs/vue) that aims to become a useful tool, especially for developers.
|
||||
My target is to support as many databases as possible, and all major operating systems, including the ARM versions.
|
||||
Our target is to support as many databases as possible, and all major operating systems, including the ARM versions.
|
||||
|
||||
**At the moment this application is an alpha, it lacks many features, and isn't ready as a main SQL client**. However i'm actively working on it, hoping to provide all essential features as soon as possible.
|
||||
**At the moment this application is in development state, many features will come in future updates**, and supports only MySQL/MariaDB, PostgreSQL and SQLite.
|
||||
However, there are all the features necessary to have a pleasant database management experience, so give it a chance and send us your feedback, we would really appreciate it.
|
||||
We are actively working on it, hoping to provide new cool features, improvements and fixes as soon as possible.
|
||||
|
||||
🔗 If you are curious to try this early state of Antares you can download and install the [latest release](https://github.com/EStarium/antares/releases).
|
||||
👁 To stay tuned for new releases watch this repo on **Release only** channel.
|
||||
🌟 Don't forget to **leave a star** if you appreciate this project.
|
||||
🔗 If you are curious to try Antares you can download and install the [latest release](https://github.com/Fabio286/antares/releases/latest).
|
||||
👁 To stay tuned for new releases [follow Antares SQL](https://twitter.com/AntaresSQL) on Twitter.
|
||||
🌟 Don't forget to **leave a star** if you appreciate this project.
|
||||
🗳️ Poll: **[Which is the main OS you use Antares on?](https://github.com/antares-sql/antares/discussions/379)**
|
||||
|
||||
## Current key features
|
||||
|
||||
- Multiple database connections at same time.
|
||||
- Database management (add/edit/delete).
|
||||
- Full tables management, including indexes and foreign keys.
|
||||
- Views, triggers, stored routines, functions and schedulers management (add/edit/delete).
|
||||
- A modern and friendly tab system; keep open every kind of tab you need in your workspace.
|
||||
- Fake table data filler to generate tons of data for test purpose.
|
||||
- Query suggestions and auto complete.
|
||||
- Query history: search through the last 1000 queries.
|
||||
- SSH tunnel support.
|
||||
- Manual commit mode.
|
||||
- Import and export database dumps.
|
||||
- Customizable keyboard shortcuts.
|
||||
- Dark and light theme.
|
||||
- Editor themes.
|
||||
|
||||
## Philosophy
|
||||
|
||||
Why am I developing an SQL client when there are a lot of them on the market?
|
||||
The main goal is to develop a totally free, cross platform and open source alternative, empowered by JavaScript's ecosystem.
|
||||
An application created with minimalism and semplicity in mind, with features in the right places, not hundreds of tiny buttons or submenu.
|
||||
Why are we developing an SQL client when there are a lot of them on the market?
|
||||
The main goal is to develop a **forever 100% free (without paid premium feature)**, full featured, as possible community driven, cross platform and open source alternative, empowered by JavaScript ecosystem.
|
||||
A modern application created with minimalism and simplicity in mind, with features in the right places, not hundreds of tiny buttons, nested tabs or submenues; productivity comes first.
|
||||
|
||||
## How to contribute
|
||||
## Installation
|
||||
|
||||
- [Translate Antares](https://github.com/EStarium/antares/wiki/Translate-Antares)
|
||||
Based on your operating system you can have one or more distribution formats to choose based on your preferences.
|
||||
Since Antares SQL is a free software we don't have a budget to spend on annual licenses or certificates. This can result that on some platforms you might need to put in some additional work to install this app.
|
||||
|
||||
## Roadmap
|
||||
### Linux
|
||||
|
||||
On Linux you can simply download and run the `.AppImage` distribution, install from Snap Store, from AUR or from our [PPA repository](https://github.com/antares-sql/antares-ppa).
|
||||
|
||||
### Windows
|
||||
|
||||
On Windows you can choose between downloading the app from Microsoft Store or downloading the `.exe` from our [website](https://antares-sql.app/downloads) or [this github repo](https://github.com/Fabio286/antares/releases/latest). Distributions that are not from Microsoft Store are not signed with a certificate, so to install you need to click on "More info" and then "Run anyway" on SmartScreen prompt.
|
||||
|
||||
### MacOS
|
||||
|
||||
On macOS you can run `.dmg` distribution following [this guide](https://support.apple.com/guide/mac-help/mh40616/mac) to install apps from unknown developers.
|
||||
|
||||
## Download
|
||||
|
||||
[](https://snapcraft.io/antares) [](https://aur.archlinux.org/packages/antares-sql/) [<img src="https://developer.microsoft.com/store/badges/images/English_get-it-from-MS.png" style="height: 56px">](https://www.microsoft.com/p/antares-sql-client/9nhtb9sq51r1?cid=storebadge&ocid=badge&rtc=1&activetab=pivot:overviewtab)
|
||||
🚀 **[Other Downloads](https://github.com/Fabio286/antares/releases/latest)**
|
||||
|
||||
## Coming soon
|
||||
|
||||
This is a roadmap with major features will come in near future.
|
||||
|
||||
- Improvements of query editor area.
|
||||
- Database management (add/edit/delete).
|
||||
- Tables management (add/edit/delete).
|
||||
- Users management (add/edit/delete).
|
||||
- Stored procedures, views, schedulers and trigger support.
|
||||
- Database tools.
|
||||
- Context menu shortcuts.
|
||||
- Keyboard shortcuts.
|
||||
- More secure password storage.
|
||||
- Query logs console.
|
||||
- Fake data filler.
|
||||
- Import/export and migration.
|
||||
- SSH tunnel.
|
||||
- Themes.
|
||||
- Users management (add/edit/delete).
|
||||
- More context menu shortcuts.
|
||||
- More keyboard shortcuts.
|
||||
- Support for other databases.
|
||||
- Apple Silicon distribution
|
||||
|
||||
## Currently supported
|
||||
|
||||
### Databases
|
||||
|
||||
- [x] MySQL/MariaDB
|
||||
- [ ] PostrgreSQL
|
||||
- [x] PostgreSQL
|
||||
- [x] SQLite
|
||||
- [ ] MSSQL
|
||||
- [ ] SQLite
|
||||
- [ ] OracleDB
|
||||
- [ ] More...
|
||||
|
||||
### Operating Systems
|
||||
|
||||
#### • x86
|
||||
#### • x64
|
||||
|
||||
- [x] Windows
|
||||
- [x] Linux
|
||||
- [x] MacOS (needs tests)
|
||||
- [x] MacOS
|
||||
|
||||
#### • ARM
|
||||
|
||||
- [ ] Windows
|
||||
- [ ] Linux
|
||||
- [x] Linux
|
||||
- [ ] MacOS
|
||||
|
||||
## Translations
|
||||
## How to contribute
|
||||
|
||||
[Giuseppe Gigliotti](https://github.com/ReverbOD) / [Italian Translation](https://github.com/EStarium/antares/pull/20)
|
||||
[Mohd-PH](https://github.com/Mohd-PH) / [Arabic Translation](https://github.com/EStarium/antares/pull/29)
|
||||
[hongkfui](https://github.com/hongkfui) / [Spanish Translation](https://github.com/EStarium/antares/pull/32)
|
||||
- 🌍 [Translate Antares](https://github.com/Fabio286/antares/wiki/Translate-Antares)
|
||||
- 📖 [Contributors Guide](https://github.com/Fabio286/antares/wiki/Contributors-Guide)
|
||||
- 🚧 [Project Board](https://github.com/antares-sql/antares/projects/1)
|
||||
|
||||
## Contributors ✨
|
||||
|
||||
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><a href="https://fabiodistasio.it/"><img src="https://avatars.githubusercontent.com/u/31471771?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Fabio Di Stasio</b></sub></a><br /><a href="https://github.com/antares-sql/antares/commits?author=Fabio286" title="Code">💻</a> <a href="#translation-Fabio286" title="Translation">🌍</a> <a href="https://github.com/antares-sql/antares/commits?author=Fabio286" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://www.linkedin.com/in/giulioganci/"><img src="https://avatars.githubusercontent.com/u/4192159?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Giulio Ganci</b></sub></a><br /><a href="https://github.com/antares-sql/antares/commits?author=toriphes" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://christianratz.de/"><img src="https://avatars.githubusercontent.com/u/2630316?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Christian Ratz</b></sub></a><br /><a href="https://github.com/antares-sql/antares/commits?author=digitalgopnik" title="Code">💻</a> <a href="#translation-digitalgopnik" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://reverb6821.github.io/"><img src="https://avatars.githubusercontent.com/u/55198803?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Giuseppe Gigliotti</b></sub></a><br /><a href="#translation-reverb6821" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/Mohd-PH"><img src="https://avatars.githubusercontent.com/u/9362157?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mohd-PH</b></sub></a><br /><a href="#translation-Mohd-PH" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/hongkfui"><img src="https://avatars.githubusercontent.com/u/37477191?v=4?s=100" width="100px;" alt=""/><br /><sub><b>hongkfui</b></sub></a><br /><a href="#translation-hongkfui" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/MrAnyx"><img src="https://avatars.githubusercontent.com/u/44176707?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Robin</b></sub></a><br /><a href="#translation-MrAnyx" title="Translation">🌍</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/daeleduardo"><img src="https://avatars.githubusercontent.com/u/8599078?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Daniel Eduardo</b></sub></a><br /><a href="#translation-daeleduardo" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://ngoquocdat.com/"><img src="https://avatars.githubusercontent.com/u/56961917?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ngô Quốc Đạt</b></sub></a><br /><a href="#translation-datlechin" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/IsamuSugi"><img src="https://avatars.githubusercontent.com/u/7746658?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Isamu Sugiura</b></sub></a><br /><a href="#translation-IsamuSugi" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="http://rsacchetto.nexxontech.it/"><img src="https://avatars.githubusercontent.com/u/18429412?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Riccardo Sacchetto</b></sub></a><br /><a href="#platform-Occhioverde" title="Packaging/porting to new platform">📦</a></td>
|
||||
<td align="center"><a href="https://kilianstallinger.com"><img src="https://avatars.githubusercontent.com/u/5290318?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kilian Stallinger</b></sub></a><br /><a href="https://github.com/antares-sql/antares/commits?author=kilianstallz" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/wenj91"><img src="https://avatars.githubusercontent.com/u/12549338?v=4?s=100" width="100px;" alt=""/><br /><sub><b>文杰</b></sub></a><br /><a href="https://github.com/antares-sql/antares/commits?author=wenj91" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/goYou"><img src="https://avatars.githubusercontent.com/u/62732795?v=4?s=100" width="100px;" alt=""/><br /><sub><b>goYou</b></sub></a><br /><a href="#translation-goYou" title="Translation">🌍</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/raliqala"><img src="https://avatars.githubusercontent.com/u/30502407?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Topollo</b></sub></a><br /><a href="https://github.com/antares-sql/antares/commits?author=raliqala" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/SmileYzn"><img src="https://avatars.githubusercontent.com/u/5851851?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Cleverson</b></sub></a><br /><a href="#translation-SmileYzn" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/fredatgithub"><img src="https://avatars.githubusercontent.com/u/6720055?v=4?s=100" width="100px;" alt=""/><br /><sub><b>fred</b></sub></a><br /><a href="#translation-fredatgithub" title="Translation">🌍</a></td>
|
||||
<td align="center"><a href="https://github.com/xak666"><img src="https://avatars.githubusercontent.com/u/38811437?v=4?s=100" width="100px;" alt=""/><br /><sub><b>xaka_xak</b></sub></a><br /><a href="#translation-xak666" title="Translation">🌍</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
||||
|
BIN
assets/appx/Square150x150Logo.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
assets/appx/Square44x44Logo.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
assets/appx/Square44x44Logo.targetsize-256_altform-unplated.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
assets/appx/StoreLogo.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
assets/appx/Wide310x150Logo.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
assets/icon.icns
Normal file
BIN
assets/icon.ico
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
assets/linux/128x128.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
assets/linux/16x16.png
Normal file
After Width: | Height: | Size: 889 B |
BIN
assets/linux/256x256.png
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
assets/linux/32x32.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
assets/linux/64x64.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
build/icon.icns
BIN
build/icon.ico
Before Width: | Height: | Size: 12 KiB |
77
docs/aur-badge.svg
Normal file
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Gravit.io --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
style="isolation:isolate" viewBox="0 0 182 56" width="182px" height="56px">
|
||||
<defs>
|
||||
<clipPath id="_clipPath_tR1uglJ1Zei76xP861DY1TsjAiQWS9qF">
|
||||
<rect width="182" height="56" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g clip-path="url(#_clipPath_tR1uglJ1Zei76xP861DY1TsjAiQWS9qF)">
|
||||
<path
|
||||
d="M 2.5 0.5 L 180.5 0.5 C 181.604 0.5 182.5 1.396 182.5 2.5 L 182.5 54.5 C 182.5 55.604 181.604 56.5 180.5 56.5 L 2.5 56.5 C 1.396 56.5 0.5 55.604 0.5 54.5 L 0.5 2.5 C 0.5 1.396 1.396 0.5 2.5 0.5 Z"
|
||||
style="stroke:none;fill:#252525;stroke-miterlimit:10;" />
|
||||
<path
|
||||
d="M 2.5 0.5 L 180.5 0.5 C 181.604 0.5 182.5 1.396 182.5 2.5 L 182.5 54.5 C 182.5 55.604 181.604 56.5 180.5 56.5 L 2.5 56.5 C 1.396 56.5 0.5 55.604 0.5 54.5 L 0.5 2.5 C 0.5 1.396 1.396 0.5 2.5 0.5 Z"
|
||||
style="fill:none;stroke:#CDCDCD;stroke-width:1;stroke-miterlimit:2;" />
|
||||
<g>
|
||||
<g>
|
||||
<path
|
||||
d=" M 60.898 13.777 C 58.555 13.774 56.61 14.254 55.858 14.516 L 55.083 18.697 C 55.081 18.712 58.937 17.669 60.635 17.73 C 63.447 17.831 63.706 18.805 63.656 20.119 C 63.704 20.196 62.931 18.931 60.498 18.889 C 57.43 18.836 53.098 19.976 53.104 24.608 C 53.022 29.818 56.997 31.351 59.704 31.379 C 62.138 31.335 63.279 30.458 63.904 29.988 C 64.726 29.129 65.665 28.265 66.561 27.229 C 65.714 28.77 64.978 29.835 64.213 30.651 L 64.213 31.339 L 67.913 30.716 L 67.938 20.66 C 67.901 19.237 68.754 13.791 60.898 13.777 Z M 60.367 22.533 C 61.9 22.554 63.659 23.31 63.662 25.129 C 63.669 26.784 61.589 27.674 60.235 27.66 C 58.881 27.646 57.085 26.596 57.077 24.982 C 57.103 23.54 58.771 22.496 60.367 22.533 Z "
|
||||
fill-rule="evenodd" fill="rgb(255,255,255)" />
|
||||
<path
|
||||
d=" M 70.378 14.707 L 70.352 31.36 L 74.662 30.529 L 74.67 21.087 C 74.671 19.681 76.679 18.039 79.198 18.065 C 79.733 17.097 80.738 14.625 80.983 14.062 C 75.354 14.049 75.282 15.68 74.303 16.483 C 74.293 14.952 74.3 14.033 74.3 14.033 L 70.378 14.707 L 70.378 14.707 Z "
|
||||
fill-rule="evenodd" fill="rgb(255,255,255)" />
|
||||
<path
|
||||
d=" M 94.632 16.893 C 94.591 16.873 92.385 14.312 87.949 14.292 C 83.795 14.223 79.135 15.834 79.061 22.8 C 79.097 28.925 83.537 31.318 87.973 31.365 C 92.72 31.414 94.609 28.396 94.722 28.322 C 94.156 27.83 92.034 25.728 92.034 25.728 C 92.034 25.728 90.709 27.615 88.138 27.639 C 85.566 27.664 83.331 25.651 83.299 22.844 C 83.266 20.036 85.354 18.515 88.157 18.392 C 90.584 18.392 91.984 19.959 91.984 19.959 L 94.632 16.893 L 94.632 16.893 Z "
|
||||
fill-rule="evenodd" fill="rgb(255,255,255)" />
|
||||
<path
|
||||
d=" M 100.065 8.879 L 95.996 9.835 L 96.026 31.526 L 100.034 30.802 L 100.08 20.595 C 100.089 19.524 101.628 17.88 104.2 17.933 C 106.658 17.958 107.207 19.571 107.201 19.775 L 107.272 31.592 L 111.224 30.894 L 111.239 18.363 C 111.265 17.157 108.598 14.61 104.311 14.592 C 102.273 14.596 101.145 15.057 100.571 15.397 C 99.588 16.156 98.466 16.883 97.362 17.811 C 98.382 16.501 99.239 15.595 100.075 14.921 L 100.065 8.879 L 100.065 8.879 Z "
|
||||
fill-rule="evenodd" fill="rgb(255,255,255)" />
|
||||
</g>
|
||||
<g>
|
||||
<path
|
||||
d=" M 114.673 9.441 L 116.508 8.982 L 116.595 30.85 L 114.73 31.168 L 114.673 9.441 L 114.673 9.441 Z "
|
||||
fill-rule="evenodd" fill="rgb(23,147,209)" />
|
||||
<path
|
||||
d=" M 119.663 15.968 L 121.271 15.252 L 121.285 30.932 L 119.731 31.253 L 119.663 15.968 L 119.663 15.968 Z M 119.28 10.314 L 120.577 9.255 L 121.655 10.454 L 120.357 11.54 L 119.28 10.314 L 119.28 10.314 Z "
|
||||
fill-rule="evenodd" fill="rgb(23,147,209)" />
|
||||
<path
|
||||
d=" M 124.296 15.682 L 126.131 15.308 L 126.14 18.586 C 126.14 18.727 127.148 14.924 132.008 15.009 C 136.727 15.035 137.499 18.688 137.473 19.507 L 137.531 31.034 L 135.922 31.384 L 135.913 19.998 C 135.932 19.665 135.178 16.853 131.843 16.843 C 128.509 16.833 126.199 19.265 126.203 20.818 L 126.229 30.848 L 124.365 31.335 L 124.296 15.682 L 124.296 15.682 Z "
|
||||
fill-rule="evenodd" fill="rgb(23,147,209)" />
|
||||
<path
|
||||
d=" M 153.547 31.117 L 151.711 31.492 L 151.703 28.214 C 151.703 28.073 150.694 31.876 145.835 31.791 C 141.116 31.765 140.344 28.112 140.37 27.293 L 140.311 15.765 L 142.261 15.372 L 142.292 26.758 C 142.292 27.069 142.665 29.947 145.999 29.957 C 149.334 29.967 151.669 27.949 151.686 24.911 L 151.662 15.928 L 153.477 15.464 L 153.547 31.117 L 153.547 31.117 Z "
|
||||
fill-rule="evenodd" fill="rgb(23,147,209)" />
|
||||
<path
|
||||
d=" M 157.144 15.553 L 155.857 16.56 L 160.792 23.018 L 155.529 30.478 L 156.894 31.492 L 161.841 24.563 L 166.948 31.656 L 168.211 30.649 L 162.738 23.065 L 167.104 16.933 L 165.762 15.797 L 161.785 21.472 L 157.144 15.553 L 157.144 15.553 Z "
|
||||
fill-rule="evenodd" fill="rgb(23,147,209)" />
|
||||
</g>
|
||||
<path
|
||||
d=" M 33.112 3.879 C 30.965 9.143 29.67 12.587 27.279 17.695 C 28.745 19.248 30.544 21.058 33.466 23.101 C 30.325 21.809 28.182 20.511 26.581 19.164 C 23.521 25.549 18.728 34.643 9 52.121 C 16.645 47.707 22.572 44.986 28.095 43.948 C 27.858 42.928 27.723 41.824 27.733 40.673 L 27.742 40.428 C 27.863 35.53 30.411 31.763 33.43 32.019 C 36.448 32.274 38.794 36.455 38.673 41.353 C 38.65 42.275 38.546 43.162 38.364 43.984 C 43.828 45.053 49.691 47.767 57.233 52.121 C 55.746 49.383 54.419 46.915 53.151 44.565 C 51.154 43.017 49.072 41.003 44.823 38.822 C 47.743 39.581 49.834 40.456 51.464 41.435 C 38.575 17.439 37.532 14.251 33.112 3.879 Z "
|
||||
fill-rule="evenodd" fill="rgb(23,147,209)" />
|
||||
<g>
|
||||
<path
|
||||
d=" M 170.614 30.156 L 170.614 28.802 L 170.109 28.802 L 170.109 28.621 L 171.325 28.621 L 171.325 28.802 L 170.817 28.802 L 170.817 30.156 L 170.614 30.156 Z "
|
||||
fill="rgb(23,147,209)" />
|
||||
<path
|
||||
d=" M 171.536 30.156 L 171.536 28.621 L 171.842 28.621 L 172.205 29.708 C 172.238 29.809 172.263 29.884 172.278 29.935 C 172.295 29.879 172.323 29.797 172.36 29.689 L 172.727 28.621 L 173 28.621 L 173 30.156 L 172.804 30.156 L 172.804 28.871 L 172.358 30.156 L 172.175 30.156 L 171.732 28.849 L 171.732 30.156 L 171.536 30.156 Z "
|
||||
fill="rgb(23,147,209)" />
|
||||
</g>
|
||||
<g>
|
||||
<path
|
||||
d=" M 57.471 47.815 L 57.471 46.493 L 56.977 46.493 L 56.977 46.316 L 58.166 46.316 L 58.166 46.493 L 57.67 46.493 L 57.67 47.815 L 57.471 47.815 Z "
|
||||
fill="rgb(23,147,209)" />
|
||||
<path
|
||||
d=" M 58.372 47.815 L 58.372 46.316 L 58.671 46.316 L 59.026 47.377 C 59.059 47.476 59.083 47.55 59.098 47.599 C 59.115 47.545 59.141 47.465 59.177 47.359 L 59.536 46.316 L 59.803 46.316 L 59.803 47.815 L 59.612 47.815 L 59.612 46.56 L 59.176 47.815 L 58.997 47.815 L 58.564 46.539 L 58.564 47.815 L 58.372 47.815"
|
||||
fill="rgb(23,147,209)" />
|
||||
</g>
|
||||
</g>
|
||||
<g clip-path="url(#_clipPath_NvFIpNfWUS6M4fZAtfyVzggsKR3URDoi)"><text transform="matrix(1,0,0,1,87.023,43.899)"
|
||||
style="font-family:'Open Sans';font-weight:700;font-size:11px;font-style:normal;fill:#ffffff;stroke:none;">user
|
||||
repository</text></g>
|
||||
<defs>
|
||||
<clipPath id="_clipPath_NvFIpNfWUS6M4fZAtfyVzggsKR3URDoi">
|
||||
<rect x="0" y="0" width="86" height="14.98" transform="matrix(1,0,0,1,87,32.142)" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 7.5 KiB |
BIN
docs/gh-logo-2.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
docs/gh-logo.png
Normal file
After Width: | Height: | Size: 304 KiB |
BIN
docs/logo.png
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 172 KiB |
0
misc/.gitkeep
Normal file
29585
package-lock.json
generated
Normal file
238
package.json
@@ -1,24 +1,108 @@
|
||||
{
|
||||
"name": "antares",
|
||||
"productName": "Antares",
|
||||
"version": "0.0.7",
|
||||
"description": "A cross-platform easy to use SQL client.",
|
||||
"version": "0.5.17",
|
||||
"description": "A modern, fast and productivity driven SQL client with a focus in UX.",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/EStarium/antares.git",
|
||||
"repository": "https://github.com/antares-sql/antares.git",
|
||||
"scripts": {
|
||||
"dev": "cross-env NODE_ENV=development electron-webpack dev",
|
||||
"compile": "electron-webpack",
|
||||
"build": "cross-env NODE_ENV=production npm run compile && electron-builder",
|
||||
"debug": "npm run rebuild:electron && npm run debug-runner",
|
||||
"debug-runner": "node scripts/devRunner.js --remote-debug",
|
||||
"compile": "npm run compile:main && npm run compile:workers && npm run compile:renderer",
|
||||
"compile:main": "webpack --mode=production --config webpack.main.config.js",
|
||||
"compile:workers": "webpack --mode=production --config webpack.workers.config.js",
|
||||
"compile:renderer": "webpack --mode=production --config webpack.renderer.config.js",
|
||||
"build": "cross-env NODE_ENV=production npm run compile && electron-builder --publish never",
|
||||
"build:appx": "npm run build -- --win appx",
|
||||
"rebuild:electron": "rimraf ./dist && npm run postinstall && npm run devtools:install",
|
||||
"release": "standard-version",
|
||||
"release:pre": "npm run release -- --prerelease alpha",
|
||||
"test": "npm run lint",
|
||||
"lint": "eslint . --ext .js,.vue && stylelint \"./src/**/*.{css,scss,sass,vue}\"",
|
||||
"lint:fix": "eslint . --ext .js,.vue --fix && stylelint \"./src/**/*.{css,scss,sass,vue}\" --fix"
|
||||
"devtools:install": "node scripts/devtoolsInstaller",
|
||||
"postinstall": "electron-builder install-app-deps",
|
||||
"test:e2e": "npm run compile && npm run test:e2e-dry",
|
||||
"test:e2e-dry": "xvfb-maybe -- playwright test",
|
||||
"lint": "eslint . --ext .js,.ts,.vue && stylelint \"./src/**/*.{css,scss,sass,vue}\"",
|
||||
"lint:fix": "eslint . --ext .js,.ts,.vue --fix && stylelint \"./src/**/*.{css,scss,sass,vue}\" --fix",
|
||||
"contributors:add": "all-contributors add",
|
||||
"contributors:generate": "all-contributors generate"
|
||||
},
|
||||
"author": "Fabio Di Stasio <fabio286@gmail.com>",
|
||||
"main": "./dist/main.js",
|
||||
"antares": {
|
||||
"devtoolsId": "nhdogjmejiglipccpnnnanhbledajbpd"
|
||||
},
|
||||
"build": {
|
||||
"appId": "com.estarium.antares",
|
||||
"appId": "com.fabio286.antares",
|
||||
"artifactName": "${productName}-${version}-${os}_${arch}.${ext}",
|
||||
"asar": true,
|
||||
"buildDependenciesFromSource": true,
|
||||
"directories": {
|
||||
"output": "build",
|
||||
"buildResources": "assets"
|
||||
},
|
||||
"asarUnpack": "**\\*.{node,dll}",
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"node_modules",
|
||||
"package.json"
|
||||
],
|
||||
"win": {
|
||||
"target": [
|
||||
"nsis",
|
||||
"portable"
|
||||
]
|
||||
},
|
||||
"mac": {
|
||||
"target": {
|
||||
"target": "default",
|
||||
"arch": [
|
||||
"x64"
|
||||
]
|
||||
}
|
||||
},
|
||||
"linux": {
|
||||
"target": [
|
||||
{
|
||||
"target": "deb",
|
||||
"arch": [
|
||||
"x64",
|
||||
"armv7l",
|
||||
"arm64"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "AppImage",
|
||||
"arch": [
|
||||
"x64",
|
||||
"armv7l",
|
||||
"arm64"
|
||||
]
|
||||
}
|
||||
],
|
||||
"icon": "assets/linux",
|
||||
"category": "Development"
|
||||
},
|
||||
"appImage": {
|
||||
"license": "./LICENSE",
|
||||
"category": "Development"
|
||||
},
|
||||
"nsis": {
|
||||
"license": "./LICENSE",
|
||||
"installerIcon": "assets/icon.ico",
|
||||
"uninstallerIcon": "assets/icon.ico",
|
||||
"installerHeader": "assets/icon.ico"
|
||||
},
|
||||
"portable": {
|
||||
"artifactName": "${productName}-${version}-portable.exe"
|
||||
},
|
||||
"appx": {
|
||||
"displayName": "Antares SQL",
|
||||
"backgroundColor": "transparent",
|
||||
"showNameOnTiles": true,
|
||||
"identityName": "62514FabioDiStasio.AntaresSQLClient",
|
||||
"publisher": "CN=1A2729ED-865C-41D2-9038-39AE2A63AA52",
|
||||
"applicationId": "FabioDiStasio.AntaresSQLClient"
|
||||
},
|
||||
"dmg": {
|
||||
"contents": [
|
||||
{
|
||||
@@ -32,63 +116,91 @@
|
||||
"path": "/Applications"
|
||||
}
|
||||
]
|
||||
},
|
||||
"linux": {
|
||||
"target": [
|
||||
"deb",
|
||||
"AppImage"
|
||||
],
|
||||
"category": "Development"
|
||||
}
|
||||
},
|
||||
"electronWebpack": {
|
||||
"renderer": {
|
||||
"webpackConfig": "webpack.config.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@mdi/font": "^5.6.55",
|
||||
"electron-log": "^4.2.4",
|
||||
"electron-updater": "^4.3.5",
|
||||
"lodash": "^4.17.20",
|
||||
"moment": "^2.29.0",
|
||||
"monaco-editor": "^0.20.0",
|
||||
"mssql": "^6.2.2",
|
||||
"mysql": "^2.18.1",
|
||||
"pg": "^8.3.3",
|
||||
"source-map-support": "^0.5.16",
|
||||
"spectre.css": "^0.5.9",
|
||||
"vue-click-outside": "^1.1.0",
|
||||
"vue-i18n": "^8.21.0",
|
||||
"vue-the-mask": "^0.11.1",
|
||||
"vuedraggable": "^2.24.1",
|
||||
"vuex": "^3.5.1",
|
||||
"vuex-persist": "^3.1.0"
|
||||
"@electron/remote": "~2.0.1",
|
||||
"@faker-js/faker": "~6.1.2",
|
||||
"@mdi/font": "~7.0.96",
|
||||
"@turf/helpers": "~6.5.0",
|
||||
"@vueuse/core": "~8.7.5",
|
||||
"ace-builds": "~1.8.1",
|
||||
"better-sqlite3": "~7.5.1",
|
||||
"electron-log": "~4.4.1",
|
||||
"electron-store": "~8.0.1",
|
||||
"electron-updater": "~4.6.5",
|
||||
"electron-window-state": "~5.0.3",
|
||||
"encoding": "~0.1.13",
|
||||
"leaflet": "~1.7.1",
|
||||
"marked": "~4.0.0",
|
||||
"moment": "~2.29.4",
|
||||
"mysql2": "~2.3.2",
|
||||
"pg": "~8.7.1",
|
||||
"pg-connection-string": "~2.5.0",
|
||||
"pg-query-stream": "~4.2.3",
|
||||
"pgsql-ast-parser": "~7.2.1",
|
||||
"pinia": "~2.0.13",
|
||||
"source-map-support": "~0.5.20",
|
||||
"spectre.css": "~0.5.9",
|
||||
"sql-formatter": "~8.2.0",
|
||||
"ssh2-promise": "~1.0.2",
|
||||
"v-mask": "~2.3.0",
|
||||
"vue": "~3.2.37",
|
||||
"vue-i18n": "~9.2.0",
|
||||
"vuedraggable": "~4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.1.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"electron": "^10.1.0",
|
||||
"electron-builder": "^22.8.1",
|
||||
"electron-devtools-installer": "^3.1.1",
|
||||
"electron-webpack": "^2.8.2",
|
||||
"electron-webpack-vue": "^2.4.0",
|
||||
"eslint": "^7.8.1",
|
||||
"eslint-config-standard": "^14.1.1",
|
||||
"eslint-plugin-import": "^2.22.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^4.2.1",
|
||||
"eslint-plugin-standard": "^4.0.1",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"monaco-editor-webpack-plugin": "^1.9.1",
|
||||
"node-sass": "^4.14.1",
|
||||
"sass-loader": "^10.0.2",
|
||||
"standard-version": "^9.0.0",
|
||||
"stylelint": "^13.7.0",
|
||||
"stylelint-config-standard": "^20.0.0",
|
||||
"stylelint-scss": "^3.18.0",
|
||||
"vue": "^2.6.12",
|
||||
"vue-template-compiler": "^2.6.12",
|
||||
"webpack": "^4.44.2"
|
||||
"@babel/eslint-parser": "~7.15.7",
|
||||
"@babel/preset-env": "~7.15.8",
|
||||
"@babel/preset-typescript": "~7.16.7",
|
||||
"@playwright/test": "~1.21.1",
|
||||
"@types/better-sqlite3": "~7.5.0",
|
||||
"@types/leaflet": "~1.7.9",
|
||||
"@types/marked": "~4.0.3",
|
||||
"@types/node": "~17.0.23",
|
||||
"@types/pg": "~8.6.5",
|
||||
"@typescript-eslint/eslint-plugin": "~5.18.0",
|
||||
"@typescript-eslint/parser": "~5.18.0",
|
||||
"@vue/compiler-sfc": "~3.2.33",
|
||||
"all-contributors-cli": "~6.20.0",
|
||||
"babel-loader": "~8.2.3",
|
||||
"chalk": "~4.1.2",
|
||||
"cross-env": "~7.0.2",
|
||||
"css-loader": "~6.5.0",
|
||||
"electron": "~19.0.5",
|
||||
"electron-builder": "~23.0.3",
|
||||
"eslint": "~7.32.0",
|
||||
"eslint-config-standard": "~16.0.3",
|
||||
"eslint-plugin-import": "~2.24.2",
|
||||
"eslint-plugin-node": "~11.1.0",
|
||||
"eslint-plugin-promise": "~5.2.0",
|
||||
"eslint-plugin-vue": "~8.0.3",
|
||||
"file-loader": "~6.2.0",
|
||||
"html-webpack-plugin": "~5.5.0",
|
||||
"mini-css-extract-plugin": "~2.4.5",
|
||||
"node-loader": "~2.0.0",
|
||||
"playwright": "~1.21.1",
|
||||
"playwright-core": "~1.21.1",
|
||||
"postcss-html": "~1.5.0",
|
||||
"progress-webpack-plugin": "~1.0.12",
|
||||
"rimraf": "~3.0.2",
|
||||
"sass": "~1.42.1",
|
||||
"sass-loader": "~12.3.0",
|
||||
"standard-version": "~9.3.1",
|
||||
"style-loader": "~3.3.1",
|
||||
"stylelint": "~14.9.1",
|
||||
"stylelint-config-recommended-vue": "~1.4.0",
|
||||
"stylelint-config-standard": "~26.0.0",
|
||||
"stylelint-scss": "~4.3.0",
|
||||
"tree-kill": "~1.2.2",
|
||||
"ts-loader": "~9.2.8",
|
||||
"typescript": "~4.6.3",
|
||||
"unzip-crx-3": "~0.2.0",
|
||||
"vue-eslint-parser": "~8.3.0",
|
||||
"vue-loader": "~16.8.3",
|
||||
"webpack": "~5.72.0",
|
||||
"webpack-cli": "~4.9.1",
|
||||
"webpack-dev-server": "~4.4.0",
|
||||
"xvfb-maybe": "~0.2.1"
|
||||
}
|
||||
}
|
||||
|
131
scripts/devRunner.js
Normal file
@@ -0,0 +1,131 @@
|
||||
process.env.NODE_ENV = 'development';
|
||||
// process.env.ELECTRON_ENABLE_LOGGING = true
|
||||
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = false;
|
||||
|
||||
const chalk = require('chalk');
|
||||
const electron = require('electron');
|
||||
const webpack = require('webpack');
|
||||
const WebpackDevServer = require('webpack-dev-server');
|
||||
const kill = require('tree-kill');
|
||||
|
||||
const path = require('path');
|
||||
const { spawn } = require('child_process');
|
||||
|
||||
const mainConfig = require('../webpack.main.config');
|
||||
const rendererConfig = require('../webpack.renderer.config');
|
||||
const workersConfig = require('../webpack.workers.config');
|
||||
|
||||
let electronProcess = null;
|
||||
let manualRestart = null;
|
||||
const remoteDebugging = process.argv.includes('--remote-debug');
|
||||
|
||||
if (remoteDebugging) {
|
||||
// disable devtools open in electron
|
||||
process.env.RENDERER_REMOTE_DEBUGGING = true;
|
||||
}
|
||||
|
||||
async function killElectron (pid) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (pid) {
|
||||
kill(pid, 'SIGKILL', err => {
|
||||
if (err) reject(err);
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
else
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
async function restartElectron () {
|
||||
console.log(chalk.gray('\nStarting electron...'));
|
||||
|
||||
const { pid } = electronProcess || {};
|
||||
await killElectron(pid);
|
||||
|
||||
electronProcess = spawn(electron, [
|
||||
path.join(__dirname, '../dist/main.js'),
|
||||
// '--enable-logging', // Enable to show logs from all electron processes
|
||||
remoteDebugging ? '--inspect=9222' : '',
|
||||
remoteDebugging ? '--remote-debugging-port=9223' : ''
|
||||
]);
|
||||
|
||||
electronProcess.stdout.on('data', data => {
|
||||
console.log(chalk.white(data.toString()));
|
||||
});
|
||||
|
||||
electronProcess.stderr.on('data', data => {
|
||||
console.error(chalk.red(data.toString()));
|
||||
});
|
||||
|
||||
electronProcess.on('exit', () => {
|
||||
if (!manualRestart) process.exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
function startMain () {
|
||||
const webpackSetup = webpack([mainConfig, workersConfig]);
|
||||
|
||||
webpackSetup.compilers.forEach((compiler) => {
|
||||
const { name } = compiler;
|
||||
|
||||
switch (name) {
|
||||
case 'workers':
|
||||
compiler.hooks.afterEmit.tap('afterEmit', async () => {
|
||||
console.log(chalk.gray(`\nCompiled ${name} script!`));
|
||||
console.log(
|
||||
chalk.gray(`\nWatching file changes for ${name} script...`)
|
||||
);
|
||||
});
|
||||
break;
|
||||
case 'main':
|
||||
default:
|
||||
compiler.hooks.afterEmit.tap('afterEmit', async () => {
|
||||
console.log(chalk.gray(`\nCompiled ${name} script!`));
|
||||
|
||||
manualRestart = true;
|
||||
await restartElectron();
|
||||
|
||||
setTimeout(() => {
|
||||
manualRestart = false;
|
||||
}, 2500);
|
||||
|
||||
console.log(
|
||||
chalk.gray(`\nWatching file changes for ${name} script...`)
|
||||
);
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
webpackSetup.watch({ aggregateTimeout: 500 }, err => {
|
||||
if (err) console.error(chalk.red(err));
|
||||
});
|
||||
}
|
||||
|
||||
function startRenderer (callback) {
|
||||
const compiler = webpack(rendererConfig);
|
||||
const { name } = compiler;
|
||||
|
||||
compiler.hooks.afterEmit.tap('afterEmit', () => {
|
||||
console.log(chalk.gray(`\nCompiled ${name} script!`));
|
||||
console.log(chalk.gray(`\nWatching file changes for ${name} script...`));
|
||||
});
|
||||
|
||||
const server = new WebpackDevServer(compiler, {
|
||||
port: 9080,
|
||||
client: {
|
||||
overlay: true,
|
||||
logging: 'warn'
|
||||
}
|
||||
});
|
||||
|
||||
server.startCallback(err => {
|
||||
if (err) console.error(chalk.red(err));
|
||||
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
startRenderer(startMain);
|
49
scripts/devtoolsInstaller.js
Normal file
@@ -0,0 +1,49 @@
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-nocheck
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const https = require('https');
|
||||
const unzip = require('unzip-crx-3');
|
||||
const { antares } = require('../package.json');
|
||||
|
||||
const extensionID = antares.devtoolsId;
|
||||
const destFolder = path.resolve(__dirname, `../misc/${extensionID}`);
|
||||
const filePath = path.resolve(__dirname, `${destFolder}${extensionID}.crx`);
|
||||
const fileUrl = `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${extensionID}%26uc&prodversion=32`;
|
||||
const fileStream = fs.createWriteStream(filePath);
|
||||
|
||||
const downloadFile = url => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const request = https.get(url);
|
||||
|
||||
request.on('response', response => {
|
||||
if (response.statusCode && response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) {
|
||||
return downloadFile(response.headers.location)
|
||||
.then(resolve)
|
||||
.catch(reject);
|
||||
}
|
||||
|
||||
response.pipe(fileStream);
|
||||
|
||||
response.on('close', () => {
|
||||
console.log('Devtools download completed!');
|
||||
resolve();
|
||||
});
|
||||
response.on('error', reject);
|
||||
});
|
||||
request.on('error', reject);
|
||||
request.end();
|
||||
});
|
||||
};
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
await downloadFile(fileUrl);
|
||||
await unzip(filePath, destFolder);
|
||||
fs.unlinkSync(filePath);
|
||||
fs.unlinkSync(`${destFolder}/package.json`);// <- Avoid to display annoyng npm script in vscode
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})();
|
161
snap/snapcraft.yaml
Normal file
@@ -0,0 +1,161 @@
|
||||
name: antares
|
||||
adopt-info: antares
|
||||
summary: Open source SQL client made to be simple and complete.
|
||||
description: |
|
||||
Antares is an SQL client that aims to become an useful and complete tool, especially for developers.
|
||||
The target is to support as many databases as possible, and all major operating systems, including the ARM versions.
|
||||
base: core20
|
||||
|
||||
grade: stable
|
||||
confinement: strict
|
||||
|
||||
architectures:
|
||||
- build-on: amd64
|
||||
compression: lzo
|
||||
layout:
|
||||
/etc/nsswitch.conf:
|
||||
bind-file: $SNAP/etc/nsswitch.conf
|
||||
|
||||
parts:
|
||||
antares:
|
||||
plugin: dump
|
||||
source: .
|
||||
override-build: |
|
||||
snapcraftctl build
|
||||
ARCHITECTURE=$(dpkg --print-architecture)
|
||||
if [ "${ARCHITECTURE}" = "amd64" ]; then
|
||||
FILTER="amd64.deb"
|
||||
else
|
||||
echo "ERROR! Antares only produces debs for amd64. Failing the build here."
|
||||
exit 1
|
||||
fi
|
||||
# Get the latest releases json
|
||||
echo "Get GitHub releases..."
|
||||
wget --quiet https://api.github.com/repos/fabio286/antares/releases/latest -O releases.json
|
||||
# Get the version from the tag_name and the download URL.
|
||||
VERSION=$(jq . releases.json | grep tag_name | cut -d'"' -f4 | sed s'/release-//')
|
||||
DEB_URL=$(cat releases.json | jq -r ".assets[] | select(.name | test(\"${FILTER}\")) | .browser_download_url")
|
||||
DEB=$(basename "${DEB_URL}")
|
||||
echo "Downloading ${DEB_URL}..."
|
||||
wget --quiet "${DEB_URL}" -O "${SNAPCRAFT_PART_INSTALL}/${DEB}"
|
||||
echo "Unpacking ${DEB}..."
|
||||
dpkg -x "${SNAPCRAFT_PART_INSTALL}/${DEB}" ${SNAPCRAFT_PART_INSTALL}
|
||||
rm -f releases.json 2>/dev/null
|
||||
rm -f "${SNAPCRAFT_PART_INSTALL}/${DEB}" 2>/dev/null
|
||||
echo $VERSION > $SNAPCRAFT_STAGE/version
|
||||
# Correct path to icon.
|
||||
sed -i 's|Icon=antares|Icon=/usr/share/icons/hicolor/256x256/apps/antares\.png|g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/antares.desktop
|
||||
# Delete usr/bin/antares, it's a broken symlink pointing outside the snap.
|
||||
rm -f ${SNAPCRAFT_PART_INSTALL}/usr/bin/antares
|
||||
chmod -s ${SNAPCRAFT_PART_INSTALL}/opt/Antares/chrome-sandbox
|
||||
snapcraftctl set-version "$(echo $VERSION)"
|
||||
build-packages:
|
||||
- dpkg
|
||||
- jq
|
||||
- sed
|
||||
- wget
|
||||
stage-packages:
|
||||
- fcitx-frontend-gtk3
|
||||
- libappindicator3-1
|
||||
- libasound2
|
||||
- libcurl4
|
||||
- libgconf-2-4
|
||||
- libgtk-3-0
|
||||
- libnotify4
|
||||
- libnspr4
|
||||
- libnss3
|
||||
- libpcre3
|
||||
- libpulse0
|
||||
- libxss1
|
||||
- libsecret-1-0
|
||||
- libxtst6
|
||||
- libxkbfile1
|
||||
- gcc-10-base
|
||||
- libapparmor1
|
||||
- libblkid1
|
||||
- libbsd0
|
||||
- libcom-err2
|
||||
- libcrypt1
|
||||
- libdb5.3
|
||||
- libdbus-1-3
|
||||
- libexpat1
|
||||
- libffi7
|
||||
- libgcc-s1
|
||||
- libgcrypt20
|
||||
- libglib2.0-0
|
||||
- libgmp10
|
||||
- libgnutls30
|
||||
- libgpg-error0
|
||||
- libgssapi-krb5-2
|
||||
- libhogweed5
|
||||
- libidn2-0
|
||||
- libjson-c4
|
||||
- libk5crypto3
|
||||
- libkeyutils1
|
||||
- libkrb5-3
|
||||
- libkrb5support0
|
||||
- liblz4-1
|
||||
- liblzma5
|
||||
- libmount1
|
||||
- libnettle7
|
||||
- libp11-kit0
|
||||
- libpcre2-8-0
|
||||
- libselinux1
|
||||
- libsqlite3-0
|
||||
- libssl1.1
|
||||
- libstdc++6
|
||||
- libsystemd0
|
||||
- libtasn1-6
|
||||
- libudev1
|
||||
- libunistring2
|
||||
- libuuid1
|
||||
- libwrap0
|
||||
- libzstd1
|
||||
- zlib1g
|
||||
- libx11-xcb1
|
||||
- libdrm2
|
||||
- libgbm1
|
||||
- libxcb-dri3-0
|
||||
cleanup:
|
||||
after: [antares]
|
||||
plugin: nil
|
||||
build-snaps: [gnome-3-38-2004]
|
||||
override-prime: |
|
||||
set -eux
|
||||
cd /snap/gnome-3-38-2004/current
|
||||
find . -type f,l -exec rm -f $SNAPCRAFT_PRIME/{} \;
|
||||
|
||||
mdns-lookup:
|
||||
# Make resolution of ".local" host names (Zero-Conf/mDNS/DNS-SD)
|
||||
# working: Take the original nsswitch.conf file from the base
|
||||
# Snap and add "mdns4_minimal [NOTFOUND=return]" to its "hosts:" line
|
||||
# Also install corresponding mdns4_minimal plug-in
|
||||
# See: https://forum.snapcraft.io/t/no-mdns-support-in-snaps-should-core-have-a-modified-nsswitch-conf/
|
||||
plugin: nil
|
||||
stage-packages:
|
||||
- libnss-mdns
|
||||
override-prime: |
|
||||
set -eux
|
||||
sed -Ee 's/^\s*hosts:(\s+)files/hosts:\1files mdns4_minimal \[NOTFOUND=return\]/' /snap/core20/current/etc/nsswitch.conf > $SNAPCRAFT_STAGE/etc/nsswitch.conf
|
||||
snapcraftctl prime
|
||||
prime:
|
||||
- lib/$SNAPCRAFT_ARCH_TRIPLET/libnss_mdns4_minimal*
|
||||
- etc/nsswitch.conf
|
||||
|
||||
apps:
|
||||
antares:
|
||||
command: opt/Antares/antares --no-sandbox
|
||||
desktop: usr/share/applications/antares.desktop
|
||||
extensions: [gnome-3-38]
|
||||
environment:
|
||||
# Fallback to XWayland if running in a Wayland session.
|
||||
DISABLE_WAYLAND: 1
|
||||
plugs:
|
||||
- browser-support
|
||||
- cups-control
|
||||
- home
|
||||
- network
|
||||
- opengl
|
||||
- pulseaudio
|
||||
- removable-media
|
||||
- unity7
|
218
src/common/FakerMethods.ts
Normal file
@@ -0,0 +1,218 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
export default class {
|
||||
static get _methods () {
|
||||
return [
|
||||
{ name: 'zipCode', group: 'address', types: ['string'] },
|
||||
{ name: 'zipCodeByState', group: 'address', types: ['string'] },
|
||||
{ name: 'city', group: 'address', types: ['string'] },
|
||||
{ name: 'cityPrefix', group: 'address', types: ['string'] },
|
||||
{ name: 'citySuffix', group: 'address', types: ['string'] },
|
||||
{ name: 'streetName', group: 'address', types: ['string'] },
|
||||
{ name: 'streetAddress', group: 'address', types: ['string'] },
|
||||
{ name: 'streetSuffix', group: 'address', types: ['string'] },
|
||||
{ name: 'streetPrefix', group: 'address', types: ['string'] },
|
||||
{ name: 'secondaryAddress', group: 'address', types: ['string'] },
|
||||
{ name: 'county', group: 'address', types: ['string'] },
|
||||
{ name: 'country', group: 'address', types: ['string'] },
|
||||
{ name: 'countryCode', group: 'address', types: ['string'] },
|
||||
{ name: 'state', group: 'address', types: ['string'] },
|
||||
{ name: 'stateAbbr', group: 'address', types: ['string'] },
|
||||
{ name: 'latitude', group: 'address', types: ['string'] },
|
||||
{ name: 'longitude', group: 'address', types: ['string'] },
|
||||
{ name: 'direction', group: 'address', types: ['string'] },
|
||||
{ name: 'cardinalDirection', group: 'address', types: ['string'] },
|
||||
{ name: 'ordinalDirection', group: 'address', types: ['string'] },
|
||||
// { name: 'nearbyGPSCoordinate', group: 'address', types: ['string'] },
|
||||
{ name: 'timeZone', group: 'address', types: ['string'] },
|
||||
|
||||
{ name: 'color', group: 'commerce', types: ['string'] },
|
||||
{ name: 'department', group: 'commerce', types: ['string'] },
|
||||
{ name: 'productName', group: 'commerce', types: ['string'] },
|
||||
{ name: 'price', group: 'commerce', types: ['string', 'float'] },
|
||||
{ name: 'productAdjective', group: 'commerce', types: ['string'] },
|
||||
{ name: 'productMaterial', group: 'commerce', types: ['string'] },
|
||||
{ name: 'product', group: 'commerce', types: ['string'] },
|
||||
{ name: 'productDescription', group: 'commerce', types: ['string'] },
|
||||
|
||||
{ name: 'suffixes', group: 'company', types: ['string'] },
|
||||
{ name: 'companyName', group: 'company', types: ['string'] },
|
||||
{ name: 'companySuffix', group: 'company', types: ['string'] },
|
||||
{ name: 'catchPhrase', group: 'company', types: ['string'] },
|
||||
{ name: 'bs', group: 'company', types: ['string'] },
|
||||
{ name: 'catchPhraseAdjective', group: 'company', types: ['string'] },
|
||||
{ name: 'catchPhraseDescriptor', group: 'company', types: ['string'] },
|
||||
{ name: 'catchPhraseNoun', group: 'company', types: ['string'] },
|
||||
{ name: 'bsAdjective', group: 'company', types: ['string'] },
|
||||
{ name: 'bsBuzz', group: 'company', types: ['string'] },
|
||||
{ name: 'bsNoun', group: 'company', types: ['string'] },
|
||||
|
||||
{ name: 'column', group: 'database', types: ['string'] },
|
||||
{ name: 'type', group: 'database', types: ['string'] },
|
||||
{ name: 'collation', group: 'database', types: ['string'] },
|
||||
{ name: 'engine', group: 'database', types: ['string'] },
|
||||
|
||||
{ name: 'past', group: 'date', types: ['string', 'datetime'] },
|
||||
{ name: 'future', group: 'date', types: ['string', 'datetime'] },
|
||||
// { name: 'between', group: 'date', types: ['string'] },
|
||||
{ name: 'recent', group: 'date', types: ['string', 'datetime'] },
|
||||
{ name: 'soon', group: 'date', types: ['string', 'datetime'] },
|
||||
{ name: 'month', group: 'date', types: ['string'] },
|
||||
{ name: 'weekday', group: 'date', types: ['string'] },
|
||||
|
||||
{ name: 'account', group: 'finance', types: ['string', 'number'] },
|
||||
{ name: 'accountName', group: 'finance', types: ['string'] },
|
||||
{ name: 'routingNumber', group: 'finance', types: ['string', 'number'] },
|
||||
{ name: 'mask', group: 'finance', types: ['string', 'number'] },
|
||||
{ name: 'amount', group: 'finance', types: ['string', 'float'] },
|
||||
{ name: 'transactionType', group: 'finance', types: ['string'] },
|
||||
{ name: 'currencyCode', group: 'finance', types: ['string'] },
|
||||
{ name: 'currencyName', group: 'finance', types: ['string'] },
|
||||
{ name: 'currencySymbol', group: 'finance', types: ['string'] },
|
||||
{ name: 'bitcoinAddress', group: 'finance', types: ['string'] },
|
||||
{ name: 'litecoinAddress', group: 'finance', types: ['string'] },
|
||||
{ name: 'creditCardNumber', group: 'finance', types: ['string'] },
|
||||
{ name: 'creditCardCVV', group: 'finance', types: ['string', 'number'] },
|
||||
{ name: 'ethereumAddress', group: 'finance', types: ['string'] },
|
||||
{ name: 'iban', group: 'finance', types: ['string'] },
|
||||
{ name: 'bic', group: 'finance', types: ['string'] },
|
||||
{ name: 'transactionDescription', group: 'finance', types: ['string'] },
|
||||
|
||||
{ name: 'branch', group: 'git', types: ['string'] },
|
||||
{ name: 'commitEntry', group: 'git', types: ['string'] },
|
||||
{ name: 'commitMessage', group: 'git', types: ['string'] },
|
||||
{ name: 'commitSha', group: 'git', types: ['string'] },
|
||||
{ name: 'shortSha', group: 'git', types: ['string'] },
|
||||
|
||||
{ name: 'abbreviation', group: 'hacker', types: ['string'] },
|
||||
{ name: 'adjective', group: 'hacker', types: ['string'] },
|
||||
{ name: 'noun', group: 'hacker', types: ['string'] },
|
||||
{ name: 'verb', group: 'hacker', types: ['string'] },
|
||||
{ name: 'ingverb', group: 'hacker', types: ['string'] },
|
||||
{ name: 'phrase', group: 'hacker', types: ['string'] },
|
||||
|
||||
// { name: 'avatar', group: 'internet', types: ['string'] },
|
||||
{ name: 'email', group: 'internet', types: ['string'] },
|
||||
{ name: 'exampleEmail', group: 'internet', types: ['string'] },
|
||||
{ name: 'userName', group: 'internet', types: ['string'] },
|
||||
{ name: 'protocol', group: 'internet', types: ['string'] },
|
||||
{ name: 'url', group: 'internet', types: ['string'] },
|
||||
{ name: 'domainName', group: 'internet', types: ['string'] },
|
||||
{ name: 'domainSuffix', group: 'internet', types: ['string'] },
|
||||
{ name: 'domainWord', group: 'internet', types: ['string'] },
|
||||
{ name: 'ip', group: 'internet', types: ['string'] },
|
||||
{ name: 'ipv6', group: 'internet', types: ['string'] },
|
||||
{ name: 'userAgent', group: 'internet', types: ['string'] },
|
||||
{ name: 'color', group: 'internet', types: ['string'] },
|
||||
{ name: 'mac', group: 'internet', types: ['string'] },
|
||||
{ name: 'password', group: 'internet', types: ['string'] },
|
||||
|
||||
{ name: 'word', group: 'lorem', types: ['string'] },
|
||||
{ name: 'words', group: 'lorem', types: ['string'] },
|
||||
{ name: 'sentence', group: 'lorem', types: ['string'] },
|
||||
{ name: 'slug', group: 'lorem', types: ['string'] },
|
||||
{ name: 'sentences', group: 'lorem', types: ['string'] },
|
||||
{ name: 'paragraph', group: 'lorem', types: ['string'] },
|
||||
{ name: 'paragraphs', group: 'lorem', types: ['string'] },
|
||||
{ name: 'text', group: 'lorem', types: ['string'] },
|
||||
{ name: 'lines', group: 'lorem', types: ['string'] },
|
||||
|
||||
{ name: 'genre', group: 'music', types: ['string'] },
|
||||
|
||||
{ name: 'firstName', group: 'name', types: ['string'] },
|
||||
{ name: 'lastName', group: 'name', types: ['string'] },
|
||||
{ name: 'middleName', group: 'name', types: ['string'] },
|
||||
{ name: 'findName', group: 'name', types: ['string'] },
|
||||
{ name: 'jobTitle', group: 'name', types: ['string'] },
|
||||
{ name: 'gender', group: 'name', types: ['string'] },
|
||||
{ name: 'prefix', group: 'name', types: ['string'] },
|
||||
{ name: 'suffix', group: 'name', types: ['string'] },
|
||||
{ name: 'title', group: 'name', types: ['string'] },
|
||||
{ name: 'jobDescriptor', group: 'name', types: ['string'] },
|
||||
{ name: 'jobArea', group: 'name', types: ['string'] },
|
||||
{ name: 'jobType', group: 'name', types: ['string'] },
|
||||
|
||||
{ name: 'phoneNumber', group: 'phone', types: ['string'] },
|
||||
{ name: 'phoneNumberFormat', group: 'phone', types: ['string'] },
|
||||
{ name: 'phoneFormats', group: 'phone', types: ['string'] },
|
||||
|
||||
{ name: 'number', group: 'random', types: ['string', 'number'], params: ['min', 'max'] },
|
||||
{ name: 'float', group: 'random', types: ['string', 'float'], params: ['min', 'max'] },
|
||||
{ name: 'arrayElement', group: 'random', types: ['string'] },
|
||||
{ name: 'arrayElements', group: 'random', types: ['string'] },
|
||||
{ name: 'objectElement', group: 'random', types: ['string'] },
|
||||
{ name: 'uuid', group: 'random', types: ['string'] },
|
||||
{ name: 'boolean', group: 'random', types: ['string'] },
|
||||
{ name: 'word', group: 'random', types: ['string'] },
|
||||
{ name: 'words', group: 'random', types: ['string'] },
|
||||
// { name: 'image', group: 'random', types: ['string'] },
|
||||
{ name: 'locale', group: 'random', types: ['string'] },
|
||||
{ name: 'alpha', group: 'random', types: ['string'] },
|
||||
{ name: 'alphaNumeric', group: 'random', types: ['string'] },
|
||||
{ name: 'hexaDecimal', group: 'random', types: ['string'] },
|
||||
|
||||
{ name: 'fileName', group: 'system', types: ['string'] },
|
||||
{ name: 'commonFileName', group: 'system', types: ['string'] },
|
||||
{ name: 'mimeType', group: 'system', types: ['string'] },
|
||||
{ name: 'commonFileType', group: 'system', types: ['string'] },
|
||||
{ name: 'commonFileExt', group: 'system', types: ['string'] },
|
||||
{ name: 'fileType', group: 'system', types: ['string'] },
|
||||
{ name: 'fileExt', group: 'system', types: ['string'] },
|
||||
{ name: 'directoryPath', group: 'system', types: ['string'] },
|
||||
{ name: 'filePath', group: 'system', types: ['string'] },
|
||||
{ name: 'semver', group: 'system', types: ['string'] },
|
||||
|
||||
{ name: 'recent', group: 'time', types: ['string', 'time'] },
|
||||
|
||||
{ name: 'vehicle', group: 'vehicle', types: ['string'] },
|
||||
{ name: 'manufacturer', group: 'vehicle', types: ['string'] },
|
||||
{ name: 'model', group: 'vehicle', types: ['string'] },
|
||||
{ name: 'type', group: 'vehicle', types: ['string'] },
|
||||
{ name: 'fuel', group: 'vehicle', types: ['string'] },
|
||||
{ name: 'vin', group: 'vehicle', types: ['string'] },
|
||||
{ name: 'color', group: 'vehicle', types: ['string'] }
|
||||
];
|
||||
}
|
||||
|
||||
static getGroups () {
|
||||
const groupsObj = this._methods.reduce((acc, curr) => {
|
||||
if (curr.group in acc)
|
||||
curr.types.forEach(type => acc[curr.group].add(type));
|
||||
else
|
||||
acc[curr.group] = new Set(curr.types);
|
||||
|
||||
return acc;
|
||||
}, {} as any);
|
||||
|
||||
const groupsArr = [];
|
||||
|
||||
for (const key in groupsObj)
|
||||
groupsArr.push({ name: key, types: [...groupsObj[key]] });
|
||||
|
||||
return groupsArr.sort((a, b) => {
|
||||
if (a.name < b.name)
|
||||
return -1;
|
||||
|
||||
if (b.name > a.name)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
static getGroupsByType (type: string) {
|
||||
if (!type) return [];
|
||||
return this.getGroups().filter(group => group.types.includes(type));
|
||||
}
|
||||
|
||||
static getMethods ({ type, group }: {type: string; group: string}) {
|
||||
return this._methods.filter(method => method.group === group && method.types.includes(type)).sort((a, b) => {
|
||||
if (a.name < b.name)
|
||||
return -1;
|
||||
|
||||
if (b.name > a.name)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
}
|
94
src/common/customizations/defaults.ts
Normal file
@@ -0,0 +1,94 @@
|
||||
import { Customizations } from '../interfaces/customizations';
|
||||
|
||||
export const defaults: Customizations = {
|
||||
// Defaults
|
||||
defaultPort: null,
|
||||
defaultUser: null,
|
||||
defaultDatabase: null,
|
||||
// Core
|
||||
database: false,
|
||||
collations: false,
|
||||
engines: false,
|
||||
connectionSchema: false,
|
||||
sslConnection: false,
|
||||
sshConnection: false,
|
||||
fileConnection: false,
|
||||
cancelQueries: false,
|
||||
// Tools
|
||||
processesList: false,
|
||||
usersManagement: false,
|
||||
variables: false,
|
||||
// Structure
|
||||
schemas: false,
|
||||
tables: false,
|
||||
views: false,
|
||||
triggers: false,
|
||||
triggerFunctions: false,
|
||||
routines: false,
|
||||
functions: false,
|
||||
schedulers: false,
|
||||
// Settings
|
||||
elementsWrapper: '',
|
||||
stringsWrapper: '"',
|
||||
tableAdd: false,
|
||||
tableTruncateDisableFKCheck: false,
|
||||
viewAdd: false,
|
||||
triggerAdd: false,
|
||||
triggerFunctionAdd: false,
|
||||
routineAdd: false,
|
||||
functionAdd: false,
|
||||
schedulerAdd: false,
|
||||
databaseEdit: false,
|
||||
schemaEdit: false,
|
||||
schemaDrop: false,
|
||||
schemaExport: false,
|
||||
exportByChunks: false,
|
||||
schemaImport: false,
|
||||
tableSettings: false,
|
||||
tableOptions: false,
|
||||
tableArray: false,
|
||||
tableRealCount: false,
|
||||
viewSettings: false,
|
||||
triggerSettings: false,
|
||||
triggerFunctionSettings: false,
|
||||
routineSettings: false,
|
||||
functionSettings: false,
|
||||
schedulerSettings: false,
|
||||
indexes: false,
|
||||
foreigns: false,
|
||||
sortableFields: false,
|
||||
unsigned: false,
|
||||
nullable: false,
|
||||
nullablePrimary: false,
|
||||
zerofill: false,
|
||||
autoIncrement: false,
|
||||
comment: false,
|
||||
collation: false,
|
||||
definer: false,
|
||||
onUpdate: false,
|
||||
viewAlgorithm: false,
|
||||
viewSqlSecurity: false,
|
||||
viewUpdateOption: false,
|
||||
procedureDeterministic: false,
|
||||
procedureDataAccess: false,
|
||||
procedureSql: null,
|
||||
procedureContext: false,
|
||||
procedureLanguage: false,
|
||||
functionDeterministic: false,
|
||||
functionDataAccess: false,
|
||||
functionSql: null,
|
||||
functionContext: false,
|
||||
functionLanguage: false,
|
||||
triggerSql: null,
|
||||
triggerStatementInCreation: false,
|
||||
triggerMultipleEvents: false,
|
||||
triggerTableInName: false,
|
||||
triggerUpdateColumns: false,
|
||||
triggerOnlyRename: false,
|
||||
triggerEnableDisable: false,
|
||||
triggerFunctionSql: null,
|
||||
triggerFunctionlanguages: null,
|
||||
parametersLength: false,
|
||||
languages: null,
|
||||
readOnlyMode: false
|
||||
};
|
16
src/common/customizations/index.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as mysql from 'common/customizations/mysql';
|
||||
import * as postgresql from 'common/customizations/postgresql';
|
||||
import * as sqlite from 'common/customizations/sqlite';
|
||||
import { Customizations } from 'common/interfaces/customizations';
|
||||
|
||||
export default {
|
||||
maria: mysql.customizations,
|
||||
mysql: mysql.customizations,
|
||||
pg: postgresql.customizations,
|
||||
sqlite: sqlite.customizations
|
||||
} as {
|
||||
maria: Customizations;
|
||||
mysql: Customizations;
|
||||
pg: Customizations;
|
||||
sqlite: Customizations;
|
||||
};
|
73
src/common/customizations/mysql.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
import { Customizations } from '../interfaces/customizations';
|
||||
import { defaults } from './defaults';
|
||||
|
||||
export const customizations: Customizations = {
|
||||
...defaults,
|
||||
// Defaults
|
||||
defaultPort: 3306,
|
||||
defaultUser: 'root',
|
||||
defaultDatabase: null,
|
||||
// Core
|
||||
connectionSchema: true,
|
||||
collations: true,
|
||||
engines: true,
|
||||
sslConnection: true,
|
||||
sshConnection: true,
|
||||
cancelQueries: true,
|
||||
// Tools
|
||||
processesList: true,
|
||||
// Structure
|
||||
schemas: true,
|
||||
tables: true,
|
||||
views: true,
|
||||
triggers: true,
|
||||
routines: true,
|
||||
functions: true,
|
||||
schedulers: true,
|
||||
// Settings
|
||||
elementsWrapper: '`',
|
||||
stringsWrapper: '"',
|
||||
tableAdd: true,
|
||||
tableTruncateDisableFKCheck: true,
|
||||
viewAdd: true,
|
||||
triggerAdd: true,
|
||||
routineAdd: true,
|
||||
functionAdd: true,
|
||||
schedulerAdd: true,
|
||||
schemaEdit: true,
|
||||
schemaDrop: true,
|
||||
schemaExport: true,
|
||||
exportByChunks: true,
|
||||
schemaImport: true,
|
||||
tableSettings: true,
|
||||
viewSettings: true,
|
||||
triggerSettings: true,
|
||||
routineSettings: true,
|
||||
functionSettings: true,
|
||||
schedulerSettings: true,
|
||||
indexes: true,
|
||||
foreigns: true,
|
||||
sortableFields: true,
|
||||
unsigned: true,
|
||||
nullable: true,
|
||||
zerofill: true,
|
||||
tableOptions: true,
|
||||
autoIncrement: true,
|
||||
comment: true,
|
||||
collation: true,
|
||||
definer: true,
|
||||
onUpdate: true,
|
||||
viewAlgorithm: true,
|
||||
viewSqlSecurity: true,
|
||||
viewUpdateOption: true,
|
||||
procedureDeterministic: true,
|
||||
procedureDataAccess: true,
|
||||
procedureSql: 'BEGIN\r\n\r\nEND',
|
||||
procedureContext: true,
|
||||
triggerSql: 'BEGIN\r\n\r\nEND',
|
||||
functionDeterministic: true,
|
||||
functionDataAccess: true,
|
||||
functionSql: 'BEGIN\r\n\r\nEND',
|
||||
parametersLength: true,
|
||||
readOnlyMode: true
|
||||
};
|
64
src/common/customizations/postgresql.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import { Customizations } from '../interfaces/customizations';
|
||||
import { defaults } from './defaults';
|
||||
|
||||
export const customizations: Customizations = {
|
||||
...defaults,
|
||||
// Defaults
|
||||
defaultPort: 5432,
|
||||
defaultUser: 'postgres',
|
||||
defaultDatabase: 'postgres',
|
||||
// Core
|
||||
database: true,
|
||||
sslConnection: true,
|
||||
sshConnection: true,
|
||||
cancelQueries: true,
|
||||
// Tools
|
||||
processesList: true,
|
||||
// Structure
|
||||
schemas: true,
|
||||
tables: true,
|
||||
views: true,
|
||||
triggers: true,
|
||||
triggerFunctions: true,
|
||||
routines: true,
|
||||
functions: true,
|
||||
// Settings
|
||||
elementsWrapper: '"',
|
||||
stringsWrapper: '\'',
|
||||
tableAdd: true,
|
||||
viewAdd: true,
|
||||
triggerAdd: true,
|
||||
triggerFunctionAdd: true,
|
||||
routineAdd: true,
|
||||
functionAdd: true,
|
||||
schemaDrop: true,
|
||||
schemaExport: true,
|
||||
schemaImport: true,
|
||||
databaseEdit: false,
|
||||
tableSettings: true,
|
||||
viewSettings: true,
|
||||
triggerSettings: true,
|
||||
triggerFunctionSettings: true,
|
||||
routineSettings: true,
|
||||
functionSettings: true,
|
||||
indexes: true,
|
||||
foreigns: true,
|
||||
nullable: true,
|
||||
tableArray: true,
|
||||
procedureSql: '$procedure$\r\n\r\n$procedure$',
|
||||
procedureContext: true,
|
||||
procedureLanguage: true,
|
||||
functionSql: '$function$\r\n\r\n$function$',
|
||||
triggerFunctionSql: '$function$\r\nBEGIN\r\n\r\nEND\r\n$function$',
|
||||
triggerFunctionlanguages: ['plpgsql'],
|
||||
functionContext: true,
|
||||
functionLanguage: true,
|
||||
triggerSql: 'EXECUTE PROCEDURE ',
|
||||
triggerStatementInCreation: true,
|
||||
triggerMultipleEvents: true,
|
||||
triggerTableInName: true,
|
||||
triggerOnlyRename: false,
|
||||
triggerEnableDisable: true,
|
||||
languages: ['sql', 'plpgsql', 'c', 'internal'],
|
||||
readOnlyMode: true
|
||||
};
|
31
src/common/customizations/sqlite.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Customizations } from '../interfaces/customizations';
|
||||
import { defaults } from './defaults';
|
||||
|
||||
export const customizations: Customizations = {
|
||||
...defaults,
|
||||
// Core
|
||||
fileConnection: true,
|
||||
// Structure
|
||||
schemas: false,
|
||||
tables: true,
|
||||
views: true,
|
||||
triggers: true,
|
||||
// Settings
|
||||
elementsWrapper: '"',
|
||||
stringsWrapper: '\'',
|
||||
tableAdd: true,
|
||||
viewAdd: true,
|
||||
triggerAdd: true,
|
||||
schemaEdit: false,
|
||||
tableSettings: true,
|
||||
tableRealCount: true,
|
||||
viewSettings: true,
|
||||
triggerSettings: true,
|
||||
indexes: true,
|
||||
foreigns: true,
|
||||
sortableFields: true,
|
||||
nullable: true,
|
||||
nullablePrimary: true,
|
||||
triggerSql: 'BEGIN\r\n\r\nEND',
|
||||
readOnlyMode: true
|
||||
};
|
311
src/common/data-types/mysql.ts
Normal file
@@ -0,0 +1,311 @@
|
||||
import { TypesGroup } from 'common/interfaces/antares';
|
||||
|
||||
export default [
|
||||
{
|
||||
group: 'integer',
|
||||
types: [
|
||||
{
|
||||
name: 'TINYINT',
|
||||
length: 4,
|
||||
collation: false,
|
||||
unsigned: true,
|
||||
zerofill: true
|
||||
},
|
||||
{
|
||||
name: 'SMALLINT',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: true,
|
||||
zerofill: true
|
||||
},
|
||||
{
|
||||
name: 'INT',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: true,
|
||||
zerofill: true
|
||||
},
|
||||
{
|
||||
name: 'MEDIUMINT',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: true,
|
||||
zerofill: true
|
||||
},
|
||||
{
|
||||
name: 'BIGINT',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: true,
|
||||
zerofill: true
|
||||
},
|
||||
{
|
||||
name: 'BIT',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: true,
|
||||
zerofill: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'float',
|
||||
types: [
|
||||
{
|
||||
name: 'FLOAT',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'DOUBLE',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'DECIMAL',
|
||||
length: true,
|
||||
scale: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'string',
|
||||
types: [
|
||||
{
|
||||
name: 'CHAR',
|
||||
length: true,
|
||||
collation: true,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'VARCHAR',
|
||||
length: true,
|
||||
collation: true,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'TINYTEXT',
|
||||
length: false,
|
||||
collation: true,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'MEDIUMTEXT',
|
||||
length: false,
|
||||
collation: true,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'TEXT',
|
||||
length: false,
|
||||
collation: true,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'LONGTEXT',
|
||||
length: false,
|
||||
collation: true,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'JSON',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'binary',
|
||||
types: [
|
||||
{
|
||||
name: 'BINARY',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'VARBINARY',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'TINYBLOB',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'BLOB',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'MEDIUMBLOB',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'LONGBLOB',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'time',
|
||||
types: [
|
||||
{
|
||||
name: 'DATE',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'TIME',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'YEAR',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'DATETIME',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'TIMESTAMP',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'spatial',
|
||||
types: [
|
||||
{
|
||||
name: 'POINT',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'LINESTRING',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'POLYGON',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'GEOMETRY',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'MULTIPOINT',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'MULTILINESTRING',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'MULTIPOLYGON',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'GEOMCOLLECTION',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'other',
|
||||
types: [
|
||||
{
|
||||
name: 'ENUM',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'SET',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'unknown',
|
||||
types: [
|
||||
{
|
||||
name: 'UNKNOWN',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
}
|
||||
]
|
||||
}
|
||||
] as TypesGroup[];
|
295
src/common/data-types/postgresql.ts
Normal file
@@ -0,0 +1,295 @@
|
||||
import { TypesGroup } from 'common/interfaces/antares';
|
||||
|
||||
export default [
|
||||
{
|
||||
group: 'integer',
|
||||
types: [
|
||||
{
|
||||
name: 'SMALLINT',
|
||||
length: false,
|
||||
unsigned: true
|
||||
},
|
||||
{
|
||||
name: 'INTEGER',
|
||||
length: false,
|
||||
unsigned: true
|
||||
},
|
||||
{
|
||||
name: 'BIGINT',
|
||||
length: false,
|
||||
unsigned: true
|
||||
},
|
||||
{
|
||||
name: 'DECIMAL',
|
||||
length: false,
|
||||
unsigned: true
|
||||
},
|
||||
{
|
||||
name: 'SMALLSERIAL',
|
||||
length: false,
|
||||
unsigned: true
|
||||
},
|
||||
{
|
||||
name: 'SERIAL',
|
||||
length: false,
|
||||
unsigned: true
|
||||
},
|
||||
{
|
||||
name: 'BIGSERIAL',
|
||||
length: false,
|
||||
unsigned: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'float',
|
||||
types: [
|
||||
{
|
||||
name: 'REAL',
|
||||
length: false,
|
||||
unsigned: true
|
||||
},
|
||||
{
|
||||
name: 'NUMERIC',
|
||||
length: true,
|
||||
unsigned: true,
|
||||
scale: true
|
||||
},
|
||||
{
|
||||
name: 'DOUBLE PRECISION',
|
||||
length: false,
|
||||
unsigned: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'monetary',
|
||||
types: [
|
||||
{
|
||||
name: 'money',
|
||||
length: false,
|
||||
unsigned: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'string',
|
||||
types: [
|
||||
{
|
||||
name: 'CHARACTER VARYING',
|
||||
length: true,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'CHARACTER',
|
||||
length: true,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'TEXT',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: '"CHAR"',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'NAME',
|
||||
length: false,
|
||||
unsigned: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'binary',
|
||||
types: [
|
||||
{
|
||||
name: 'BYTEA',
|
||||
length: false,
|
||||
unsigned: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'time',
|
||||
types: [
|
||||
{
|
||||
name: 'TIMESTAMP WITHOUT TIME ZONE',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'TIMESTAMP WITH TIME ZONE',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'DATE',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'TIME WITHOUT TIME ZONE',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'TIME WITH TIME ZONE',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'INTERVAL',
|
||||
length: false,
|
||||
unsigned: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'boolean',
|
||||
types: [
|
||||
{
|
||||
name: 'BOOLEAN',
|
||||
length: false,
|
||||
unsigned: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'geometric',
|
||||
types: [
|
||||
{
|
||||
name: 'POINT',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'LINE',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'LSEG',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'BOX',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'PATH',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'POLYGON',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'CIRCLE',
|
||||
length: false,
|
||||
unsigned: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'network',
|
||||
types: [
|
||||
{
|
||||
name: 'CIDR',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'INET',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'MACADDR',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'MACADDR8',
|
||||
length: false,
|
||||
unsigned: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'bit',
|
||||
types: [
|
||||
{
|
||||
name: 'BIT',
|
||||
length: true,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'BIT VARYING',
|
||||
length: true,
|
||||
unsigned: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'text search',
|
||||
types: [
|
||||
{
|
||||
name: 'TSVECTOR',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'TSQUERY',
|
||||
length: false,
|
||||
unsigned: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'uuid',
|
||||
types: [
|
||||
{
|
||||
name: 'UUID',
|
||||
length: false,
|
||||
unsigned: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'xml',
|
||||
types: [
|
||||
{
|
||||
name: 'XML',
|
||||
length: false,
|
||||
unsigned: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'json',
|
||||
types: [
|
||||
{
|
||||
name: 'JSON',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'JSONB',
|
||||
length: false,
|
||||
unsigned: false
|
||||
},
|
||||
{
|
||||
name: 'JSONPATH',
|
||||
length: false,
|
||||
unsigned: false
|
||||
}
|
||||
]
|
||||
}
|
||||
] as TypesGroup[];
|
139
src/common/data-types/sqlite.ts
Normal file
@@ -0,0 +1,139 @@
|
||||
import { TypesGroup } from 'common/interfaces/antares';
|
||||
|
||||
export default [
|
||||
{
|
||||
group: 'integer',
|
||||
types: [
|
||||
{
|
||||
name: 'INT',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: true,
|
||||
zerofill: true
|
||||
},
|
||||
{
|
||||
name: 'INTEGER',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: true,
|
||||
zerofill: true
|
||||
},
|
||||
{
|
||||
name: 'BIGINT',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: true,
|
||||
zerofill: true
|
||||
},
|
||||
{
|
||||
name: 'NUMERIC',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: true,
|
||||
zerofill: true
|
||||
},
|
||||
{
|
||||
name: 'BOOLEAN',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: true,
|
||||
zerofill: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'float',
|
||||
types: [
|
||||
{
|
||||
name: 'FLOAT',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'REAL',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'string',
|
||||
types: [
|
||||
{
|
||||
name: 'CHAR',
|
||||
length: true,
|
||||
collation: true,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'VARCHAR',
|
||||
length: true,
|
||||
collation: true,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'TEXT',
|
||||
length: true,
|
||||
collation: true,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'binary',
|
||||
types: [
|
||||
{
|
||||
name: 'BLOB',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'time',
|
||||
types: [
|
||||
{
|
||||
name: 'DATE',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'TIME',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
},
|
||||
{
|
||||
name: 'DATETIME',
|
||||
length: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
group: 'other',
|
||||
types: [
|
||||
{
|
||||
name: 'NONE',
|
||||
length: false,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
}
|
||||
]
|
||||
}
|
||||
] as TypesGroup[];
|
@@ -1,12 +0,0 @@
|
||||
export const TEXT = ['char', 'varchar'];
|
||||
export const LONG_TEXT = ['text', 'mediumtext', 'longtext'];
|
||||
|
||||
export const NUMBER = ['int', 'tinyint', 'smallint', 'mediumint', 'bigint', 'float', 'double', 'decimal'];
|
||||
|
||||
export const DATE = ['date'];
|
||||
export const TIME = ['time'];
|
||||
export const DATETIME = ['datetime', 'timestamp'];
|
||||
|
||||
export const BLOB = ['blob', 'mediumblob', 'longblob'];
|
||||
|
||||
export const BIT = ['bit'];
|
108
src/common/fieldTypes.ts
Normal file
@@ -0,0 +1,108 @@
|
||||
export const TEXT = [
|
||||
'CHAR',
|
||||
'VARCHAR',
|
||||
'CHARACTER',
|
||||
'CHARACTER VARYING'
|
||||
];
|
||||
|
||||
export const LONG_TEXT = [
|
||||
'TEXT',
|
||||
'MEDIUMTEXT',
|
||||
'LONGTEXT',
|
||||
'JSON',
|
||||
'VARBINARY'
|
||||
];
|
||||
|
||||
export const ARRAY = [
|
||||
'ARRAY',
|
||||
'ANYARRAY'
|
||||
];
|
||||
|
||||
export const TEXT_SEARCH = [
|
||||
'TSVECTOR',
|
||||
'TSQUERY'
|
||||
];
|
||||
|
||||
export const NUMBER = [
|
||||
'INT',
|
||||
'TINYINT',
|
||||
'SMALLINT',
|
||||
'MEDIUMINT',
|
||||
'BIGINT',
|
||||
'DECIMAL',
|
||||
'NUMERIC',
|
||||
'INTEGER',
|
||||
'SMALLSERIAL',
|
||||
'SERIAL',
|
||||
'BIGSERIAL',
|
||||
'OID',
|
||||
'XID'
|
||||
];
|
||||
|
||||
export const FLOAT = [
|
||||
'FLOAT',
|
||||
'DECIMAL',
|
||||
'DOUBLE',
|
||||
'REAL',
|
||||
'DOUBLE PRECISION',
|
||||
'MONEY'
|
||||
];
|
||||
|
||||
export const BOOLEAN = [
|
||||
'BOOL',
|
||||
'BOOLEAN'
|
||||
];
|
||||
|
||||
export const DATE = ['DATE'];
|
||||
|
||||
export const TIME = [
|
||||
'TIME',
|
||||
'TIME WITH TIME ZONE'
|
||||
];
|
||||
|
||||
export const DATETIME = [
|
||||
'DATETIME',
|
||||
'TIMESTAMP',
|
||||
'TIMESTAMP WITHOUT TIME ZONE',
|
||||
'TIMESTAMP WITH TIME ZONE'
|
||||
];
|
||||
|
||||
// Used to check datetime fields only
|
||||
export const HAS_TIMEZONE = [
|
||||
'TIMESTAMP WITH TIME ZONE',
|
||||
'TIME WITH TIME ZONE'
|
||||
];
|
||||
|
||||
export const BLOB = [
|
||||
'BLOB',
|
||||
'TINYBLOB',
|
||||
'MEDIUMBLOB',
|
||||
'LONGBLOB',
|
||||
'BYTEA'
|
||||
];
|
||||
|
||||
export const BIT = [
|
||||
'BIT',
|
||||
'BIT VARYING'
|
||||
];
|
||||
|
||||
export const SPATIAL = [
|
||||
'POINT',
|
||||
'LINESTRING',
|
||||
'POLYGON',
|
||||
'GEOMETRY',
|
||||
'MULTIPOINT',
|
||||
'MULTILINESTRING',
|
||||
'MULTIPOLYGON',
|
||||
'GEOMCOLLECTION',
|
||||
'GEOMETRYCOLLECTION'
|
||||
];
|
||||
|
||||
// Used to check multi spatial fields only
|
||||
export const IS_MULTI_SPATIAL = [
|
||||
'MULTIPOINT',
|
||||
'MULTILINESTRING',
|
||||
'MULTIPOLYGON',
|
||||
'GEOMCOLLECTION',
|
||||
'GEOMETRYCOLLECTION'
|
||||
];
|
6
src/common/index-types/mysql.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export default [
|
||||
'PRIMARY',
|
||||
'INDEX',
|
||||
'UNIQUE',
|
||||
'FULLTEXT'
|
||||
];
|
5
src/common/index-types/postgresql.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export default [
|
||||
'PRIMARY',
|
||||
'INDEX',
|
||||
'UNIQUE'
|
||||
];
|
5
src/common/index-types/sqlite.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export default [
|
||||
'PRIMARY',
|
||||
'INDEX',
|
||||
'UNIQUE'
|
||||
];
|
406
src/common/interfaces/antares.ts
Normal file
@@ -0,0 +1,406 @@
|
||||
import * as mysql from 'mysql2/promise';
|
||||
import * as pg from 'pg';
|
||||
import MysqlExporter from 'src/main/libs/exporters/sql/MysqlExporter';
|
||||
import PostgreSQLExporter from 'src/main/libs/exporters/sql/PostgreSQLExporter';
|
||||
import MySQLImporter from 'src/main/libs/importers/sql/MySQLlImporter';
|
||||
import PostgreSQLImporter from 'src/main/libs/importers/sql/PostgreSQLImporter';
|
||||
import SSHConfig from 'ssh2-promise/lib/sshConfig';
|
||||
import { MySQLClient } from '../../main/libs/clients/MySQLClient';
|
||||
import { PostgreSQLClient } from '../../main/libs/clients/PostgreSQLClient';
|
||||
import { SQLiteClient } from '../../main/libs/clients/SQLiteClient';
|
||||
|
||||
export type Client = MySQLClient | PostgreSQLClient | SQLiteClient
|
||||
export type ClientCode = 'mysql' | 'maria' | 'pg' | 'sqlite'
|
||||
export type Exporter = MysqlExporter | PostgreSQLExporter
|
||||
export type Importer = MySQLImporter | PostgreSQLImporter
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export interface IpcResponse<T = any> {
|
||||
status: 'success' | 'error';
|
||||
response?: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pasameters needed to create a new Antares connection to a database
|
||||
*/
|
||||
export interface ClientParams {
|
||||
client: ClientCode;
|
||||
uid?: string;
|
||||
params:
|
||||
mysql.ConnectionOptions & {schema: string; ssl?: mysql.SslOptions; ssh?: SSHConfig; readonly: boolean}
|
||||
| pg.ClientConfig & {schema: string; ssl?: mysql.SslOptions; ssh?: SSHConfig; readonly: boolean}
|
||||
| { databasePath: string; readonly: boolean };
|
||||
poolSize?: number;
|
||||
logger?: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paramenets insered by user in connection mask
|
||||
*/
|
||||
export interface ConnectionParams {
|
||||
uid: string;
|
||||
name?: string;
|
||||
client: ClientCode;
|
||||
host: string;
|
||||
database?: string;
|
||||
schema?: string;
|
||||
databasePath?: string;
|
||||
port: number;
|
||||
user: string;
|
||||
password: string;
|
||||
ask: boolean;
|
||||
readonly: boolean;
|
||||
ssl: boolean;
|
||||
cert?: string;
|
||||
key?: string;
|
||||
ca?: string;
|
||||
untrustedConnection: boolean;
|
||||
ciphers?: string;
|
||||
ssh: boolean;
|
||||
sshHost?: string;
|
||||
sshUser?: string;
|
||||
sshPass?: string;
|
||||
sshKey?: string;
|
||||
sshPort?: number;
|
||||
sshPassphrase?: string;
|
||||
}
|
||||
|
||||
export interface TypeInformations {
|
||||
name: string;
|
||||
length: boolean;
|
||||
scale: boolean;
|
||||
collation: boolean;
|
||||
unsigned: boolean;
|
||||
zerofill: boolean;
|
||||
}
|
||||
|
||||
export interface TypesGroup {
|
||||
group: string;
|
||||
types: TypeInformations[];
|
||||
}
|
||||
|
||||
// Tables
|
||||
export interface TableInfos {
|
||||
name: string;
|
||||
type: string;
|
||||
rows: number;
|
||||
created: Date;
|
||||
updated: Date;
|
||||
engine: string;
|
||||
comment: string;
|
||||
size: number | false;
|
||||
autoIncrement: number;
|
||||
collation: string;
|
||||
}
|
||||
|
||||
export type TableOptions = Partial<TableInfos>;
|
||||
|
||||
export interface TableField {
|
||||
// eslint-disable-next-line camelcase
|
||||
_antares_id?: string;
|
||||
name: string;
|
||||
type: string;
|
||||
schema: string;
|
||||
table?: string;
|
||||
numPrecision?: number;
|
||||
numLength?: number;
|
||||
datePrecision?: number;
|
||||
charLength?: number;
|
||||
numScale?: number;
|
||||
nullable?: boolean;
|
||||
unsigned?: boolean;
|
||||
zerofill?: boolean;
|
||||
order?: number;
|
||||
default?: string;
|
||||
defaultType?: string;
|
||||
enumValues?: string;
|
||||
charset?: string;
|
||||
collation?: string;
|
||||
autoIncrement?: boolean;
|
||||
isArray?: boolean;
|
||||
onUpdate?: string;
|
||||
comment?: string;
|
||||
after?: string;
|
||||
orgName?: string;
|
||||
length?: number | false;
|
||||
alias: string;
|
||||
tableAlias: string;
|
||||
orgTable: string;
|
||||
key?: 'pri' | 'uni' | '';
|
||||
}
|
||||
|
||||
export interface TableIndex {
|
||||
// eslint-disable-next-line camelcase
|
||||
_antares_id?: string;
|
||||
name: string;
|
||||
fields: string[];
|
||||
type: string;
|
||||
comment?: string;
|
||||
indexType?: string;
|
||||
indexComment?: string;
|
||||
cardinality?: number;
|
||||
oldType?: string;
|
||||
oldName?: string;
|
||||
}
|
||||
|
||||
export interface TableForeign {
|
||||
// eslint-disable-next-line camelcase
|
||||
_antares_id?: string;
|
||||
constraintName: string;
|
||||
refSchema: string;
|
||||
table: string;
|
||||
refTable: string;
|
||||
field: string;
|
||||
refField: string;
|
||||
onUpdate: string;
|
||||
onDelete: string;
|
||||
oldName?: string;
|
||||
}
|
||||
|
||||
export interface CreateTableParams {
|
||||
/** Connection UID */
|
||||
uid?: string;
|
||||
schema: string;
|
||||
fields: TableField[];
|
||||
foreigns: TableForeign[];
|
||||
indexes: TableIndex[];
|
||||
options: TableOptions;
|
||||
}
|
||||
|
||||
export interface AlterTableParams {
|
||||
/** Connection UID */
|
||||
uid?: string;
|
||||
schema: string;
|
||||
table: string;
|
||||
additions: TableField[];
|
||||
changes: TableField[];
|
||||
deletions: TableField[];
|
||||
tableStructure: {
|
||||
name: string;
|
||||
fields: TableField[];
|
||||
foreigns: TableForeign[];
|
||||
indexes: TableIndex[];
|
||||
};
|
||||
indexChanges: {
|
||||
additions: TableIndex[];
|
||||
changes: TableIndex[];
|
||||
deletions: TableIndex[];
|
||||
};
|
||||
foreignChanges: {
|
||||
additions: TableForeign[];
|
||||
changes: TableForeign[];
|
||||
deletions: TableForeign[];
|
||||
};
|
||||
options: TableOptions;
|
||||
}
|
||||
|
||||
// Views
|
||||
export type ViewInfos = TableInfos
|
||||
export interface CreateViewParams {
|
||||
schema: string;
|
||||
name: string;
|
||||
algorithm: string;
|
||||
definer: string;
|
||||
security: string;
|
||||
sql: string;
|
||||
updateOption: string;
|
||||
}
|
||||
|
||||
export interface AlterViewParams extends CreateViewParams {
|
||||
oldName?: string;
|
||||
}
|
||||
|
||||
// Triggers
|
||||
export interface TriggerInfos {
|
||||
name: string;
|
||||
statement: string;
|
||||
timing: string;
|
||||
definer: string;
|
||||
event: string;
|
||||
table: string;
|
||||
sqlMode: string;
|
||||
created: Date;
|
||||
charset: string;
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export interface CreateTriggerParams {
|
||||
definer?: string;
|
||||
schema: string;
|
||||
name: string;
|
||||
activation: string;
|
||||
event: string;
|
||||
table: string;
|
||||
sql: string;
|
||||
}
|
||||
|
||||
export interface AlterTriggerParams extends CreateTriggerParams {
|
||||
oldName?: string;
|
||||
}
|
||||
|
||||
// Routines & Functions
|
||||
|
||||
export interface FunctionParam {
|
||||
// eslint-disable-next-line camelcase
|
||||
_antares_id: string;
|
||||
context: string;
|
||||
name: string;
|
||||
type: string;
|
||||
length: number;
|
||||
}
|
||||
|
||||
export interface RoutineInfos {
|
||||
name: string;
|
||||
type?: string;
|
||||
definer: string;
|
||||
created?: string;
|
||||
sql?: string;
|
||||
updated?: string;
|
||||
comment?: string;
|
||||
charset?: string;
|
||||
security?: string;
|
||||
language?: string;
|
||||
dataAccess?: string;
|
||||
deterministic?: boolean;
|
||||
parameters?: FunctionParam[];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
returns?: any;
|
||||
returnsLength?: number;
|
||||
}
|
||||
|
||||
export type FunctionInfos = RoutineInfos
|
||||
export type TriggerFunctionInfos = FunctionInfos
|
||||
|
||||
export interface CreateRoutineParams {
|
||||
name: string;
|
||||
parameters?: FunctionParam[];
|
||||
definer: string;
|
||||
schema: string;
|
||||
deterministic: boolean;
|
||||
dataAccess: string;
|
||||
security: string;
|
||||
comment?: string;
|
||||
language?: string;
|
||||
sql: string;
|
||||
}
|
||||
|
||||
export interface AlterRoutineParams extends CreateRoutineParams {
|
||||
oldName?: string;
|
||||
}
|
||||
|
||||
export interface CreateFunctionParams {
|
||||
name: string;
|
||||
parameters?: FunctionParam[];
|
||||
definer: string;
|
||||
schema: string;
|
||||
deterministic: boolean;
|
||||
dataAccess: string;
|
||||
security: string;
|
||||
comment?: string;
|
||||
sql: string;
|
||||
returns: string;
|
||||
returnsLength: number;
|
||||
language?: string;
|
||||
}
|
||||
|
||||
export interface AlterFunctionParams extends CreateFunctionParams {
|
||||
oldName?: string;
|
||||
}
|
||||
|
||||
// Events
|
||||
export interface EventInfos {
|
||||
definer?: string;
|
||||
schema: string;
|
||||
name: string;
|
||||
execution: string;
|
||||
every: string[];
|
||||
starts: string;
|
||||
ends: string;
|
||||
at: string;
|
||||
preserve: boolean;
|
||||
state: string;
|
||||
comment: string;
|
||||
enabled?: boolean;
|
||||
sql: string;
|
||||
}
|
||||
|
||||
export type CreateEventParams = EventInfos;
|
||||
|
||||
export interface AlterEventParams extends CreateEventParams {
|
||||
oldName?: string;
|
||||
}
|
||||
|
||||
// Schema
|
||||
export interface SchemaInfos {
|
||||
name: string;
|
||||
size: number;
|
||||
tables: TableInfos[];
|
||||
functions: FunctionInfos[];
|
||||
procedures: RoutineInfos[];
|
||||
triggers: TriggerInfos[];
|
||||
schedulers: EventInfos[];
|
||||
}
|
||||
|
||||
export interface CollationInfos {
|
||||
charset: string;
|
||||
collation: string;
|
||||
compiled: boolean;
|
||||
default: boolean;
|
||||
id: string | number;
|
||||
sortLen: number;
|
||||
}
|
||||
|
||||
// Query
|
||||
export interface QueryBuilderObject {
|
||||
schema: string;
|
||||
select: string[];
|
||||
from: string;
|
||||
where: string[];
|
||||
groupBy: string[];
|
||||
orderBy: string[];
|
||||
limit: number;
|
||||
offset: number;
|
||||
join: string[];
|
||||
update: string[];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
insert: {[key: string]: any}[];
|
||||
delete: boolean;
|
||||
}
|
||||
|
||||
export interface QueryParams {
|
||||
nest?: boolean;
|
||||
details?: boolean;
|
||||
split?: boolean;
|
||||
comments?: boolean;
|
||||
autocommit?: boolean;
|
||||
schema?: string;
|
||||
tabUid?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use TableFIeld
|
||||
*/
|
||||
export type QueryField = TableField
|
||||
|
||||
export interface QueryForeign {
|
||||
schema: string;
|
||||
table: string;
|
||||
field: string;
|
||||
position: number;
|
||||
constraintPosition: number;
|
||||
constraintName: string;
|
||||
refSchema: string;
|
||||
refTable: string;
|
||||
refField: string;
|
||||
onUpdate: string;
|
||||
onDelete: string;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export interface QueryResult<T = any> {
|
||||
rows: T[];
|
||||
report: { affectedRows: number };
|
||||
fields: QueryField[];
|
||||
keys: QueryForeign[];
|
||||
duration: number;
|
||||
}
|
92
src/common/interfaces/customizations.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
export interface Customizations {
|
||||
// Defaults
|
||||
defaultPort?: number;
|
||||
defaultUser?: string;
|
||||
defaultDatabase?: string;
|
||||
// Core
|
||||
database?: boolean;
|
||||
collations?: boolean;
|
||||
engines?: boolean;
|
||||
connectionSchema?: boolean;
|
||||
sslConnection?: boolean;
|
||||
sshConnection?: boolean;
|
||||
fileConnection?: boolean;
|
||||
cancelQueries?: boolean;
|
||||
// Tools
|
||||
processesList?: boolean;
|
||||
usersManagement?: boolean;
|
||||
variables?: boolean;
|
||||
// Structure
|
||||
schemas?: boolean;
|
||||
tables?: boolean;
|
||||
views?: boolean;
|
||||
triggers?: boolean;
|
||||
triggerFunctions?: boolean;
|
||||
routines?: boolean;
|
||||
functions?: boolean;
|
||||
schedulers?: boolean;
|
||||
// Settings
|
||||
elementsWrapper: string;
|
||||
stringsWrapper: string;
|
||||
tableAdd?: boolean;
|
||||
tableSettings?: boolean;
|
||||
tableOptions?: boolean;
|
||||
tableArray?: boolean;
|
||||
tableRealCount?: boolean;
|
||||
tableTruncateDisableFKCheck?: boolean;
|
||||
viewAdd?: boolean;
|
||||
viewSettings?: boolean;
|
||||
triggerAdd?: boolean;
|
||||
triggerFunctionAdd?: boolean;
|
||||
routineAdd?: boolean;
|
||||
functionAdd?: boolean;
|
||||
schedulerAdd?: boolean;
|
||||
databaseEdit?: boolean;
|
||||
schemaEdit?: boolean;
|
||||
schemaDrop?: boolean;
|
||||
schemaExport?: boolean;
|
||||
exportByChunks?: boolean;
|
||||
schemaImport?: boolean;
|
||||
triggerSettings?: boolean;
|
||||
triggerFunctionSettings?: boolean;
|
||||
routineSettings?: boolean;
|
||||
functionSettings?: boolean;
|
||||
schedulerSettings?: boolean;
|
||||
indexes?: boolean;
|
||||
foreigns?: boolean;
|
||||
sortableFields?: boolean;
|
||||
unsigned?: boolean;
|
||||
nullable?: boolean;
|
||||
nullablePrimary?: boolean;
|
||||
zerofill?: boolean;
|
||||
autoIncrement?: boolean;
|
||||
comment?: boolean;
|
||||
collation?: boolean;
|
||||
definer?: boolean;
|
||||
onUpdate?: boolean;
|
||||
viewAlgorithm?: boolean;
|
||||
viewSqlSecurity?: boolean;
|
||||
viewUpdateOption?: boolean;
|
||||
procedureDeterministic?: boolean;
|
||||
procedureDataAccess?: boolean;
|
||||
procedureSql?: string;
|
||||
procedureContext?: boolean;
|
||||
procedureLanguage?: boolean;
|
||||
functionDeterministic?: boolean;
|
||||
functionDataAccess?: boolean;
|
||||
functionSql?: string;
|
||||
functionContext?: boolean;
|
||||
functionLanguage?: boolean;
|
||||
triggerSql?: string;
|
||||
triggerStatementInCreation?: boolean;
|
||||
triggerMultipleEvents?: boolean;
|
||||
triggerTableInName?: boolean;
|
||||
triggerUpdateColumns?: boolean;
|
||||
triggerOnlyRename?: boolean;
|
||||
triggerEnableDisable?: boolean;
|
||||
triggerFunctionSql?: string;
|
||||
triggerFunctionlanguages?: string[];
|
||||
parametersLength?: boolean;
|
||||
languages?: string[];
|
||||
readOnlyMode?: boolean;
|
||||
}
|
28
src/common/interfaces/exporter.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
export interface TableParams {
|
||||
table: string;
|
||||
includeStructure: boolean;
|
||||
includeContent: boolean;
|
||||
includeDropStatement: boolean;
|
||||
}
|
||||
|
||||
export interface ExportOptions {
|
||||
schema: string;
|
||||
tables: {
|
||||
table: string;
|
||||
includeStructure: boolean;
|
||||
includeContent: boolean;
|
||||
includeDropStatement: boolean;
|
||||
}[];
|
||||
includes: {[key: string]: boolean};
|
||||
outputFormat: 'sql' | 'sql.zip';
|
||||
outputFile: string;
|
||||
sqlInsertAfter: number;
|
||||
sqlInsertDivider: 'bytes' | 'rows';
|
||||
}
|
||||
|
||||
export interface ExportState {
|
||||
totalItems?: number;
|
||||
currentItemIndex?: number;
|
||||
currentItem?: string;
|
||||
op?: string;
|
||||
}
|
16
src/common/interfaces/importer.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as antares from './antares';
|
||||
|
||||
export interface ImportOptions {
|
||||
uid: string;
|
||||
schema: string;
|
||||
type: antares.ClientCode;
|
||||
file: string;
|
||||
}
|
||||
|
||||
export interface ImportState {
|
||||
fileSize?: number;
|
||||
readPosition?: number;
|
||||
percentage?: number;
|
||||
queryCount?: number;
|
||||
op?: string;
|
||||
}
|
0
src/common/interfaces/parser.ts
Normal file
49
src/common/interfaces/tableApis.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { UsableLocale } from '@faker-js/faker';
|
||||
|
||||
export interface TableUpdateParams {
|
||||
uid: string;
|
||||
schema: string;
|
||||
table: string;
|
||||
primary?: string;
|
||||
id: number | string;
|
||||
content: number | string | boolean | Date | Blob | null;
|
||||
type: string;
|
||||
field: string;
|
||||
}
|
||||
|
||||
export interface TableDeleteParams {
|
||||
uid: string;
|
||||
schema: string;
|
||||
table: string;
|
||||
primary?: string;
|
||||
field: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
rows: {[key: string]: any};
|
||||
}
|
||||
|
||||
export interface TableFilterClausole {
|
||||
active: boolean;
|
||||
field: string;
|
||||
op: '=' | '!=' | '>' | '<' | '>=' | '<=' | 'IN' | 'NOT IN' | 'LIKE' | 'BETWEEN' | 'IS NULL' | 'IS NOT NULL';
|
||||
value: '';
|
||||
value2: '';
|
||||
}
|
||||
|
||||
export interface InsertRowsParams {
|
||||
uid: string;
|
||||
schema: string;
|
||||
table: string;
|
||||
row: {[key: string]: {
|
||||
group: string;
|
||||
method: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
params: any;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
value: any;
|
||||
length: number;
|
||||
};
|
||||
};
|
||||
repeat: number;
|
||||
fields: {[key: string]: string};
|
||||
locale: UsableLocale;
|
||||
}
|
7
src/common/interfaces/workers.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export type WorkerEvent = 'export-progress' | 'import-progress' | 'query-error' | 'end' | 'cancel' | 'error'
|
||||
|
||||
export interface WorkerIpcMessage {
|
||||
type: WorkerEvent;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
payload: any;
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
export function bufferToBase64 (buf) {
|
||||
const binstr = Array.prototype.map.call(buf, ch => {
|
||||
return String.fromCharCode(ch);
|
||||
}).join('');
|
||||
return btoa(binstr);
|
||||
}
|
6
src/common/libs/bufferToBase64.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export function bufferToBase64 (buf: Buffer) {
|
||||
const binstr = Array.prototype.map.call(buf, (ch: number) => {
|
||||
return String.fromCharCode(ch);
|
||||
}).join('');
|
||||
return Buffer.from(binstr, 'binary').toString('base64');
|
||||
}
|
@@ -1,5 +1,4 @@
|
||||
'use strict';
|
||||
export function formatBytes (bytes, decimals = 2) {
|
||||
export function formatBytes (bytes: number, decimals = 2) {
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
|
||||
const k = 1024;
|
6
src/common/libs/getArrayDepth.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
export function getArrayDepth (array: any[]): number {
|
||||
return Array.isArray(array)
|
||||
? 1 + Math.max(0, ...array.map(getArrayDepth))
|
||||
: 0;
|
||||
}
|
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const lookup = {
|
||||
0: '0000',
|
||||
1: '0001',
|
||||
@@ -23,17 +21,13 @@ const lookup = {
|
||||
D: '1101',
|
||||
E: '1110',
|
||||
F: '1111'
|
||||
};
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Converts hexadecimal string to binary string
|
||||
*
|
||||
* @param {string} hex Hexadecimal string
|
||||
* @returns {string} Binary string
|
||||
*/
|
||||
export default function hexToBinary (hex) {
|
||||
export type HexChar = keyof typeof lookup
|
||||
|
||||
export default function hexToBinary (hex: HexChar[]) {
|
||||
let binary = '';
|
||||
for (let i = 0, len = hex.length; i < len; i++)
|
||||
for (let i = 0; i < hex.length; i++)
|
||||
binary += lookup[hex[i]];
|
||||
|
||||
return binary;
|
192
src/common/libs/langDetector.ts
Normal file
@@ -0,0 +1,192 @@
|
||||
function isJSON (str: string) {
|
||||
try {
|
||||
if (!['{', '['].includes(str.trim()[0]))
|
||||
return false;
|
||||
|
||||
JSON.parse(str);
|
||||
return true;
|
||||
}
|
||||
catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isHTML (str: string) {
|
||||
const tags = [
|
||||
'a',
|
||||
'abbr',
|
||||
'address',
|
||||
'area',
|
||||
'article',
|
||||
'aside',
|
||||
'audio',
|
||||
'b',
|
||||
'base',
|
||||
'bdi',
|
||||
'bdo',
|
||||
'blockquote',
|
||||
'body',
|
||||
'br',
|
||||
'button',
|
||||
'canvas',
|
||||
'caption',
|
||||
'cite',
|
||||
'code',
|
||||
'col',
|
||||
'colgroup',
|
||||
'data',
|
||||
'datalist',
|
||||
'dd',
|
||||
'del',
|
||||
'details',
|
||||
'dfn',
|
||||
'dialog',
|
||||
'div',
|
||||
'dl',
|
||||
'dt',
|
||||
'em',
|
||||
'embed',
|
||||
'fieldset',
|
||||
'figcaption',
|
||||
'figure',
|
||||
'footer',
|
||||
'form',
|
||||
'h1',
|
||||
'h2',
|
||||
'h3',
|
||||
'h4',
|
||||
'h5',
|
||||
'h6',
|
||||
'head',
|
||||
'header',
|
||||
'hgroup',
|
||||
'hr',
|
||||
'html',
|
||||
'i',
|
||||
'iframe',
|
||||
'img',
|
||||
'input',
|
||||
'ins',
|
||||
'kbd',
|
||||
'label',
|
||||
'legend',
|
||||
'li',
|
||||
'link',
|
||||
'main',
|
||||
'map',
|
||||
'mark',
|
||||
'math',
|
||||
'menu',
|
||||
'menuitem',
|
||||
'meta',
|
||||
'meter',
|
||||
'nav',
|
||||
'noscript',
|
||||
'object',
|
||||
'ol',
|
||||
'optgroup',
|
||||
'option',
|
||||
'output',
|
||||
'p',
|
||||
'param',
|
||||
'picture',
|
||||
'pre',
|
||||
'progress',
|
||||
'q',
|
||||
'rb',
|
||||
'rp',
|
||||
'rt',
|
||||
'rtc',
|
||||
'ruby',
|
||||
's',
|
||||
'samp',
|
||||
'script',
|
||||
'section',
|
||||
'select',
|
||||
'slot',
|
||||
'small',
|
||||
'source',
|
||||
'span',
|
||||
'strong',
|
||||
'style',
|
||||
'sub',
|
||||
'summary',
|
||||
'sup',
|
||||
'svg',
|
||||
'table',
|
||||
'tbody',
|
||||
'td',
|
||||
'template',
|
||||
'textarea',
|
||||
'tfoot',
|
||||
'th',
|
||||
'thead',
|
||||
'time',
|
||||
'title',
|
||||
'tr',
|
||||
'track',
|
||||
'u',
|
||||
'ul',
|
||||
'var',
|
||||
'video',
|
||||
'wbr'
|
||||
];
|
||||
const doc = new DOMParser().parseFromString(str, 'text/html');
|
||||
const lowerStr = str.toLowerCase();
|
||||
if (Array.from(doc.body.childNodes).some(node => node.nodeType === 1))
|
||||
return tags.some((tag) => lowerStr.includes(`<${tag}>`));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isSVG (str: string) {
|
||||
const doc = new DOMParser().parseFromString(str, 'text/xml');
|
||||
const lowerStr = str.toLowerCase();
|
||||
const errorNode = doc.querySelector('parsererror');
|
||||
if (!errorNode)
|
||||
return lowerStr.includes('<svg');
|
||||
return false;
|
||||
}
|
||||
|
||||
function isXML (str: string) {
|
||||
const doc = new DOMParser().parseFromString(str, 'text/xml');
|
||||
const errorNode = doc.querySelector('parsererror');
|
||||
return !errorNode;
|
||||
}
|
||||
|
||||
function isMD (str: string) {
|
||||
const mdChecks = [
|
||||
'# ',
|
||||
'`',
|
||||
'- ',
|
||||
'+ ',
|
||||
'* ',
|
||||
'1. ',
|
||||
'**',
|
||||
'__',
|
||||
'~~',
|
||||
'>> ',
|
||||
'](http',
|
||||
'![',
|
||||
'[ ]',
|
||||
'[x]'
|
||||
];
|
||||
|
||||
return mdChecks.some((tag) => str.includes(tag));
|
||||
}
|
||||
|
||||
export function langDetector (str: string) {
|
||||
if (!str.trim().length)
|
||||
return 'text';
|
||||
if (isJSON(str))
|
||||
return 'json';
|
||||
if (isHTML(str))
|
||||
return 'html';
|
||||
if (isSVG(str))
|
||||
return 'svg';
|
||||
if (isXML(str))
|
||||
return 'xml';
|
||||
if (isMD(str))
|
||||
return 'markdown';
|
||||
return 'text';
|
||||
}
|
@@ -1,5 +1,4 @@
|
||||
'use strict';
|
||||
export function mimeFromHex (hex) {
|
||||
export function mimeFromHex (hex: string) {
|
||||
switch (hex.substring(0, 4)) { // 2 bytes
|
||||
case '424D':
|
||||
return { ext: 'bmp', mime: 'image/bmp' };
|
||||
@@ -43,4 +42,4 @@ export function mimeFromHex (hex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
/* eslint-disable no-useless-escape */
|
||||
// eslint-disable-next-line no-control-regex
|
||||
const regex = new RegExp(/[\0\x08\x09\x1a\n\r"'\\\%]/gm);
|
||||
|
||||
/**
|
||||
* Escapes a string
|
||||
*
|
||||
* @param {String} string
|
||||
* @returns {String}
|
||||
*/
|
||||
function sqlEscaper (string) {
|
||||
return string.replace(regex, char => {
|
||||
const m = ['\\0', '\\x08', '\\x09', '\\x1a', '\\n', '\\r', '\'', '"', '\\', '\\\\', '%'];
|
||||
const r = ['\\\\0', '\\\\b', '\\\\t', '\\\\z', '\\\\n', '\\\\r', '\'\'', '""', '\\\\', '\\\\\\\\', '\\%'];
|
||||
return r[m.indexOf(char)] || char;
|
||||
});
|
||||
}
|
||||
|
||||
export { sqlEscaper };
|
162
src/common/libs/sqlUtils.ts
Normal file
@@ -0,0 +1,162 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/* eslint-disable no-useless-escape */
|
||||
import * as moment from 'moment';
|
||||
import { lineString, point, polygon } from '@turf/helpers';
|
||||
import customizations from '../customizations';
|
||||
import { ClientCode } from '../interfaces/antares';
|
||||
import { BLOB, BIT, DATE, DATETIME, FLOAT, SPATIAL, IS_MULTI_SPATIAL, NUMBER, TEXT_SEARCH } from 'common/fieldTypes';
|
||||
import hexToBinary, { HexChar } from './hexToBinary';
|
||||
import { getArrayDepth } from './getArrayDepth';
|
||||
|
||||
/**
|
||||
* Escapes a string fo SQL use
|
||||
*
|
||||
* @param { String } string
|
||||
* @returns { String } Escaped string
|
||||
*/
|
||||
export const sqlEscaper = (string: string): string => {
|
||||
// eslint-disable-next-line no-control-regex
|
||||
const pattern = /[\0\x08\x09\x1a\n\r"'\\\%]/gm;
|
||||
const regex = new RegExp(pattern);
|
||||
return string.replace(regex, char => {
|
||||
const m = ['\\0', '\\x08', '\\x09', '\\x1a', '\\n', '\\r', '\'', '\"', '\\', '\\\\', '%'];
|
||||
const r = ['\\\\0', '\\\\b', '\\\\t', '\\\\z', '\\\\n', '\\\\r', '\\\'', '\\\"', '\\\\', '\\\\\\\\', '\%'];
|
||||
return r[m.indexOf(char)] || char;
|
||||
});
|
||||
};
|
||||
|
||||
export const objectToGeoJSON = (val: any) => {
|
||||
if (Array.isArray(val)) {
|
||||
if (getArrayDepth(val) === 1)
|
||||
return lineString(val.reduce((acc, curr) => [...acc, [curr.x, curr.y]], []));
|
||||
else
|
||||
return polygon(val.map(arr => arr.reduce((acc: any, curr: any) => [...acc, [curr.x, curr.y]], [])));
|
||||
}
|
||||
else
|
||||
return point([val.x, val.y]);
|
||||
};
|
||||
|
||||
export const escapeAndQuote = (val: string, client: ClientCode) => {
|
||||
const { stringsWrapper: sw } = customizations[client];
|
||||
// eslint-disable-next-line no-control-regex
|
||||
const CHARS_TO_ESCAPE = /[\0\b\t\n\r\x1a"'\\]/g;
|
||||
const CHARS_ESCAPE_MAP: {[key: string]: string} = {
|
||||
'\0': '\\0',
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\r': '\\r',
|
||||
'\x1a': '\\Z',
|
||||
'"': '\\"',
|
||||
'\'': '\\\'',
|
||||
'\\': '\\\\'
|
||||
};
|
||||
let chunkIndex = CHARS_TO_ESCAPE.lastIndex = 0;
|
||||
let escapedVal = '';
|
||||
let match;
|
||||
|
||||
while ((match = CHARS_TO_ESCAPE.exec(val))) {
|
||||
escapedVal += val.slice(chunkIndex, match.index) + CHARS_ESCAPE_MAP[match[0]];
|
||||
chunkIndex = CHARS_TO_ESCAPE.lastIndex;
|
||||
}
|
||||
|
||||
if (chunkIndex === 0)
|
||||
return `${sw}${val}${sw}`;
|
||||
|
||||
if (chunkIndex < val.length)
|
||||
return `${sw}${escapedVal + val.slice(chunkIndex)}${sw}`;
|
||||
|
||||
return `${sw}${escapedVal}${sw}`;
|
||||
};
|
||||
|
||||
export const valueToSqlString = (args: {
|
||||
val: any;
|
||||
client: ClientCode;
|
||||
field: {type: string; datePrecision: number};
|
||||
}): string => {
|
||||
let parsedValue;
|
||||
const { val, client, field } = args;
|
||||
const { stringsWrapper: sw } = customizations[client];
|
||||
|
||||
if (val === null)
|
||||
parsedValue = 'NULL';
|
||||
else if (DATE.includes(field.type)) {
|
||||
parsedValue = moment(val).isValid()
|
||||
? escapeAndQuote(moment(val).format('YYYY-MM-DD'), client)
|
||||
: val;
|
||||
}
|
||||
else if (DATETIME.includes(field.type)) {
|
||||
let datePrecision = '';
|
||||
for (let i = 0; i < field.datePrecision; i++)
|
||||
datePrecision += i === 0 ? '.S' : 'S';
|
||||
|
||||
parsedValue = moment(val).isValid()
|
||||
? escapeAndQuote(moment(val).format(`YYYY-MM-DD HH:mm:ss${datePrecision}`), client)
|
||||
: escapeAndQuote(val, client);
|
||||
}
|
||||
else if ('isArray' in field) {
|
||||
let localVal;
|
||||
if (Array.isArray(val))
|
||||
localVal = JSON.stringify(val).replaceAll('[', '{').replaceAll(']', '}');
|
||||
else
|
||||
localVal = typeof val === 'string' ? val.replaceAll('[', '{').replaceAll(']', '}') : '';
|
||||
parsedValue = `'${localVal}'`;
|
||||
}
|
||||
else if (TEXT_SEARCH.includes(field.type))
|
||||
parsedValue = `'${val.replaceAll('\'', '\'\'')}'`;
|
||||
else if (BIT.includes(field.type))
|
||||
parsedValue = `b'${hexToBinary(Buffer.from(val).toString('hex') as undefined as HexChar[])}'`;
|
||||
else if (BLOB.includes(field.type)) {
|
||||
if (['mysql', 'maria'].includes(client))
|
||||
parsedValue = `X'${val.toString('hex').toUpperCase()}'`;
|
||||
else if (client === 'pg')
|
||||
parsedValue = `decode('${val.toString('hex').toUpperCase()}', 'hex')`;
|
||||
}
|
||||
else if (NUMBER.includes(field.type))
|
||||
parsedValue = val;
|
||||
else if (FLOAT.includes(field.type))
|
||||
parsedValue = parseFloat(val);
|
||||
else if (SPATIAL.includes(field.type)) {
|
||||
let geoJson;
|
||||
if (IS_MULTI_SPATIAL.includes(field.type)) {
|
||||
const features = [];
|
||||
for (const element of val)
|
||||
features.push(objectToGeoJSON(element));
|
||||
|
||||
geoJson = {
|
||||
type: 'FeatureCollection',
|
||||
features
|
||||
};
|
||||
}
|
||||
else
|
||||
geoJson = objectToGeoJSON(val);
|
||||
|
||||
parsedValue = `ST_GeomFromGeoJSON('${JSON.stringify(geoJson)}')`;
|
||||
}
|
||||
else if (val === '') parsedValue = `${sw}${sw}`;
|
||||
else {
|
||||
parsedValue = typeof val === 'string'
|
||||
? escapeAndQuote(val, client)
|
||||
: typeof val === 'object'
|
||||
? escapeAndQuote(JSON.stringify(val), client)
|
||||
: val;
|
||||
}
|
||||
|
||||
return parsedValue;
|
||||
};
|
||||
|
||||
export const jsonToSqlInsert = (args: {
|
||||
json: { [key: string]: any};
|
||||
client: ClientCode;
|
||||
fields: { [key: string]: {type: string; datePrecision: number}};
|
||||
table: string;
|
||||
}) => {
|
||||
const { client, json, fields, table } = args;
|
||||
const { elementsWrapper: ew } = customizations[client];
|
||||
const fieldNames = Object.keys(json).map(key => `${ew}${key}${ew}`);
|
||||
const values = Object.keys(json).map(key => (
|
||||
valueToSqlString({ val: json[key], client, field: fields[key] })
|
||||
));
|
||||
|
||||
return `INSERT INTO ${ew}${table}${ew} (${fieldNames.join(', ')}) VALUES (${values.join(', ')});`;
|
||||
};
|
@@ -1,8 +0,0 @@
|
||||
/**
|
||||
* @export
|
||||
* @param {String} [prefix]
|
||||
* @returns {String} Unique ID
|
||||
*/
|
||||
export function uidGen (prefix) {
|
||||
return (prefix ? `${prefix}:` : '') + Math.random().toString(36).substr(2, 9).toUpperCase();
|
||||
};
|
3
src/common/libs/uidGen.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function uidGen (prefix?: string) {
|
||||
return (prefix ? `${prefix}:` : '') + Math.random().toString(36).substr(2, 9).toUpperCase();
|
||||
}
|
138
src/common/shortcuts.ts
Normal file
@@ -0,0 +1,138 @@
|
||||
export const shortcutEvents: { [key: string]: { l18n: string; l18nParam?: string | number; context?: 'tab' }} = {
|
||||
'run-or-reload': { l18n: 'message.runOrReload', context: 'tab' },
|
||||
'open-new-tab': { l18n: 'message.openNewTab', context: 'tab' },
|
||||
'close-tab': { l18n: 'message.closeTab', context: 'tab' },
|
||||
'format-query': { l18n: 'message.formatQuery', context: 'tab' },
|
||||
'kill-query': { l18n: 'message.killQuery', context: 'tab' },
|
||||
'query-history': { l18n: 'message.queryHistory', context: 'tab' },
|
||||
'clear-query': { l18n: 'message.clearQuery', context: 'tab' },
|
||||
'next-tab': { l18n: 'message.nextTab' },
|
||||
'prev-tab': { l18n: 'message.previousTab' },
|
||||
'open-all-connections': { l18n: 'message.openAllConnections' },
|
||||
'open-filter': { l18n: 'message.openFilter' },
|
||||
'next-page': { l18n: 'message.nextResultsPage' },
|
||||
'prev-page': { l18n: 'message.previousResultsPage' },
|
||||
'toggle-console': { l18n: 'message.toggleConsole' },
|
||||
'save-content': { l18n: 'message.saveContent' },
|
||||
'create-connection': { l18n: 'message.createNewConnection' },
|
||||
'open-settings': { l18n: 'message.openSettings' },
|
||||
'open-scratchpad': { l18n: 'message.openScratchpad' }
|
||||
};
|
||||
|
||||
interface ShortcutRecord {
|
||||
event: string;
|
||||
keys: Electron.Accelerator[] | string[];
|
||||
/** Needed for default shortcuts */
|
||||
os: NodeJS.Platform[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Default shortcuts
|
||||
*/
|
||||
const shortcuts: ShortcutRecord[] = [
|
||||
{
|
||||
event: 'run-or-reload',
|
||||
keys: ['F5'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'save-content',
|
||||
keys: ['CommandOrControl+S'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'kill-query',
|
||||
keys: ['CommandOrControl+K'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'format-query',
|
||||
keys: ['CommandOrControl+B'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'clear-query',
|
||||
keys: ['CommandOrControl+Alt+W'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'query-history',
|
||||
keys: ['CommandOrControl+G'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'open-new-tab',
|
||||
keys: ['CommandOrControl+T'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'close-tab',
|
||||
keys: ['CommandOrControl+W'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'next-tab',
|
||||
keys: ['Alt+CommandOrControl+Right'],
|
||||
os: ['darwin', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'prev-tab',
|
||||
keys: ['Alt+CommandOrControl+Left'],
|
||||
os: ['darwin', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'next-tab',
|
||||
keys: ['CommandOrControl+PageDown'],
|
||||
os: ['linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'prev-tab',
|
||||
keys: ['CommandOrControl+PageUp'],
|
||||
os: ['linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'open-filter',
|
||||
keys: ['CommandOrControl+F'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'next-page',
|
||||
keys: ['CommandOrControl+Right'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'prev-page',
|
||||
keys: ['CommandOrControl+Left'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'open-all-connections',
|
||||
keys: ['Shift+CommandOrControl+Space'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'toggle-console',
|
||||
keys: ['CommandOrControl+F12'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
},
|
||||
{
|
||||
event: 'toggle-console',
|
||||
keys: ['CommandOrControl+`'],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
}
|
||||
];
|
||||
|
||||
for (let i = 1; i <= 9; i++) {
|
||||
shortcutEvents[`select-tab-${i}`] = {
|
||||
l18n: 'message.selectTabNumber',
|
||||
l18nParam: i
|
||||
};
|
||||
|
||||
shortcuts.push({
|
||||
event: `select-tab-${i}`,
|
||||
keys: [`CommandOrControl+${i}`],
|
||||
os: ['darwin', 'linux', 'win32']
|
||||
});
|
||||
}
|
||||
|
||||
export { shortcuts, ShortcutRecord };
|
@@ -1,95 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import { app, BrowserWindow, nativeImage } from 'electron';
|
||||
import * as path from 'path';
|
||||
import { format as formatUrl } from 'url';
|
||||
import ipcHandlers from './ipc-handlers';
|
||||
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||
const gotTheLock = app.requestSingleInstanceLock();
|
||||
|
||||
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true';
|
||||
|
||||
// global reference to mainWindow (necessary to prevent window from being garbage collected)
|
||||
let mainWindow;
|
||||
|
||||
async function createMainWindow () {
|
||||
const icon = require('../renderer/images/logo-32.png');
|
||||
const window = new BrowserWindow({
|
||||
width: 1024,
|
||||
height: 800,
|
||||
minWidth: 900,
|
||||
minHeight: 550,
|
||||
title: 'Antares',
|
||||
autoHideMenuBar: true,
|
||||
icon: nativeImage.createFromDataURL(icon.default),
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
'web-security': false,
|
||||
enableRemoteModule: true,
|
||||
spellcheck: false
|
||||
},
|
||||
frame: false,
|
||||
backgroundColor: '#1d1d1d'
|
||||
});
|
||||
|
||||
if (isDevelopment) {
|
||||
await window.loadURL(`http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT}`);
|
||||
|
||||
const { default: installExtension, VUEJS_DEVTOOLS } = require('electron-devtools-installer');
|
||||
window.webContents.openDevTools();
|
||||
|
||||
installExtension(VUEJS_DEVTOOLS)
|
||||
.then(name => {
|
||||
console.log(name, 'installed');
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
else {
|
||||
await window.loadURL(formatUrl({
|
||||
pathname: path.join(__dirname, 'index.html'),
|
||||
protocol: 'file',
|
||||
slashes: true
|
||||
}));
|
||||
}
|
||||
|
||||
window.on('closed', () => {
|
||||
mainWindow = null;
|
||||
});
|
||||
|
||||
window.webContents.on('devtools-opened', () => {
|
||||
window.focus();
|
||||
setImmediate(() => {
|
||||
window.focus();
|
||||
});
|
||||
});
|
||||
|
||||
return window;
|
||||
};
|
||||
|
||||
if (!gotTheLock)
|
||||
app.quit();
|
||||
else {
|
||||
// Initialize ipcHandlers
|
||||
ipcHandlers();
|
||||
|
||||
// quit application when all windows are closed
|
||||
app.on('window-all-closed', () => {
|
||||
// on macOS it is common for applications to stay open until the user explicitly quits
|
||||
if (process.platform !== 'darwin')
|
||||
app.quit();
|
||||
});
|
||||
|
||||
app.on('activate', () => {
|
||||
// on macOS it is common to re-create a window even after all windows have been closed
|
||||
if (mainWindow === null)
|
||||
mainWindow = createMainWindow();
|
||||
});
|
||||
|
||||
// create main BrowserWindow when electron is ready
|
||||
app.on('ready', () => {
|
||||
mainWindow = createMainWindow();
|
||||
});
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
import { app, ipcMain } from 'electron';
|
||||
|
||||
export default () => {
|
||||
ipcMain.on('close-app', () => {
|
||||
app.exit();
|
||||
});
|
||||
};
|
36
src/main/ipc-handlers/application.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { app, ipcMain, dialog } from 'electron';
|
||||
import { ShortcutRegister } from '../libs/ShortcutRegister';
|
||||
|
||||
export default () => {
|
||||
ipcMain.on('close-app', () => {
|
||||
app.exit();
|
||||
});
|
||||
|
||||
ipcMain.handle('show-open-dialog', (event, options) => {
|
||||
return dialog.showOpenDialog(options);
|
||||
});
|
||||
|
||||
ipcMain.handle('get-download-dir-path', () => {
|
||||
return app.getPath('downloads');
|
||||
});
|
||||
|
||||
ipcMain.handle('resotre-default-shortcuts', () => {
|
||||
const shortCutRegister = ShortcutRegister.getInstance();
|
||||
shortCutRegister.restoreDefaults();
|
||||
});
|
||||
|
||||
ipcMain.handle('reload-shortcuts', () => {
|
||||
const shortCutRegister = ShortcutRegister.getInstance();
|
||||
shortCutRegister.reload();
|
||||
});
|
||||
|
||||
ipcMain.handle('update-shortcuts', (event, shortcuts) => {
|
||||
const shortCutRegister = ShortcutRegister.getInstance();
|
||||
shortCutRegister.updateShortcuts(shortcuts);
|
||||
});
|
||||
|
||||
ipcMain.handle('unregister-shortcuts', () => {
|
||||
const shortCutRegister = ShortcutRegister.getInstance();
|
||||
shortCutRegister.unregister();
|
||||
});
|
||||
};
|
@@ -1,64 +0,0 @@
|
||||
|
||||
import { ipcMain } from 'electron';
|
||||
import { ClientsFactory } from '../libs/ClientsFactory';
|
||||
|
||||
export default connections => {
|
||||
ipcMain.handle('test-connection', async (event, conn) => {
|
||||
const connection = ClientsFactory.getConnection({
|
||||
client: conn.client,
|
||||
params: {
|
||||
host: conn.host,
|
||||
port: +conn.port,
|
||||
user: conn.user,
|
||||
password: conn.password
|
||||
}
|
||||
});
|
||||
|
||||
await connection.connect();
|
||||
|
||||
try {
|
||||
await connection.select('1+1').run();
|
||||
connection.destroy();
|
||||
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('check-connection', async (event, uid) => {
|
||||
return uid in connections;
|
||||
});
|
||||
|
||||
ipcMain.handle('connect', async (event, conn) => {
|
||||
const connection = ClientsFactory.getConnection({
|
||||
client: conn.client,
|
||||
params: {
|
||||
host: conn.host,
|
||||
port: +conn.port,
|
||||
user: conn.user,
|
||||
password: conn.password
|
||||
},
|
||||
poolSize: 1
|
||||
});
|
||||
|
||||
try {
|
||||
await connection.connect();
|
||||
|
||||
const structure = await connection.getStructure();
|
||||
|
||||
connections[conn.uid] = connection;
|
||||
|
||||
return { status: 'success', response: structure };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('disconnect', (event, uid) => {
|
||||
connections[uid].destroy();
|
||||
delete connections[uid];
|
||||
});
|
||||
};
|
155
src/main/ipc-handlers/connection.ts
Normal file
@@ -0,0 +1,155 @@
|
||||
import * as antares from 'common/interfaces/antares';
|
||||
import * as fs from 'fs';
|
||||
import { ipcMain } from 'electron';
|
||||
import { ClientsFactory } from '../libs/ClientsFactory';
|
||||
import { SslOptions } from 'mysql2';
|
||||
|
||||
export default (connections: {[key: string]: antares.Client}) => {
|
||||
ipcMain.handle('test-connection', async (event, conn: antares.ConnectionParams) => {
|
||||
const params = {
|
||||
host: conn.host,
|
||||
port: +conn.port,
|
||||
user: conn.user,
|
||||
password: conn.password,
|
||||
readonly: conn.readonly,
|
||||
database: '',
|
||||
schema: '',
|
||||
databasePath: '',
|
||||
ssl: undefined as SslOptions,
|
||||
ssh: undefined as {
|
||||
host: string;
|
||||
username: string;
|
||||
password: string;
|
||||
port: number;
|
||||
privateKey: string;
|
||||
passphrase: string;
|
||||
}
|
||||
};
|
||||
|
||||
if (conn.database)
|
||||
params.database = conn.database;
|
||||
|
||||
if (conn.databasePath)
|
||||
params.databasePath = conn.databasePath;
|
||||
|
||||
if (conn.ssl) {
|
||||
params.ssl = {
|
||||
key: conn.key ? fs.readFileSync(conn.key).toString() : null,
|
||||
cert: conn.cert ? fs.readFileSync(conn.cert).toString() : null,
|
||||
ca: conn.ca ? fs.readFileSync(conn.ca).toString() : null,
|
||||
ciphers: conn.ciphers,
|
||||
rejectUnauthorized: !conn.untrustedConnection
|
||||
};
|
||||
}
|
||||
|
||||
if (conn.ssh) {
|
||||
params.ssh = {
|
||||
host: conn.sshHost,
|
||||
username: conn.sshUser,
|
||||
password: conn.sshPass,
|
||||
port: conn.sshPort ? conn.sshPort : 22,
|
||||
privateKey: conn.sshKey ? fs.readFileSync(conn.sshKey).toString() : null,
|
||||
passphrase: conn.sshPassphrase
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const connection = await ClientsFactory.getClient({
|
||||
uid: conn.uid,
|
||||
client: conn.client,
|
||||
params
|
||||
});
|
||||
await connection.connect();
|
||||
|
||||
await connection.select('1+1').run();
|
||||
connection.destroy();
|
||||
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('check-connection', async (event, uid) => {
|
||||
return uid in connections;
|
||||
});
|
||||
|
||||
ipcMain.handle('connect', async (event, conn: antares.ConnectionParams) => {
|
||||
const params = {
|
||||
host: conn.host,
|
||||
port: +conn.port,
|
||||
user: conn.user,
|
||||
password: conn.password,
|
||||
application_name: 'Antares SQL',
|
||||
readonly: conn.readonly,
|
||||
database: '',
|
||||
schema: '',
|
||||
databasePath: '',
|
||||
ssl: undefined as SslOptions,
|
||||
ssh: undefined as {
|
||||
host: string;
|
||||
username: string;
|
||||
password: string;
|
||||
port: number;
|
||||
privateKey: string;
|
||||
passphrase: string;
|
||||
}
|
||||
};
|
||||
|
||||
if (conn.database)
|
||||
params.database = conn.database;
|
||||
|
||||
if (conn.databasePath)
|
||||
params.databasePath = conn.databasePath;
|
||||
|
||||
if (conn.schema)
|
||||
params.schema = conn.schema;
|
||||
|
||||
if (conn.ssl) {
|
||||
params.ssl = {
|
||||
key: conn.key ? fs.readFileSync(conn.key).toString() : null,
|
||||
cert: conn.cert ? fs.readFileSync(conn.cert).toString() : null,
|
||||
ca: conn.ca ? fs.readFileSync(conn.ca).toString() : null,
|
||||
ciphers: conn.ciphers,
|
||||
rejectUnauthorized: !conn.untrustedConnection
|
||||
};
|
||||
}
|
||||
|
||||
if (conn.ssh) {
|
||||
params.ssh = {
|
||||
host: conn.sshHost,
|
||||
username: conn.sshUser,
|
||||
password: conn.sshPass,
|
||||
port: conn.sshPort ? conn.sshPort : 22,
|
||||
privateKey: conn.sshKey ? fs.readFileSync(conn.sshKey).toString() : null,
|
||||
passphrase: conn.sshPassphrase
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const connection = ClientsFactory.getClient({
|
||||
uid: conn.uid,
|
||||
client: conn.client,
|
||||
params,
|
||||
poolSize: 5
|
||||
});
|
||||
|
||||
await connection.connect();
|
||||
|
||||
const structure = await connection.getStructure(new Set());
|
||||
|
||||
connections[conn.uid] = connection;
|
||||
|
||||
return { status: 'success', response: structure };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('disconnect', (event, uid) => {
|
||||
connections[uid].destroy();
|
||||
delete connections[uid];
|
||||
});
|
||||
};
|
@@ -1,110 +0,0 @@
|
||||
|
||||
import { ipcMain } from 'electron';
|
||||
|
||||
export default connections => {
|
||||
ipcMain.handle('create-database', async (event, params) => {
|
||||
try {
|
||||
const query = `CREATE DATABASE \`${params.name}\` COLLATE ${params.collation}`;
|
||||
await connections[params.uid].raw(query);
|
||||
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('update-database', async (event, params) => {
|
||||
try {
|
||||
const query = `ALTER DATABASE \`${params.name}\` COLLATE ${params.collation}`;
|
||||
await connections[params.uid].raw(query);
|
||||
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('delete-database', async (event, params) => {
|
||||
try {
|
||||
const query = `DROP DATABASE \`${params.database}\``;
|
||||
await connections[params.uid].raw(query);
|
||||
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-database-collation', async (event, params) => {
|
||||
try {
|
||||
const query = `SELECT \`DEFAULT_COLLATION_NAME\` FROM \`information_schema\`.\`SCHEMATA\` WHERE \`SCHEMA_NAME\`='${params.database}'`;
|
||||
const collation = await connections[params.uid].raw(query);
|
||||
|
||||
return { status: 'success', response: collation.rows.length ? collation.rows[0].DEFAULT_COLLATION_NAME : '' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-structure', async (event, uid) => {
|
||||
try {
|
||||
const structure = await connections[uid].getStructure();
|
||||
|
||||
return { status: 'success', response: structure };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-collations', async (event, uid) => {
|
||||
try {
|
||||
const result = await connections[uid].getCollations();
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-variables', async (event, uid) => {
|
||||
try {
|
||||
const result = await connections[uid].getVariables();
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('use-schema', async (event, { uid, schema }) => {
|
||||
if (!schema) return;
|
||||
|
||||
try {
|
||||
await connections[uid].use(schema);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('raw-query', async (event, { uid, query, schema }) => {
|
||||
if (!query) return;
|
||||
|
||||
try {
|
||||
const result = await connections[uid].raw(query, true);
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
};
|
64
src/main/ipc-handlers/functions.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import * as antares from 'common/interfaces/antares';
|
||||
import { ipcMain } from 'electron';
|
||||
|
||||
export default (connections: {[key: string]: antares.Client}) => {
|
||||
ipcMain.handle('get-function-informations', async (event, params) => {
|
||||
try {
|
||||
const result = await connections[params.uid].getFunctionInformations(params);
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('drop-function', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].dropFunction(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('alter-function', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].alterFunction(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('alter-trigger-function', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].alterTriggerFunction(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('create-function', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].createFunction(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('create-trigger-function', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].createTriggerFunction(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
};
|
@@ -1,15 +0,0 @@
|
||||
import connection from './connection';
|
||||
import tables from './tables';
|
||||
import updates from './updates';
|
||||
import application from './application';
|
||||
import database from './database';
|
||||
|
||||
const connections = {};
|
||||
|
||||
export default () => {
|
||||
connection(connections);
|
||||
tables(connections);
|
||||
database(connections);
|
||||
updates();
|
||||
application();
|
||||
};
|
29
src/main/ipc-handlers/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import * as antares from 'common/interfaces/antares';
|
||||
|
||||
import connection from './connection';
|
||||
import tables from './tables';
|
||||
import views from './views';
|
||||
import triggers from './triggers';
|
||||
import routines from './routines';
|
||||
import functions from './functions';
|
||||
import schedulers from './schedulers';
|
||||
import updates from './updates';
|
||||
import application from './application';
|
||||
import schema from './schema';
|
||||
import users from './users';
|
||||
|
||||
const connections: {[key: string]: antares.Client} = {};
|
||||
|
||||
export default () => {
|
||||
connection(connections);
|
||||
tables(connections);
|
||||
views(connections);
|
||||
triggers(connections);
|
||||
routines(connections);
|
||||
functions(connections);
|
||||
schedulers(connections);
|
||||
schema(connections);
|
||||
users(connections);
|
||||
updates();
|
||||
application();
|
||||
};
|
44
src/main/ipc-handlers/routines.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import * as antares from 'common/interfaces/antares';
|
||||
import { ipcMain } from 'electron';
|
||||
|
||||
export default (connections: {[key: string]: antares.Client}) => {
|
||||
ipcMain.handle('get-routine-informations', async (event, params) => {
|
||||
try {
|
||||
const result = await connections[params.uid].getRoutineInformations(params);
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('drop-routine', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].dropRoutine(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('alter-routine', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].alterRoutine(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('create-routine', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].createRoutine(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
};
|
57
src/main/ipc-handlers/schedulers.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import * as antares from 'common/interfaces/antares';
|
||||
import { ipcMain } from 'electron';
|
||||
|
||||
export default (connections: {[key: string]: antares.Client}) => {
|
||||
ipcMain.handle('get-scheduler-informations', async (event, params) => {
|
||||
try {
|
||||
const result = await connections[params.uid].getEventInformations(params);
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('drop-scheduler', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].dropEvent(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('alter-scheduler', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].alterEvent(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('create-scheduler', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].createEvent(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('toggle-scheduler', async (event, params) => {
|
||||
try {
|
||||
if (!params.enabled)
|
||||
await connections[params.uid].enableEvent({ ...params });
|
||||
else
|
||||
await connections[params.uid].disableEvent({ ...params });
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
};
|
390
src/main/ipc-handlers/schema.ts
Normal file
@@ -0,0 +1,390 @@
|
||||
import * as antares from 'common/interfaces/antares';
|
||||
import * as workers from 'common/interfaces/workers';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { ChildProcess, fork } from 'child_process';
|
||||
import { ipcMain, dialog } from 'electron';
|
||||
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||
|
||||
export default (connections: {[key: string]: antares.Client}) => {
|
||||
let exporter: ChildProcess = null;
|
||||
let importer: ChildProcess = null;
|
||||
|
||||
ipcMain.handle('create-schema', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].createSchema(params);
|
||||
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('update-schema', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].alterSchema(params);
|
||||
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('delete-schema', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].dropSchema(params);
|
||||
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-schema-collation', async (event, params) => {
|
||||
try {
|
||||
const collation = await connections[params.uid].getDatabaseCollation(
|
||||
params
|
||||
);
|
||||
|
||||
return {
|
||||
status: 'success',
|
||||
response: collation
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-structure', async (event, params) => {
|
||||
try {
|
||||
const structure = await connections[params.uid].getStructure(
|
||||
params.schemas
|
||||
);
|
||||
|
||||
return { status: 'success', response: structure };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-collations', async (event, uid) => {
|
||||
try {
|
||||
const result = await connections[uid].getCollations();
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-variables', async (event, uid) => {
|
||||
try {
|
||||
const result = await connections[uid].getVariables();
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-engines', async (event, uid) => {
|
||||
try {
|
||||
const result = await connections[uid].getEngines();
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-version', async (event, uid) => {
|
||||
try {
|
||||
const result = await connections[uid].getVersion();
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-processes', async (event, uid) => {
|
||||
try {
|
||||
const result = await connections[uid].getProcesses();
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('kill-process', async (event, { uid, pid }) => {
|
||||
try {
|
||||
const result = await connections[uid].killProcess(pid);
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('use-schema', async (event, { uid, schema }) => {
|
||||
if (!schema) return;
|
||||
|
||||
try {
|
||||
await connections[uid].use(schema);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('raw-query', async (event, { uid, query, schema, tabUid, autocommit }) => {
|
||||
if (!query) return;
|
||||
|
||||
try {
|
||||
const result = await connections[uid].raw(query, {
|
||||
nest: true,
|
||||
details: true,
|
||||
schema,
|
||||
tabUid,
|
||||
autocommit,
|
||||
comments: false
|
||||
});
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('export', (event, { uid, type, tables, ...rest }) => {
|
||||
if (exporter !== null) {
|
||||
exporter.kill();
|
||||
return;
|
||||
}
|
||||
|
||||
return new Promise((resolve/*, reject */) => {
|
||||
(async () => {
|
||||
if (fs.existsSync(rest.outputFile)) { // If file exists ask for replace
|
||||
const result = await dialog.showMessageBox({
|
||||
type: 'warning',
|
||||
message: `File ${rest.outputFile} already exists. Do you want to replace it?`,
|
||||
detail: 'A file with the same name already exists in the target folder. Replacing it will overwrite its current contents.',
|
||||
buttons: ['Cancel', 'Replace'],
|
||||
defaultId: 0,
|
||||
cancelId: 0
|
||||
});
|
||||
|
||||
if (result.response !== 1) {
|
||||
resolve({
|
||||
type: 'error',
|
||||
response: 'Operation aborted'
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Init exporter process
|
||||
exporter = fork(isDevelopment ? './dist/exporter.js' : path.resolve(__dirname, './exporter.js'), [], {
|
||||
execArgv: isDevelopment ? ['--inspect=9224'] : undefined
|
||||
});
|
||||
exporter.send({
|
||||
type: 'init',
|
||||
client: {
|
||||
name: type,
|
||||
config: await connections[uid].getDbConfig()
|
||||
},
|
||||
tables,
|
||||
options: rest
|
||||
});
|
||||
|
||||
// Exporter message listener
|
||||
exporter.on('message', ({ type, payload }: workers.WorkerIpcMessage) => {
|
||||
switch (type) {
|
||||
case 'export-progress':
|
||||
event.sender.send('export-progress', payload);
|
||||
break;
|
||||
case 'end':
|
||||
setTimeout(() => { // Ensures that writing process has finished
|
||||
exporter.kill();
|
||||
exporter = null;
|
||||
}, 2000);
|
||||
resolve({ status: 'success', response: payload });
|
||||
break;
|
||||
case 'cancel':
|
||||
exporter.kill();
|
||||
exporter = null;
|
||||
resolve({ status: 'error', response: 'Operation cancelled' });
|
||||
break;
|
||||
case 'error':
|
||||
exporter.kill();
|
||||
exporter = null;
|
||||
resolve({ status: 'error', response: payload });
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
exporter.on('exit', code => {
|
||||
exporter = null;
|
||||
resolve({ status: 'error', response: `Operation ended with code: ${code}` });
|
||||
});
|
||||
})();
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.handle('abort-export', async () => {
|
||||
let willAbort = false;
|
||||
|
||||
if (exporter) {
|
||||
const result = await dialog.showMessageBox({
|
||||
type: 'warning',
|
||||
message: 'Are you sure you want to abort the export',
|
||||
buttons: ['Cancel', 'Abort'],
|
||||
defaultId: 0,
|
||||
cancelId: 0
|
||||
});
|
||||
|
||||
if (result.response === 1) {
|
||||
willAbort = true;
|
||||
exporter.send({ type: 'cancel' });
|
||||
}
|
||||
}
|
||||
|
||||
return { status: 'success', response: { willAbort } };
|
||||
});
|
||||
|
||||
ipcMain.handle('import-sql', async (event, options) => {
|
||||
if (importer !== null) {
|
||||
importer.kill();
|
||||
return;
|
||||
}
|
||||
|
||||
return new Promise((resolve/*, reject */) => {
|
||||
(async () => {
|
||||
const dbConfig = await connections[options.uid].getDbConfig();
|
||||
|
||||
// Init importer process
|
||||
importer = fork(isDevelopment ? './dist/importer.js' : path.resolve(__dirname, './importer.js'), [], {
|
||||
execArgv: isDevelopment ? ['--inspect=9224'] : undefined
|
||||
});
|
||||
importer.send({
|
||||
type: 'init',
|
||||
dbConfig,
|
||||
options
|
||||
});
|
||||
|
||||
// Importer message listener
|
||||
importer.on('message', ({ type, payload }: workers.WorkerIpcMessage) => {
|
||||
switch (type) {
|
||||
case 'import-progress':
|
||||
event.sender.send('import-progress', payload);
|
||||
break;
|
||||
case 'query-error':
|
||||
event.sender.send('query-error', payload);
|
||||
break;
|
||||
case 'end':
|
||||
setTimeout(() => { // Ensures that writing process has finished
|
||||
importer?.kill();
|
||||
importer = null;
|
||||
}, 2000);
|
||||
resolve({ status: 'success', response: payload });
|
||||
break;
|
||||
case 'cancel':
|
||||
importer.kill();
|
||||
importer = null;
|
||||
resolve({ status: 'error', response: 'Operation cancelled' });
|
||||
break;
|
||||
case 'error':
|
||||
importer.kill();
|
||||
importer = null;
|
||||
resolve({ status: 'error', response: payload });
|
||||
break;
|
||||
}
|
||||
});
|
||||
})();
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.handle('abort-import-sql', async () => {
|
||||
let willAbort = false;
|
||||
|
||||
if (importer) {
|
||||
const result = await dialog.showMessageBox({
|
||||
type: 'warning',
|
||||
message: 'Are you sure you want to abort the import',
|
||||
buttons: ['Cancel', 'Abort'],
|
||||
defaultId: 0,
|
||||
cancelId: 0
|
||||
});
|
||||
|
||||
if (result.response === 1) {
|
||||
willAbort = true;
|
||||
importer.send({ type: 'cancel' });
|
||||
}
|
||||
}
|
||||
|
||||
return { status: 'success', response: { willAbort } };
|
||||
});
|
||||
|
||||
ipcMain.handle('kill-tab-query', async (event, { uid, tabUid }) => {
|
||||
if (!tabUid) return;
|
||||
|
||||
try {
|
||||
await connections[uid].killTabQuery(tabUid);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('commit-tab', async (event, { uid, tabUid }) => {
|
||||
if (!tabUid) return;
|
||||
|
||||
try {
|
||||
await connections[uid].commitTab(tabUid);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('rollback-tab', async (event, { uid, tabUid }) => {
|
||||
if (!tabUid) return;
|
||||
|
||||
try {
|
||||
await connections[uid].rollbackTab(tabUid);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('destroy-connection-to-commit', async (event, { uid, tabUid }) => {
|
||||
if (!tabUid) return;
|
||||
|
||||
try {
|
||||
await connections[uid].destroyConnectionToCommit(tabUid);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
};
|
@@ -1,202 +0,0 @@
|
||||
import { ipcMain } from 'electron';
|
||||
import { sqlEscaper } from 'common/libs/sqlEscaper';
|
||||
import { TEXT, LONG_TEXT, NUMBER, BLOB } from 'common/fieldTypes';
|
||||
import fs from 'fs';
|
||||
|
||||
// TODO: remap objects based on client
|
||||
|
||||
export default (connections) => {
|
||||
ipcMain.handle('get-table-columns', async (event, { uid, schema, table }) => {
|
||||
try {
|
||||
const { rows } = await connections[uid]
|
||||
.select('*')
|
||||
.schema('information_schema')
|
||||
.from('COLUMNS')
|
||||
.where({ TABLE_SCHEMA: `= '${schema}'`, TABLE_NAME: `= '${table}'` })
|
||||
.orderBy({ ORDINAL_POSITION: 'ASC' })
|
||||
.run();
|
||||
|
||||
const result = rows.map(field => {
|
||||
return {
|
||||
name: field.COLUMN_NAME,
|
||||
key: field.COLUMN_KEY.toLowerCase(),
|
||||
type: field.DATA_TYPE,
|
||||
schema: field.TABLE_SCHEMA,
|
||||
table: field.TABLE_NAME,
|
||||
numPrecision: field.NUMERIC_PRECISION,
|
||||
datePrecision: field.DATETIME_PRECISION,
|
||||
charLength: field.CHARACTER_MAXIMUM_LENGTH,
|
||||
isNullable: field.IS_NULLABLE,
|
||||
default: field.COLUMN_DEFAULT,
|
||||
charset: field.CHARACTER_SET_NAME,
|
||||
collation: field.COLLATION_NAME,
|
||||
autoIncrement: field.EXTRA.includes('auto_increment'),
|
||||
comment: field.COLUMN_COMMENT
|
||||
};
|
||||
});
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-table-data', async (event, { uid, schema, table }) => {
|
||||
try {
|
||||
const result = await connections[uid]
|
||||
.select('*')
|
||||
.schema(schema)
|
||||
.from(table)
|
||||
.limit(1000)
|
||||
.run();
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-key-usage', async (event, { uid, schema, table }) => {
|
||||
try {
|
||||
const { rows } = await connections[uid]
|
||||
.select('*')
|
||||
.schema('information_schema')
|
||||
.from('KEY_COLUMN_USAGE')
|
||||
.where({ TABLE_SCHEMA: `= '${schema}'`, TABLE_NAME: `= '${table}'`, REFERENCED_TABLE_NAME: 'IS NOT NULL' })
|
||||
.run();
|
||||
|
||||
const result = rows.map(field => {
|
||||
return {
|
||||
schema: field.TABLE_SCHEMA,
|
||||
table: field.TABLE_NAME,
|
||||
column: field.COLUMN_NAME,
|
||||
position: field.ORDINAL_POSITION,
|
||||
constraintPosition: field.POSITION_IN_UNIQUE_CONSTRAINT,
|
||||
constraintName: field.CONSTRAINT_NAME,
|
||||
refSchema: field.REFERENCED_TABLE_SCHEMA,
|
||||
refTable: field.REFERENCED_TABLE_NAME,
|
||||
refColumn: field.REFERENCED_COLUMN_NAME
|
||||
};
|
||||
});
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('update-table-cell', async (event, params) => {
|
||||
try {
|
||||
let escapedParam;
|
||||
let reload = false;
|
||||
const id = typeof params.id === 'number' ? params.id : `"${params.id}"`;
|
||||
|
||||
if (NUMBER.includes(params.type))
|
||||
escapedParam = params.content;
|
||||
else if ([...TEXT, ...LONG_TEXT].includes(params.type))
|
||||
escapedParam = `"${sqlEscaper(params.content)}"`;
|
||||
else if (BLOB.includes(params.type)) {
|
||||
if (params.content) {
|
||||
const fileBlob = fs.readFileSync(params.content);
|
||||
escapedParam = `0x${fileBlob.toString('hex')}`;
|
||||
reload = true;
|
||||
}
|
||||
else
|
||||
escapedParam = '""';
|
||||
}
|
||||
else
|
||||
escapedParam = `"${sqlEscaper(params.content)}"`;
|
||||
|
||||
await connections[params.uid]
|
||||
.update({ [params.field]: `= ${escapedParam}` })
|
||||
.schema(params.schema)
|
||||
.from(params.table)
|
||||
.where({ [params.primary]: `= ${id}` })
|
||||
.run();
|
||||
|
||||
return { status: 'success', response: { reload } };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('delete-table-rows', async (event, params) => {
|
||||
try {
|
||||
const result = await connections[params.uid]
|
||||
.schema(params.schema)
|
||||
.delete(params.table)
|
||||
.where({ [params.primary]: `IN (${params.rows.join(',')})` })
|
||||
.run();
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('insert-table-rows', async (event, params) => {
|
||||
try {
|
||||
const insertObj = {};
|
||||
for (const key in params.row) {
|
||||
const type = params.fields[key];
|
||||
let escapedParam;
|
||||
|
||||
if (params.row[key] === null)
|
||||
escapedParam = 'NULL';
|
||||
else if (NUMBER.includes(type))
|
||||
escapedParam = params.row[key];
|
||||
else if ([...TEXT, ...LONG_TEXT].includes(type))
|
||||
escapedParam = `"${sqlEscaper(params.row[key])}"`;
|
||||
else if (BLOB.includes(type)) {
|
||||
if (params.row[key]) {
|
||||
const fileBlob = fs.readFileSync(params.row[key]);
|
||||
escapedParam = `0x${fileBlob.toString('hex')}`;
|
||||
}
|
||||
else
|
||||
escapedParam = '""';
|
||||
}
|
||||
else
|
||||
escapedParam = `"${sqlEscaper(params.row[key])}"`;
|
||||
|
||||
insertObj[key] = escapedParam;
|
||||
}
|
||||
|
||||
for (let i = 0; i < params.repeat; i++) {
|
||||
await connections[params.uid]
|
||||
.schema(params.schema)
|
||||
.into(params.table)
|
||||
.insert(insertObj)
|
||||
.run();
|
||||
}
|
||||
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-foreign-list', async (event, params) => {
|
||||
try {
|
||||
const query = connections[params.uid]
|
||||
.select(`${params.column} AS foreignColumn`)
|
||||
.schema(params.schema)
|
||||
.from(params.table)
|
||||
.orderBy('foreignColumn ASC');
|
||||
|
||||
if (params.description)
|
||||
query.select(`LEFT(${params.description}, 20) AS foreignDescription`);
|
||||
|
||||
const results = await query.run();
|
||||
|
||||
return { status: 'success', response: results };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
};
|
431
src/main/ipc-handlers/tables.ts
Normal file
@@ -0,0 +1,431 @@
|
||||
import * as fs from 'fs';
|
||||
import * as antares from 'common/interfaces/antares';
|
||||
import { InsertRowsParams } from 'common/interfaces/tableApis';
|
||||
import { ipcMain } from 'electron';
|
||||
import { faker } from '@faker-js/faker';
|
||||
import * as moment from 'moment';
|
||||
import { sqlEscaper } from 'common/libs/sqlUtils';
|
||||
import { TEXT, LONG_TEXT, ARRAY, TEXT_SEARCH, NUMBER, FLOAT, BLOB, BIT, DATE, DATETIME } from 'common/fieldTypes';
|
||||
import customizations from 'common/customizations';
|
||||
|
||||
export default (connections: {[key: string]: antares.Client}) => {
|
||||
ipcMain.handle('get-table-columns', async (event, params) => {
|
||||
try {
|
||||
const result = await connections[params.uid].getTableColumns(params);
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-table-data', async (event, { uid, schema, table, limit, page, sortParams, where }) => {
|
||||
try {
|
||||
const offset = (page - 1) * limit;
|
||||
const query = connections[uid]
|
||||
.select('*')
|
||||
.schema(schema)
|
||||
.from(table)
|
||||
.limit(limit)
|
||||
.offset(offset);
|
||||
|
||||
if (sortParams && sortParams.field && sortParams.dir)
|
||||
query.orderBy({ [sortParams.field]: sortParams.dir.toUpperCase() });
|
||||
|
||||
if (where)
|
||||
query.where(where);
|
||||
|
||||
const result = await query.run({ details: true, schema });
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-table-count', async (event, params) => {
|
||||
try {
|
||||
const result = await connections[params.uid].getTableApproximateCount(params);
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-table-options', async (event, params) => {
|
||||
try {
|
||||
const result = await connections[params.uid].getTableOptions(params);
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-table-indexes', async (event, params) => {
|
||||
try {
|
||||
const result = await connections[params.uid].getTableIndexes(params);
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-key-usage', async (event, params) => {
|
||||
try {
|
||||
const result = await connections[params.uid].getKeyUsage(params);
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('update-table-cell', async (event, params) => {
|
||||
delete params.row._antares_id;
|
||||
const { stringsWrapper: sw } = customizations[connections[params.uid]._client];
|
||||
|
||||
try { // TODO: move to client classes
|
||||
let escapedParam;
|
||||
let reload = false;
|
||||
const id = typeof params.id === 'number' ? params.id : `${sw}${params.id}${sw}`;
|
||||
|
||||
if ([...NUMBER, ...FLOAT].includes(params.type))
|
||||
escapedParam = params.content;
|
||||
else if ([...TEXT, ...LONG_TEXT].includes(params.type)) {
|
||||
switch (connections[params.uid]._client) {
|
||||
case 'mysql':
|
||||
case 'maria':
|
||||
escapedParam = `"${sqlEscaper(params.content)}"`;
|
||||
break;
|
||||
case 'pg':
|
||||
case 'sqlite':
|
||||
escapedParam = `'${params.content.replaceAll('\'', '\'\'')}'`;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (ARRAY.includes(params.type))
|
||||
escapedParam = `'${params.content}'`;
|
||||
else if (TEXT_SEARCH.includes(params.type))
|
||||
escapedParam = `'${params.content.replaceAll('\'', '\'\'')}'`;
|
||||
else if (BLOB.includes(params.type)) {
|
||||
if (params.content) {
|
||||
let fileBlob;
|
||||
|
||||
switch (connections[params.uid]._client) {
|
||||
case 'mysql':
|
||||
case 'maria':
|
||||
fileBlob = fs.readFileSync(params.content);
|
||||
escapedParam = `0x${fileBlob.toString('hex')}`;
|
||||
break;
|
||||
case 'pg':
|
||||
fileBlob = fs.readFileSync(params.content);
|
||||
escapedParam = `decode('${fileBlob.toString('hex')}', 'hex')`;
|
||||
break;
|
||||
case 'sqlite':
|
||||
fileBlob = fs.readFileSync(params.content);
|
||||
escapedParam = `X'${fileBlob.toString('hex')}'`;
|
||||
break;
|
||||
}
|
||||
reload = true;
|
||||
}
|
||||
else {
|
||||
switch (connections[params.uid]._client) {
|
||||
case 'mysql':
|
||||
case 'maria':
|
||||
escapedParam = '\'\'';
|
||||
break;
|
||||
case 'pg':
|
||||
escapedParam = 'decode(\'\', \'hex\')';
|
||||
break;
|
||||
case 'sqlite':
|
||||
escapedParam = 'X\'\'';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (BIT.includes(params.type)) {
|
||||
escapedParam = `b'${sqlEscaper(params.content)}'`;
|
||||
reload = true;
|
||||
}
|
||||
else if (params.content === null)
|
||||
escapedParam = 'NULL';
|
||||
else
|
||||
escapedParam = `'${sqlEscaper(params.content)}'`;
|
||||
|
||||
if (params.primary) { // TODO: handle multiple primary
|
||||
await connections[params.uid]
|
||||
.update({ [params.field]: `= ${escapedParam}` })
|
||||
.schema(params.schema)
|
||||
.from(params.table)
|
||||
.where({ [params.primary]: `= ${id}` })
|
||||
.limit(1)
|
||||
.run();
|
||||
}
|
||||
else {
|
||||
const { orgRow } = params;
|
||||
delete orgRow._antares_id;
|
||||
|
||||
reload = true;
|
||||
|
||||
for (const key in orgRow) {
|
||||
if (typeof orgRow[key] === 'string')
|
||||
orgRow[key] = `'${orgRow[key]}'`;
|
||||
|
||||
if (orgRow[key] === null)
|
||||
orgRow[key] = `IS ${orgRow[key]}`;
|
||||
else
|
||||
orgRow[key] = `= ${orgRow[key]}`;
|
||||
}
|
||||
|
||||
await connections[params.uid]
|
||||
.schema(params.schema)
|
||||
.update({ [params.field]: `= ${escapedParam}` })
|
||||
.from(params.table)
|
||||
.where(orgRow)
|
||||
.limit(1)
|
||||
.run();
|
||||
}
|
||||
|
||||
return { status: 'success', response: { reload } };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('delete-table-rows', async (event, params) => {
|
||||
if (params.primary) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const idString = params.rows.map((row: {[key: string]: any}) => {
|
||||
const fieldName = Object.keys(row)[0].includes('.') ? `${params.table}.${params.primary}` : params.primary;
|
||||
|
||||
return typeof row[fieldName] === 'string'
|
||||
? `'${row[fieldName]}'`
|
||||
: row[fieldName];
|
||||
}).join(',');
|
||||
|
||||
try {
|
||||
const result = await connections[params.uid]
|
||||
.schema(params.schema)
|
||||
.delete(params.table)
|
||||
.where({ [params.primary]: `IN (${idString})` })
|
||||
.run();
|
||||
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
for (const row of params.rows) {
|
||||
for (const key in row) {
|
||||
if (typeof row[key] === 'string')
|
||||
row[key] = `'${row[key]}'`;
|
||||
|
||||
row[key] = `= ${row[key]}`;
|
||||
}
|
||||
|
||||
await connections[params.uid]
|
||||
.schema(params.schema)
|
||||
.delete(params.table)
|
||||
.where(row)
|
||||
.limit(1)
|
||||
.run();
|
||||
}
|
||||
|
||||
return { status: 'success', response: [] };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('insert-table-fake-rows', async (event, params: InsertRowsParams) => {
|
||||
try { // TODO: move to client classes
|
||||
const rows: {[key: string]: string | number | boolean | Date | Buffer}[] = [];
|
||||
|
||||
for (let i = 0; i < +params.repeat; i++) {
|
||||
const insertObj: {[key: string]: string | number | boolean | Date | Buffer} = {};
|
||||
|
||||
for (const key in params.row) {
|
||||
const type = params.fields[key];
|
||||
let escapedParam;
|
||||
|
||||
if (!('group' in params.row[key]) || params.row[key].group === 'manual') { // Manual value
|
||||
if (params.row[key].value === null || params.row[key].value === undefined)
|
||||
escapedParam = 'NULL';
|
||||
else if ([...NUMBER, ...FLOAT].includes(type))
|
||||
escapedParam = params.row[key].value;
|
||||
else if ([...TEXT, ...LONG_TEXT].includes(type)) {
|
||||
switch (connections[params.uid]._client) {
|
||||
case 'mysql':
|
||||
case 'maria':
|
||||
escapedParam = `"${sqlEscaper(params.row[key].value)}"`;
|
||||
break;
|
||||
case 'pg':
|
||||
case 'sqlite':
|
||||
escapedParam = `'${params.row[key].value.replaceAll('\'', '\'\'')}'`;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (BLOB.includes(type)) {
|
||||
if (params.row[key].value) {
|
||||
let fileBlob;
|
||||
|
||||
switch (connections[params.uid]._client) {
|
||||
case 'mysql':
|
||||
case 'maria':
|
||||
fileBlob = fs.readFileSync(params.row[key].value);
|
||||
escapedParam = `0x${fileBlob.toString('hex')}`;
|
||||
break;
|
||||
case 'pg':
|
||||
fileBlob = fs.readFileSync(params.row[key].value);
|
||||
escapedParam = `decode('${fileBlob.toString('hex')}', 'hex')`;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (connections[params.uid]._client) {
|
||||
case 'mysql':
|
||||
case 'maria':
|
||||
escapedParam = '""';
|
||||
break;
|
||||
case 'pg':
|
||||
escapedParam = 'decode(\'\', \'hex\')';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (BIT.includes(type))
|
||||
escapedParam = `b'${sqlEscaper(params.row[key].value)}'`;
|
||||
else
|
||||
escapedParam = `'${sqlEscaper(params.row[key].value)}'`;
|
||||
|
||||
insertObj[key] = escapedParam;
|
||||
}
|
||||
else { // Faker value
|
||||
const parsedParams: {[key: string]: string | number | boolean | Date | Buffer} = {};
|
||||
let fakeValue;
|
||||
|
||||
if (params.locale)
|
||||
faker.locale = params.locale;
|
||||
|
||||
if (Object.keys(params.row[key].params).length) {
|
||||
Object.keys(params.row[key].params).forEach(param => {
|
||||
if (!isNaN(params.row[key].params[param]))
|
||||
parsedParams[param] = +params.row[key].params[param];
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
fakeValue = (faker as any)[params.row[key].group][params.row[key].method](parsedParams);
|
||||
}
|
||||
else
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
fakeValue = (faker as any)[params.row[key].group][params.row[key].method]();
|
||||
|
||||
if (typeof fakeValue === 'string') {
|
||||
if (params.row[key].length)
|
||||
fakeValue = fakeValue.substring(0, params.row[key].length);
|
||||
fakeValue = `'${sqlEscaper(fakeValue)}'`;
|
||||
}
|
||||
else if ([...DATE, ...DATETIME].includes(type))
|
||||
fakeValue = `'${moment(fakeValue).format('YYYY-MM-DD HH:mm:ss.SSSSSS')}'`;
|
||||
|
||||
insertObj[key] = fakeValue;
|
||||
}
|
||||
}
|
||||
|
||||
rows.push(insertObj);
|
||||
}
|
||||
|
||||
await connections[params.uid]
|
||||
.schema(params.schema)
|
||||
.into(params.table)
|
||||
.insert(rows)
|
||||
.run();
|
||||
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-foreign-list', async (event, { uid, schema, table, column, description }) => {
|
||||
try {
|
||||
const query = connections[uid]
|
||||
.select(`${column} AS foreign_column`)
|
||||
.schema(schema)
|
||||
.from(table)
|
||||
.orderBy('foreign_column ASC');
|
||||
|
||||
if (description)
|
||||
query.select(`LEFT(${description}, 20) AS foreign_description`);
|
||||
|
||||
const results = await query.run();
|
||||
|
||||
return { status: 'success', response: results };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('create-table', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].createTable(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('alter-table', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].alterTable(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('duplicate-table', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].duplicateTable(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('truncate-table', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].truncateTable(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('drop-table', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].dropTable(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
};
|
57
src/main/ipc-handlers/triggers.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import * as antares from 'common/interfaces/antares';
|
||||
import { ipcMain } from 'electron';
|
||||
|
||||
export default (connections: {[key: string]: antares.Client}) => {
|
||||
ipcMain.handle('get-trigger-informations', async (event, params) => {
|
||||
try {
|
||||
const result = await connections[params.uid].getTriggerInformations(params);
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('drop-trigger', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].dropTrigger(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('alter-trigger', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].alterTrigger(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('create-trigger', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].createTrigger(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('toggle-trigger', async (event, params) => {
|
||||
try {
|
||||
if (!params.enabled)
|
||||
await connections[params.uid].enableTrigger(params);
|
||||
else
|
||||
await connections[params.uid].disableTrigger(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
};
|
@@ -1,44 +0,0 @@
|
||||
import { ipcMain } from 'electron';
|
||||
import { autoUpdater } from 'electron-updater';
|
||||
|
||||
let mainWindow;
|
||||
autoUpdater.allowPrerelease = true;
|
||||
|
||||
export default () => {
|
||||
ipcMain.on('check-for-updates', event => {
|
||||
mainWindow = event;
|
||||
|
||||
autoUpdater.checkForUpdatesAndNotify().catch(() => {
|
||||
mainWindow.reply('check-failed');
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.on('restart-to-update', () => {
|
||||
autoUpdater.quitAndInstall();
|
||||
});
|
||||
|
||||
// auto-updater events
|
||||
autoUpdater.on('checking-for-update', () => {
|
||||
mainWindow.reply('checking-for-update');
|
||||
});
|
||||
|
||||
autoUpdater.on('update-available', () => {
|
||||
mainWindow.reply('update-available');
|
||||
});
|
||||
|
||||
autoUpdater.on('update-not-available', () => {
|
||||
mainWindow.reply('update-not-available');
|
||||
});
|
||||
|
||||
autoUpdater.on('download-progress', data => {
|
||||
mainWindow.reply('download-progress', data);
|
||||
});
|
||||
|
||||
autoUpdater.on('update-downloaded', () => {
|
||||
mainWindow.reply('update-downloaded');
|
||||
});
|
||||
|
||||
autoUpdater.logger = require('electron-log');
|
||||
autoUpdater.logger.transports.console.format = '{h}:{i}:{s} {text}';
|
||||
autoUpdater.logger.transports.file.level = 'info';
|
||||
};
|
56
src/main/ipc-handlers/updates.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { ipcMain } from 'electron';
|
||||
import { autoUpdater } from 'electron-updater';
|
||||
import * as Store from 'electron-store';
|
||||
const persistentStore = new Store({ name: 'settings', clearInvalidConfig: true });
|
||||
const isMacOS = process.platform === 'darwin';
|
||||
|
||||
let mainWindow: Electron.IpcMainEvent;
|
||||
autoUpdater.allowPrerelease = persistentStore.get('allow_prerelease', true) as boolean;
|
||||
|
||||
export default () => {
|
||||
ipcMain.on('check-for-updates', event => {
|
||||
mainWindow = event;
|
||||
if (process.windowsStore || (process.platform === 'linux' && !process.env.APPIMAGE))
|
||||
mainWindow.reply('no-auto-update');
|
||||
else if (isMacOS) { // Temporary solution on MacOS for unsigned app updates
|
||||
autoUpdater.autoDownload = false;
|
||||
}
|
||||
else {
|
||||
autoUpdater.checkForUpdatesAndNotify().catch(() => {
|
||||
mainWindow.reply('check-failed');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on('restart-to-update', () => {
|
||||
autoUpdater.quitAndInstall();
|
||||
});
|
||||
|
||||
// auto-updater events
|
||||
autoUpdater.on('checking-for-update', () => {
|
||||
mainWindow.reply('checking-for-update');
|
||||
});
|
||||
|
||||
autoUpdater.on('update-available', () => {
|
||||
if (isMacOS)
|
||||
mainWindow.reply('link-to-download');
|
||||
else
|
||||
mainWindow.reply('update-available');
|
||||
});
|
||||
|
||||
autoUpdater.on('update-not-available', () => {
|
||||
mainWindow.reply('update-not-available');
|
||||
});
|
||||
|
||||
autoUpdater.on('download-progress', data => {
|
||||
mainWindow.reply('download-progress', data);
|
||||
});
|
||||
|
||||
autoUpdater.on('update-downloaded', () => {
|
||||
mainWindow.reply('update-downloaded');
|
||||
});
|
||||
|
||||
// autoUpdater.logger = require('electron-log');
|
||||
// autoUpdater.logger.transports.console.format = '{h}:{i}:{s} {text}';
|
||||
// autoUpdater.logger.transports.file.level = 'info';
|
||||
};
|
16
src/main/ipc-handlers/users.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as antares from 'common/interfaces/antares';
|
||||
import { ipcMain } from 'electron';
|
||||
|
||||
export default (connections: {[key: string]: antares.Client}) => {
|
||||
ipcMain.handle('get-users', async (event, uid) => {
|
||||
try {
|
||||
const result = await connections[uid].getUsers();
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
if (err.code === 'ER_TABLEACCESS_DENIED_ERROR')
|
||||
return { status: 'success', response: [] };
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
};
|
44
src/main/ipc-handlers/views.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import * as antares from 'common/interfaces/antares';
|
||||
import { ipcMain } from 'electron';
|
||||
|
||||
export default (connections: {[key: string]: antares.Client}) => {
|
||||
ipcMain.handle('get-view-informations', async (event, params) => {
|
||||
try {
|
||||
const result = await connections[params.uid].getViewInformations(params);
|
||||
return { status: 'success', response: result };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('drop-view', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].dropView(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('alter-view', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].alterView(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('create-view', async (event, params) => {
|
||||
try {
|
||||
await connections[params.uid].createView(params);
|
||||
return { status: 'success' };
|
||||
}
|
||||
catch (err) {
|
||||
return { status: 'error', response: err.toString() };
|
||||
}
|
||||
});
|
||||
};
|
@@ -1,141 +0,0 @@
|
||||
'use strict';
|
||||
/**
|
||||
* As Simple As Possible Query Builder Core
|
||||
*
|
||||
* @class AntaresCore
|
||||
*/
|
||||
export class AntaresCore {
|
||||
/**
|
||||
* Creates an instance of AntaresCore.
|
||||
*
|
||||
* @param {Object} args connection params
|
||||
* @memberof AntaresCore
|
||||
*/
|
||||
constructor (args) {
|
||||
this._client = args.client;
|
||||
this._params = args.params;
|
||||
this._poolSize = args.poolSize || false;
|
||||
this._connection = null;
|
||||
this._logger = args.logger || console.log;
|
||||
|
||||
this._queryDefaults = {
|
||||
schema: '',
|
||||
select: [],
|
||||
from: '',
|
||||
where: [],
|
||||
groupBy: [],
|
||||
orderBy: [],
|
||||
limit: [],
|
||||
join: [],
|
||||
update: [],
|
||||
insert: {},
|
||||
delete: false
|
||||
};
|
||||
this._query = Object.assign({}, this._queryDefaults);
|
||||
}
|
||||
|
||||
_reducer (acc, curr) {
|
||||
const type = typeof curr;
|
||||
|
||||
switch (type) {
|
||||
case 'number':
|
||||
case 'string':
|
||||
return [...acc, curr];
|
||||
case 'object':
|
||||
if (Array.isArray(curr))
|
||||
return [...acc, ...curr];
|
||||
else {
|
||||
const clausoles = [];
|
||||
for (const key in curr)
|
||||
clausoles.push(`${key} ${curr[key]}`);
|
||||
|
||||
return clausoles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the query object after a query
|
||||
*
|
||||
* @memberof AntaresCore
|
||||
*/
|
||||
_resetQuery () {
|
||||
this._query = Object.assign({}, this._queryDefaults);
|
||||
}
|
||||
|
||||
schema (schema) {
|
||||
this._query.schema = schema;
|
||||
return this;
|
||||
}
|
||||
|
||||
select (...args) {
|
||||
this._query.select = [...this._query.select, ...args];
|
||||
return this;
|
||||
}
|
||||
|
||||
from (table) {
|
||||
this._query.from = table;
|
||||
return this;
|
||||
}
|
||||
|
||||
into (table) {
|
||||
this._query.from = table;
|
||||
return this;
|
||||
}
|
||||
|
||||
delete (table) {
|
||||
this._query.delete = true;
|
||||
this.from(table);
|
||||
return this;
|
||||
}
|
||||
|
||||
where (...args) {
|
||||
this._query.where = [...this._query.where, ...args];
|
||||
return this;
|
||||
}
|
||||
|
||||
groupBy (...args) {
|
||||
this._query.groupBy = [...this._query.groupBy, ...args];
|
||||
return this;
|
||||
}
|
||||
|
||||
orderBy (...args) {
|
||||
this._query.orderBy = [...this._query.orderBy, ...args];
|
||||
return this;
|
||||
}
|
||||
|
||||
limit (...args) {
|
||||
this._query.limit = args;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {String | Array} args field = value
|
||||
* @returns
|
||||
* @memberof AntaresCore
|
||||
*/
|
||||
update (...args) {
|
||||
this._query.update = [...this._query.update, ...args];
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object} obj field: value
|
||||
* @returns
|
||||
* @memberof AntaresCore
|
||||
*/
|
||||
insert (obj) {
|
||||
this._query.insert = { ...this._query.insert, ...obj };
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise}
|
||||
* @memberof AntaresCore
|
||||
*/
|
||||
async run () {
|
||||
const rawQuery = this.getSQL();
|
||||
this._resetQuery();
|
||||
return this.raw(rawQuery);
|
||||
}
|
||||
}
|