This commit is contained in:
Luciano Laratelli 2025-04-11 13:52:56 -04:00
parent 1f6111c632
commit 394e2f9b51
3 changed files with 10 additions and 3 deletions

View file

@ -11,7 +11,7 @@ RUN clojure -T:build uberjar
FROM eclipse-temurin:21-alpine
RUN apk add --no-cache libstdc++ sqlite
RUN apk add --no-cache libstdc++ curl sqlite
RUN addgroup -S atlantico-software && \
adduser -S atlantico-software -G atlantico-software

View file

@ -1 +1 @@
PRAGMA journal_mode=WAL;
SELECT 1;

View file

@ -1,5 +1,7 @@
(ns com.score-the-pigs
(:require
[babashka.process :as process]
[clojure.string :as str]
[clojure.test :as test]
[com.biffweb :as biff]
[com.score-the-pigs.app :as app]
@ -59,7 +61,12 @@
(defn use-sqlite [ctx]
(let [db-url (get ctx :example/db-url)
ds (jdbc/get-datasource db-url)
migration-config (ctx->migratus-config ctx)]
migration-config (ctx->migratus-config ctx)
db-loc (-> db-url
(str/split #":")
last)]
(process/shell (str "sqlite3" db-loc "'PRAGMA journal_mode=WAL;'"))
(migratus/init migration-config)
(migratus/migrate migration-config)