Skip to content

fix(database): load SQL libraries with Quark - #765

Merged
darbyjack merged 3 commits into
masterfrom
fix/drivers
Jun 26, 2026
Merged

fix(database): load SQL libraries with Quark#765
darbyjack merged 3 commits into
masterfrom
fix/drivers

Conversation

@darbyjack

@darbyjack darbyjack commented Jun 26, 2026

Copy link
Copy Markdown
Member

This pull request refactors and improves the way database driver and data source class names are managed and detected in the DatabaseManager class. The changes enhance flexibility and robustness in loading JDBC drivers, particularly for SQLite, and improve error messaging for missing drivers.

Refactoring and improvements to class name detection:

  • Renamed the method requireDataSourceName to requireDataSourceClassName and introduced a new method requireDriverClassName, both of which utilize a shared helper method requireClassName for class detection and error reporting. This centralizes and clarifies the logic for checking required classes.
  • Enhanced the isClassAvailable method to check multiple class loaders (including the current, context, and system class loaders), increasing the chances of successfully detecting JDBC driver classes across different runtime environments.

Backend-specific configuration updates:

  • For the SQLite backend, added a call to config.setDriverClassName using the new requireDriverClassName method, ensuring the correct JDBC driver is explicitly set for SQLite connections.
  • Updated the MySQL and MariaDB backend configuration to use the renamed requireDataSourceClassName method for setting the data source class name, improving consistency. [1] [2]

Error reporting and connection details:

  • Improved error messages in requireClassName to specify the type of class (driver or datasource) that is missing and to suggest ensuring the JDBC driver is available at runtime.
  • Enhanced the connection details string for SQLite to include the driver class name, providing more informative logging or debugging output.

@darbyjack
darbyjack merged commit f6652c2 into master Jun 26, 2026
1 check passed
@darbyjack
darbyjack deleted the fix/drivers branch June 26, 2026 17:34
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.

1 participant