pods/README.md

43 lines
1.2 KiB
Markdown
Raw Normal View History

2020-05-09 12:03:50 +00:00
# babashka.pods
A library to load babashka pods. Used by babashka but also usable from the JVM
or other [sci](https://github.com/borkdude/sci)-based projects.
2020-05-09 12:09:58 +00:00
More information about babashka pods can be found
[here](https://github.com/borkdude/babashka/blob/master/doc/pods.md).
2020-05-09 12:03:50 +00:00
## Usage
2020-05-09 12:09:58 +00:00
Using [pod-babashka-hsqldb](https://github.com/borkdude/pod-babashka-hsqldb) as
an example pod.
2020-05-09 12:03:50 +00:00
On the JVM:
``` clojure
(require '[babashka.pods :as pods])
2020-05-09 12:03:50 +00:00
(pods/load-pod "pod-babashka-hsqldb")
(require '[pod.babashka.hsqldb :as sql])
(def db "jdbc:hsqldb:mem:testdb;sql.syntax_mys=true")
(sql/execute! db ["create table foo ( foo int );"])
;;=> [#:next.jdbc{:update-count 0}]
```
From the [Small Clojure Interpreter](https://github.com/borkdude/sci):
See [test/babashka/pods/sci_test.clj](test/babashka/pods/sci_test.clj).
2020-05-09 13:28:10 +00:00
## Why JVM support?
- Babashka pods allow you to leverage functionality from other programs
regardless of the technology they were implemented in. As such, pods can be a
2020-05-09 13:29:09 +00:00
light weight replacement for native interop (JNI, JNA, etc.).
2020-05-09 13:28:10 +00:00
- When developing pods, this library can be used to run tests for it on the JVM.
2020-05-09 12:03:50 +00:00
## License
Copyright © 2020 Michiel Borkent
Distributed under the EPL License. See LICENSE.