Skip to content

Add optional SQLite persistence layer for development and testing - #74

Merged
axymthr merged 7 commits into
developfrom
copilot/add-sqlite-persistence-layer
Nov 4, 2025
Merged

Add optional SQLite persistence layer for development and testing#74
axymthr merged 7 commits into
developfrom
copilot/add-sqlite-persistence-layer

Conversation

Copilot AI commented Oct 15, 2025

Copy link
Copy Markdown

SQLite Persistence Layer Implementation - COMPLETE ✅

  • Explore repository structure and understand current JPA/PostgreSQL setup
  • Build project successfully to understand dependencies
  • Add SQLite JDBC driver dependency to pom.xml
  • Create SQLite-specific configuration class (disabled by default)
  • Add application-sqlite.yml profile configuration
  • Create documentation/ADR for SQLite persistence layer option
  • Create comprehensive user guide for SQLite persistence
  • Test the implementation (verify SQLite dependencies work)
  • Verify existing PostgreSQL/JPA configuration still works
  • Update main README to reference SQLite option
  • Add SQLite database files to .gitignore
  • Final verification and code review
  • Remove build artifact main.css from PR

Summary

Successfully implemented an optional SQLite persistence layer for the VMS web-backend Spring Boot application. The implementation is disabled by default and requires explicit double opt-in (profile + property) to activate.

Key Features

  • ✅ Double opt-in safety mechanism (profile sqlite + property vms.persistence.sqlite.enabled=true)
  • ✅ JPA compatible (uses same entities and repositories)
  • ✅ Comprehensive documentation (ADR + user guide)
  • ✅ All tests passing (40 total: 36 existing + 4 new SQLite tests)
  • ✅ PostgreSQL remains primary database
  • ✅ Zero impact on existing functionality

Files Modified/Added

  • pom.xml: Added SQLite JDBC and Hibernate dialect dependencies
  • SQLiteConfig.java: Configuration class with conditional activation
  • application-sqlite.yml: SQLite-specific configuration
  • docs/adr/0004-optional-sqlite-persistence.md: Architecture decision record
  • docs/sqlite-persistence.md: 190-line comprehensive user guide
  • README.md: Updated to reference SQLite option
  • .gitignore: Excludes SQLite database files and Tailwind build artifacts
  • SQLiteConfigTest.java: Unit tests for SQLite functionality

Use Cases

  • Quick local development without PostgreSQL setup
  • Simple demos and prototyping
  • Lightweight testing scenarios
  • NOT for production use

Configuration Disabled by Default

PostgreSQL with JPA remains the default. SQLite requires explicit activation via both profile and property.

Original prompt

For the web-backend sub-folder Spring Boot project, create an optional persistence layer leveraging SQLite instead of JPA and PostgreSQL. Keep the configuration disabled for now.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits October 15, 2025 11:57
Co-authored-by: axymthr <17650429+axymthr@users.noreply.github.com>
Co-authored-by: axymthr <17650429+axymthr@users.noreply.github.com>
Co-authored-by: axymthr <17650429+axymthr@users.noreply.github.com>
Copilot AI changed the title [WIP] Add optional persistence layer using SQLite Add optional SQLite persistence layer for development and testing Oct 15, 2025
Copilot AI requested a review from axymthr October 15, 2025 12:09
@axymthr

axymthr commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

@copilot remove the file main.css from this PR.

Co-authored-by: axymthr <17650429+axymthr@users.noreply.github.com>

Copilot AI commented Oct 15, 2025

Copy link
Copy Markdown
Author

@copilot remove the file main.css from this PR.

Done. Removed main.css from the PR and added it to .gitignore as it's a Tailwind CSS build artifact that gets regenerated during the build process. (commit: will be added after this comment)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • maven.vaadin.com
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/boot/plexus-classworlds-2.8.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/vms/vms/web-backend org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests (dns block)
  • www.webjars.org
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/boot/plexus-classworlds-2.8.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/vms/vms/web-backend org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@axymthr

axymthr commented Oct 18, 2025

Copy link
Copy Markdown
Contributor

@copilot rebase from develop

Copilot AI commented Oct 18, 2025

Copy link
Copy Markdown
Author

@copilot rebase from develop

Rebased onto develop successfully (commit e673a77). The branch now includes 7 new commits from develop:

  • fix - basic regn. flow working
  • Cleanup on PR pipeline action
  • test(otp/email): update tests for new constructor and Graph client behavior
  • fix(templates): render visitor confirmation with JTE params
  • fix(email): propagate Graph API errors
  • feat(otp/notification): use env-backed system email
  • Fixing the package publish action

Resolved merge conflict in .gitignore (combined VS Code/JTE entries with SQLite entries). Build and tests pass successfully.

⚠️ Note: The rebase requires a force push. I cannot perform force pushes directly - you'll need to run git push --force-with-lease origin copilot/add-sqlite-persistence-layer to update the remote branch.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • maven.vaadin.com
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/boot/plexus-classworlds-2.8.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/vms/vms/web-backend org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests (dns block)
  • www.webjars.org
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/boot/plexus-classworlds-2.8.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/vms/vms/web-backend org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests (dns block)
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/boot/plexus-classworlds-2.8.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/vms/vms/web-backend org.codehaus.plexus.classworlds.launcher.Launcher test -Dtest=SQLiteConfigTest (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@axymthr
axymthr marked this pull request as ready for review October 28, 2025 09:53
@axymthr
axymthr merged commit c614dec into develop Nov 4, 2025
4 of 5 checks passed
@axymthr
axymthr deleted the copilot/add-sqlite-persistence-layer branch November 4, 2025 19:13
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