Skip to content

Commit b78db1d

Browse files
committed
chore: implement CodeRabbit review comments
- Update sqlite-jdbc from 3.47.1.0 to 3.51.0.0 (2025-11-05 release) - Add error handling for database copy in entrypoint.sh - Check cp exit status before printing success message - Print clear error with paths on failure and exit non-zero
1 parent c6f8dee commit b78db1d

5 files changed

Lines changed: 11 additions & 7 deletions

File tree

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ The Docker container uses a "hold" pattern for the pre-seeded SQLite database:
243243

244244
### SQLite Configuration Notes
245245

246-
- **Date storage**: Dates are stored as Unix timestamps (INTEGER) for robustness - no parsing issues
246+
- **Date storage**: LocalDate fields are stored as Unix timestamps (INTEGER) for robustness - no parsing issues
247247
- **Converter**: `UnixTimestampConverter` handles LocalDate ↔ epoch seconds conversion via JPA `@Convert`
248248
- **DDL auto**: Use `ddl-auto=none` since the database is pre-seeded (SQLite has limited ALTER TABLE support)
249249
- **Tests use H2**: The converter works seamlessly with both H2 and SQLite databases

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ open target/site/jacoco/index.html
205205
**SQLite Configuration Notes:**
206206

207207
- Dates are stored as Unix timestamps (INTEGER) for robustness - no date format parsing issues
208-
- A JPA `AttributeConverter` handles LocalDate ↔ epoch seconds conversion transparently
208+
- A JPA `AttributeConverter` handles LocalDate ↔ epoch seconds conversion transparently (UTC-based)
209209
- Use `ddl-auto=none` since the database is pre-seeded (SQLite has limited ALTER TABLE support)
210210
- Tests use H2 in-memory database - the converter works seamlessly with both databases
211211

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
<dependency>
157157
<groupId>org.xerial</groupId>
158158
<artifactId>sqlite-jdbc</artifactId>
159-
<version>3.47.1.0</version>
159+
<version>3.51.0.0</version>
160160
<scope>runtime</scope>
161161
</dependency>
162162
<!-- Hibernate Community Dialects ==================================== -->

scripts/entrypoint.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ if [ ! -f "$VOLUME_STORAGE_PATH" ]; then
1212
echo "⚠️ No existing database file found in volume."
1313
if [ -f "$IMAGE_STORAGE_PATH" ]; then
1414
echo "Copying database file to writable volume..."
15-
cp "$IMAGE_STORAGE_PATH" "$VOLUME_STORAGE_PATH"
16-
echo "✔ Database initialized at $VOLUME_STORAGE_PATH"
15+
if cp "$IMAGE_STORAGE_PATH" "$VOLUME_STORAGE_PATH"; then
16+
echo "✔ Database initialized at $VOLUME_STORAGE_PATH"
17+
else
18+
echo "❌ Failed to copy database from $IMAGE_STORAGE_PATH to $VOLUME_STORAGE_PATH"
19+
echo " Check file permissions and available disk space."
20+
exit 1
21+
fi
1722
else
1823
echo "⚠️ Database file missing at $IMAGE_STORAGE_PATH"
1924
exit 1

src/main/java/ar/com/nanotaboada/java/samples/spring/boot/models/UnixTimestampConverter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
* (seconds since epoch).
1313
*
1414
* This converter stores dates as INTEGER in SQLite, which is more robust than
15-
* TEXT-based
16-
* date formats because:
15+
* TEXT-based date formats because:
1716
* - No parsing ambiguity or locale-dependent formatting issues
1817
* - Works consistently across all SQLite clients and tools
1918
* - More efficient for date comparisons and indexing

0 commit comments

Comments
 (0)