Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ include("velocity-api") // OpenAPI 3.1 document + shared API DTOs (source o
include("velocity-testkit") // in-memory velocity-spi impl, conformance TCK scenarios, fixtures

// Phase 2 — v1 reference backends (tumbling + sliding), the service tier, and the generated client.
// include("velocity-backend-jdbi") // Postgres/JDBI backend — v1 tumbling reference
include("velocity-backend-jdbi") // Postgres/JDBI backend — v1 tumbling reference
// include("velocity-backend-redis") // Redis/Lettuce backend — v1 sliding / hot-path reference
// include("velocity-dropwizard") // Dropwizard bundle, Jersey resources, Dagger wiring, API-key auth
// include("velocity-client-java") // Java client generated from OpenAPI via openapi-generator
Expand Down
49 changes: 49 additions & 0 deletions velocity-backend-jdbi/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
plugins {
id("velocity.library-conventions")
id("velocity.test-conventions")
id("velocity.publish-conventions")
}

description =
"velocity-backend-jdbi: the v1 Postgres/JDBI tumbling reference backend — an exact, atomic," +
" read-your-write VelocityBackend (COUNT/SUM/DISTINCT over tumbling windows) that passes the" +
" velocity-testkit conformance TCK against real Postgres via Testcontainers."

// JDBI, HikariCP, PostgreSQL and Testcontainers ship as automatic modules (no module-info); the
// baseline -Xlint:all makes their `requires` a warning, which -Werror (library-conventions) turns
// fatal. Mirror the pk-auth JDBI module and silence just the automatic-module lints on both the
// main and test compiles.
tasks.named<JavaCompile>("compileJava") {
options.compilerArgs.addAll(
listOf("-Xlint:-requires-automatic", "-Xlint:-requires-transitive-automatic"),
)
}
tasks.named<JavaCompile>("compileTestJava") {
options.compilerArgs.addAll(
listOf("-Xlint:-requires-automatic", "-Xlint:-requires-transitive-automatic"),
)
}

dependencies {
// The frozen contract this backend implements is on the api surface.
api(project(":velocity-spi"))
api(libs.jspecify)

implementation(libs.jdbi.core)
implementation(libs.postgresql)
implementation(libs.hikaricp)
implementation(libs.slf4j.api)

// JDBI's class files reference com.google.errorprone.annotations.concurrent.GuardedBy; without
// errorprone-annotations on the compile classpath javac emits an annotation-not-found warning
// that -Werror turns fatal. compileOnly so it is not broadcast as a runtime dependency.
compileOnly(libs.build.errorprone.annotations)
testCompileOnly(libs.build.errorprone.annotations)

// The testkit drives the conformance TCK (*Scenarios) + MutableClock against this backend.
testImplementation(project(":velocity-testkit"))
testImplementation(libs.testcontainers.core)
testImplementation(libs.testcontainers.junit.jupiter)
testImplementation(libs.testcontainers.postgresql)
testRuntimeOnly(libs.logback.classic)
}
Loading
Loading