Skip to content

Commit 2b34bda

Browse files
author
Oleksandr Dzhychko
authored
Merge pull request #708 from modelix/comment-PostgresDialect
chore(model-server): add comment about the need for PostgresDialect
2 parents b793d37 + a2edb83 commit 2b34bda

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

model-server/src/main/kotlin/org/modelix/model/server/store/PostgresDialect.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ package org.modelix.model.server.store
1717
import org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect
1818
import org.apache.ignite.internal.util.typedef.F
1919

20+
/**
21+
* Ignite dialect for PostgreSQL
22+
*
23+
* Ignite doesn't have an SQL dialect implementation for PostgreSQL.
24+
* Implementing and using this one enables bulk updates/inserts (upserts).
25+
*
26+
* Originally added in https://github.com/modelix/modelix/commit/eee51caddd9f470307febaa01e2820266ddfc6c9
27+
*/
2028
class PostgresDialect : BasicJdbcDialect() {
2129
override fun hasMerge(): Boolean {
2230
return true
@@ -27,6 +35,7 @@ class PostgresDialect : BasicJdbcDialect() {
2735
keyCols: Collection<String>,
2836
uniqCols: Collection<String>,
2937
): String {
38+
// Copied over from org.apache.ignite.cache.store.jdbc.dialect.MySQLDialect.mergeQuery
3039
val cols = F.concat(false, keyCols, uniqCols)
3140
val updPart = mkString(
3241
uniqCols,

0 commit comments

Comments
 (0)