Add support for SQLite via a BABASHKA_FEATURE_SQLITE feature flag (#1079)
* implement native sqlite support as a feature flag following [1]
([1] is mentioned as a checklist of sorts as to how to add a new
feature flag in [2])
[1] 13f65f05ae
[2] https://github.com/babashka/babashka/blob/master/doc/build.md
* bump to latest sqlite-jdbc, remove some no longer needed config+libs
based on feedback from borkdude here [1], bump xerial/sqlite-jdbc
3.36.0.3, which includes the graalvm classes and resource config
previously implemented via ericdallo/sqlite-jni-graal-fix and a `-H`
flag in `script/compile`
[1]: https://github.com/babashka/babashka/pull/1079#issuecomment-980533178
This commit is contained in:
parent
803eb33369
commit
f06a749249
6 changed files with 17 additions and 0 deletions
|
|
@ -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` |
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
|
|
|
|||
|
|
@ -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")))
|
||||
|
|
|
|||
|
|
@ -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?
|
||||
|
|
|
|||
Loading…
Reference in a new issue