diff --git a/doc/build.md b/doc/build.md index 4fe43140..a5f83235 100644 --- a/doc/build.md +++ b/doc/build.md @@ -107,6 +107,7 @@ Babashka supports the following feature flags: | `BABASHKA_FEATURE_TEST_CHECK` | Includes the [clojure.test.check](https://github.com/clojure/test.check) library | `true` | | `BABASHKA_FEATURE_SPEC_ALPHA` | Includes the [clojure.spec.alpha](https://github.com/clojure/spec.alpha) library (WIP) | `false` | | `BABASHKA_FEATURE_JDBC` | Includes the [next.jdbc](https://github.com/seancorfield/next-jdbc) library | `false` | +| `BABASHKA_FEATURE_SQLITE` | Includes the [sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) library | `false` | | `BABASHKA_FEATURE_POSTGRESQL` | Includes the [PostgresSQL](https://jdbc.postgresql.org/) JDBC driver | `false` | | `BABASHKA_FEATURE_HSQLDB` | Includes the [HSQLDB](http://www.hsqldb.org/) JDBC driver | `false` | | `BABASHKA_FEATURE_ORACLEDB` | Includes the [Oracle](https://www.oracle.com/database/technologies/appdev/jdbc.html) JDBC driver | `false` | diff --git a/project.clj b/project.clj index 9e4c4fee..565462c9 100644 --- a/project.clj +++ b/project.clj @@ -33,6 +33,7 @@ :dependencies [[clj-commons/clj-yaml "0.7.107"]]} :feature/jdbc {:source-paths ["feature-jdbc"] :dependencies [[seancorfield/next.jdbc "1.1.610"]]} + :feature/sqlite [:feature/jdbc {:dependencies [[org.xerial/sqlite-jdbc "3.36.0.3"]]}] :feature/postgresql [:feature/jdbc {:dependencies [[org.postgresql/postgresql "42.2.18"]]}] ;:feature/oracledb [:feature/jdbc {:dependencies [[com.oracle.database.jdbc/ojdbc8 "19.8.0.0"]]}] :feature/oracledb [:feature/jdbc {:dependencies [[io.helidon.integrations.db/ojdbc "2.1.0"]]}] ; ojdbc10 + GraalVM config, by Oracle diff --git a/script/uberjar b/script/uberjar index 6a318385..f595aef8 100755 --- a/script/uberjar +++ b/script/uberjar @@ -35,6 +35,13 @@ else BABASHKA_LEIN_PROFILES+=",-feature/jdbc" fi +if [ "$BABASHKA_FEATURE_SQLITE" = "true" ] +then + BABASHKA_LEIN_PROFILES+=",+feature/sqlite" +else + BABASHKA_LEIN_PROFILES+=",-feature/sqlite" +fi + if [ "$BABASHKA_FEATURE_POSTGRESQL" = "true" ] then BABASHKA_LEIN_PROFILES+=",+feature/postgresql" diff --git a/script/uberjar.bat b/script/uberjar.bat index 38ab72ff..b7bcd2d1 100755 --- a/script/uberjar.bat +++ b/script/uberjar.bat @@ -16,6 +16,12 @@ if "%BABASHKA_FEATURE_JDBC%"=="true" ( set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,-feature/jdbc ) +if "%BABASHKA_FEATURE_SQLITE%"=="true" ( + set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,+feature/sqlite +) else ( + set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,-feature/sqlite +) + if "%BABASHKA_FEATURE_POSTGRESQL%"=="true" ( set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,+feature/postgresql ) else ( diff --git a/src/babashka/impl/features.clj b/src/babashka/impl/features.clj index 96b59978..22c7a326 100644 --- a/src/babashka/impl/features.clj +++ b/src/babashka/impl/features.clj @@ -19,6 +19,7 @@ ;; excluded by default (def jdbc? (= "true" (System/getenv "BABASHKA_FEATURE_JDBC"))) +(def sqlite? (= "true" (System/getenv "BABASHKA_FEATURE_SQLITE"))) (def postgresql? (= "true" (System/getenv "BABASHKA_FEATURE_POSTGRESQL"))) (def oracledb? (= "true" (System/getenv "BABASHKA_FEATURE_ORACLEDB"))) (def hsqldb? (= "true" (System/getenv "BABASHKA_FEATURE_HSQLDB"))) diff --git a/src/babashka/main.clj b/src/babashka/main.clj index 71ccd55a..b947a50c 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -253,6 +253,7 @@ Use bb run --help to show this help output. features/xml? features/yaml? features/jdbc? + features/sqlite? features/postgresql? features/hsqldb? features/oracledb?