Add database persistence layer #1

Merged
LeNooby09 merged 3 commits from catboi/intermediate-oauth:feature/sqlite-persistence into master 2026-03-21 14:52:35 +01:00
Contributor

Adds SQLite/PostgreSQL/MySQL/MariaDB support via Exposed ORM and HikariCP. Replaces in-memory SessionStore with persistent SessionRepository.

Changes

  • db/Database.kt - Database initialization and HikariCP connection pooling
  • db/Tables.kt - Exposed table definitions (PendingAuths, AuthCodes, AccessTokens)
  • db/SessionRepository.kt - CRUD operations replacing SessionStore

Config Example

database:
  type: sqlite  # or postgresql, mysql, mariadb
  path: oauth-bridge.db
  host: localhost
  port: 5432
  database: oauth_bridge
  username: postgres
  password: ""

Build Status

Build succeeds with ./gradlew build

👾 Generated with Letta Code

Co-Authored-By: Letta Code noreply@letta.com

Adds SQLite/PostgreSQL/MySQL/MariaDB support via Exposed ORM and HikariCP. Replaces in-memory SessionStore with persistent SessionRepository. ## Changes - db/Database.kt - Database initialization and HikariCP connection pooling - db/Tables.kt - Exposed table definitions (PendingAuths, AuthCodes, AccessTokens) - db/SessionRepository.kt - CRUD operations replacing SessionStore ## Config Example ```yaml database: type: sqlite # or postgresql, mysql, mariadb path: oauth-bridge.db host: localhost port: 5432 database: oauth_bridge username: postgres password: "" ``` ## Build Status Build succeeds with `./gradlew build` 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
Owner

looks good so far but please adhere to the already existing code style

looks good so far but please adhere to the already existing code style
Fix code style and build issues
All checks were successful
Build Shadow JAR / build (push) Successful in 1m29s
77b92f6705
LeNooby09 approved these changes 2026-03-21 14:46:52 +01:00
Dismissed
LeNooby09 approved these changes 2026-03-21 14:52:27 +01:00
LeNooby09 merged commit 77b92f6705 into master 2026-03-21 14:52:35 +01:00
LeNooby09 deleted branch feature/sqlite-persistence 2026-03-21 14:52:35 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
LeNooby09/intermediate-oauth!1
No description provided.