Skip to content

Commit

Permalink
Release 3.8.3 #2 (#846)
Browse files Browse the repository at this point in the history
* release: bump version  3.8.3

* fix: sqlite auto db folder creation (#845)

* Update Dockerfile for Better Compatibility (#838)

Changes to allow easier building for alternate architectures

- Update image to use node:{version}-alpine
- Add community repo so openjdk11-jdk can be added
- Add java_home env for jlink to be found
- Add sed command to flip download to false

Currently the gradle step that downloads node is only compatible with amd64. These changes will make node part of the base image and flip the download to false allowing for the build to complete on architectures such as ARM64.

* bump version

* release: bump version  3.8.3 (#844)

* fix: sqlite auto db folder creation

---------

Co-authored-by: gittrekt <[email protected]>

---------

Co-authored-by: gittrekt <[email protected]>
  • Loading branch information
ohager and gittrekt authored Dec 2, 2024
1 parent bd0d7fd commit 47d8db7
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/brs/db/sql/dialects/DatabaseInstanceSqlite.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,31 +76,30 @@ public SQLDialect getDialect() {
return SQLDialect.SQLITE;
}

private static String extractSqliteFolderPath(String jdbcUrl) {
private static Path extractSqliteFolderPath(String jdbcUrl) {
if (jdbcUrl == null || !jdbcUrl.startsWith("jdbc:sqlite:")) {
throw new IllegalArgumentException("Invalid SQLite JDBC URL");
}
String filePath = jdbcUrl.substring("jdbc:sqlite:file:".length());
Path path = Paths.get(filePath).toAbsolutePath().getParent();
return path != null ? path.toString() : null;
return Paths.get(filePath).toAbsolutePath().getParent();
}

private void ensureSqliteFolder() {
String dbUrl = propertyService.getString(Props.DB_URL);
String folderPath = extractSqliteFolderPath(dbUrl);
if (folderPath != null) {
File dbFolder = new File(folderPath);
if (!dbFolder.exists()) {
logger.info("Creating SQLite DB folder(s): " + folderPath);
try{
Files.createDirectories(Paths.get(folderPath));
}catch(Exception e){
logger.error("Failed to create SQLite DB folder: " + folderPath);
throw new RuntimeException(e);
}
} else {
logger.warn("SQLite database folder path couldn't be found for " + dbUrl);
}
Path folderPath = extractSqliteFolderPath(dbUrl);
if (folderPath == null) {
logger.error("SQLite database folder path couldn't be found for " + dbUrl);
return;
}
if (new File(folderPath.toString()).exists()) {
return;
}
logger.info("Creating SQLite DB folder(s): " + folderPath);
try {
Files.createDirectories(Paths.get(folderPath.toString()));
} catch (Exception e) {
logger.error("Failed to create SQLite DB folder: " + folderPath);
throw new RuntimeException(e);
}
}

Expand Down

0 comments on commit 47d8db7

Please sign in to comment.