Commit c40fb04
authored
Add a support for H2 modes (#720)
* Refactor H2 database util to inherit DbType
H2 database util has been refactored to inherit DbType, allowing for the use of different dialects. Updated the relevant test cases and added a function to correctly identify the dialect based on the URL. Added error handling for unsupported dialects.
* Split the tests for databases on two parts - local and H2 oriented
* Fixed tests
* Add jts-core library and improve code documentation
The jts-core library was added to the project dependencies, allowing for usage in the codebase. Moreover, some improvements in the documentation of the code were made. Specifically, better explanations were provided for error cases in the `extractDBTypeFromConnection` and `extractDBTypeFromUrl` functions, and extensive documentation was added for the companion object in the H2.kt file.
* Refactor code formatting across several DF-JDBC files
Various minor formatting changes have been applied to improve code readability. This includes rearranging import statements in the 'postgresTest.kt' file, removing superfluous empty lines in 'mssqlTest.kt', and adjusting white-spacing for improved consistency in 'util.kt' and 'H2.kt'.
* Update import statements across multiple files
* Refactor H2 class and extend tests
Performed a refinement in the H2 class and implemented test coverage for specific conditions. The H2 class now uses the class reference for comparison instead of the simple name, eliminating string comparison. Additionally, a test has been added to check that an exception is properly thrown when specifying an H2 database with H2 dialect. Minor import adjustments were also made in the readJdbc and mssqlTest files.1 parent cf234e7 commit c40fb04
File tree
18 files changed
+1689
-58
lines changed- dataframe-jdbc
- src
- main/kotlin/org/jetbrains/kotlinx/dataframe/io
- db
- test/kotlin/org/jetbrains/kotlinx/dataframe/io
- h2
- local
- gradle
- plugins/symbol-processor/src/main/kotlin/org/jetbrains/dataframe/ksp
18 files changed
+1689
-58
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
Lines changed: 46 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
19 | 47 | | |
20 | 48 | | |
21 | 49 | | |
22 | 50 | | |
23 | | - | |
| 51 | + | |
24 | 52 | | |
25 | 53 | | |
26 | 54 | | |
27 | | - | |
28 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
29 | 63 | | |
30 | 64 | | |
31 | 65 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 66 | + | |
37 | 67 | | |
38 | 68 | | |
39 | 69 | | |
40 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
41 | 75 | | |
42 | 76 | | |
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
Lines changed: 90 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
4 | 60 | | |
5 | 61 | | |
6 | 62 | | |
7 | 63 | | |
8 | 64 | | |
9 | 65 | | |
10 | | - | |
| 66 | + | |
11 | 67 | | |
12 | 68 | | |
13 | 69 | | |
| 70 | + | |
14 | 71 | | |
15 | | - | |
| 72 | + | |
16 | 73 | | |
17 | 74 | | |
18 | 75 | | |
| |||
28 | 85 | | |
29 | 86 | | |
30 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
31 | 119 | | |
32 | 120 | | |
33 | 121 | | |
| |||
Lines changed: 9 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
138 | 137 | | |
139 | 138 | | |
140 | 139 | | |
141 | | - | |
| 140 | + | |
142 | 141 | | |
143 | 142 | | |
144 | 143 | | |
| |||
203 | 202 | | |
204 | 203 | | |
205 | 204 | | |
206 | | - | |
207 | | - | |
| 205 | + | |
208 | 206 | | |
209 | 207 | | |
210 | 208 | | |
| |||
283 | 281 | | |
284 | 282 | | |
285 | 283 | | |
286 | | - | |
287 | | - | |
| 284 | + | |
288 | 285 | | |
289 | 286 | | |
290 | 287 | | |
| |||
329 | 326 | | |
330 | 327 | | |
331 | 328 | | |
332 | | - | |
333 | | - | |
| 329 | + | |
334 | 330 | | |
335 | 331 | | |
336 | 332 | | |
| |||
390 | 386 | | |
391 | 387 | | |
392 | 388 | | |
393 | | - | |
394 | | - | |
| 389 | + | |
395 | 390 | | |
396 | 391 | | |
397 | 392 | | |
| |||
432 | 427 | | |
433 | 428 | | |
434 | 429 | | |
435 | | - | |
436 | | - | |
| 430 | + | |
437 | 431 | | |
438 | 432 | | |
439 | 433 | | |
| |||
468 | 462 | | |
469 | 463 | | |
470 | 464 | | |
471 | | - | |
472 | | - | |
| 465 | + | |
473 | 466 | | |
474 | 467 | | |
475 | 468 | | |
| |||
495 | 488 | | |
496 | 489 | | |
497 | 490 | | |
498 | | - | |
499 | | - | |
| 491 | + | |
500 | 492 | | |
501 | 493 | | |
502 | 494 | | |
| |||
0 commit comments