Skip to content

feat: add PostgreSQL dialect support#23

Open
hmdnnrmn wants to merge 6 commits into
GroupeZ-dev:developfrom
MujahanamSMP:postgresql-support
Open

feat: add PostgreSQL dialect support#23
hmdnnrmn wants to merge 6 commits into
GroupeZ-dev:developfrom
MujahanamSMP:postgresql-support

Conversation

@hmdnnrmn
Copy link
Copy Markdown

  • add SqlDialect abstraction and database-specific implementations for MySQL, MariaDB, SQLite, and PostgreSQL

  • add PostgreSQL connection/configuration support and JDBC dependency wiring

  • route SQL rendering through dialects for identifiers, DDL, joins, where clauses, upserts, and migration metadata checks

  • fix PostgreSQL-specific regressions (where-clause quoting, batch request quoting, case-preserving migration column detection)

  • add foreign key/order-by value objects and dialect-aware schema rendering

  • add PostgreSQL-focused regression and behavior tests across dialect, connection, conditions, create, upsert, migration, and request SQL generation

  • document PostgreSQL usage in README and bump library version to 1.24

- add SqlDialect abstraction and database-specific implementations for MySQL, MariaDB, SQLite, and PostgreSQL

- add PostgreSQL connection/configuration support and JDBC dependency wiring

- route SQL rendering through dialects for identifiers, DDL, joins, where clauses, upserts, and migration metadata checks

- fix PostgreSQL-specific regressions (where-clause quoting, batch request quoting, case-preserving migration column detection)

- add foreign key/order-by value objects and dialect-aware schema rendering

- add PostgreSQL-focused regression and behavior tests across dialect, connection, conditions, create, upsert, migration, and request SQL generation

- document PostgreSQL usage in README and bump library version to 1.24
@Maxlego08 Maxlego08 changed the base branch from main to develop May 26, 2026 10:53
- Override columnType() in PostgreSqlDialect to remap LONGTEXT,
  MEDIUMTEXT, TINYTEXT -> TEXT and BLOB, LONGBLOB, MEDIUMBLOB,
  TINYBLOB -> BYTEA for PostgreSQL compatibility
- Gate MySQL/MariaDB-specific HikariCP data source properties
  (useSSL, useUnicode, characterEncoding) to MySQL/MariaDB only
- Add PostgreSQL-specific socketTimeout (in seconds, not ms)
- Add PostgreSqlTypeMappingTest with 9 test cases
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 46 out of 47 changed files in this pull request and generated 4 comments.

Comment on lines 505 to +508
public long executeSelectCount(DatabaseConnection databaseConnection, Logger logger) throws SQLException {
SqlDialect dialect = SqlDialects.from(databaseConnection.getDatabaseConfiguration().getDatabaseType());
StringBuilder selectQuery = new StringBuilder("SELECT COUNT(*) FROM " + tableName);
this.whereConditions(selectQuery);
this.whereConditions(selectQuery, dialect);
Comment on lines 550 to 554

if (!this.joinConditions.isEmpty()) {
for (JoinCondition join : this.joinConditions) {
selectQuery.append(" ").append(join.getJoinClause());
selectQuery.append(" ").append(join.getJoinClause(dialect));
}
Comment on lines 46 to 48
@@ -39,9 +47,18 @@ public String getCondition() {
if (this.whereAction == WhereAction.IS_NOT_NULL) return this.column + " IS NOT NULL";
if (this.whereAction == WhereAction.IS_NULL) return this.column + " IS NULL";
Comment on lines 42 to +47
DatabaseType databaseType = databaseConfiguration.getDatabaseType();
SqlDialect dialect = SqlDialects.from(databaseType);

// URL + Driver
final String jdbcUrl;
if (databaseType == DatabaseType.MARIADB) {
jdbcUrl = "jdbc:mariadb://" + databaseConfiguration.getHost() + ":" + databaseConfiguration.getPort() + "/" + databaseConfiguration.getDatabase() + "?allowMultiQueries=true";
config.setDriverClassName("org.mariadb.jdbc.Driver");
} else {
jdbcUrl = "jdbc:mysql://" + databaseConfiguration.getHost() + ":" + databaseConfiguration.getPort() + "/" + databaseConfiguration.getDatabase() + "?allowMultiQueries=true";
config.setDriverClassName("com.mysql.cj.jdbc.Driver");
}
config.setJdbcUrl(jdbcUrl);
config.setJdbcUrl(dialect.jdbcUrl(databaseConfiguration));
config.setDriverClassName(dialect.driverClassName());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants