2020-05-06 19:14:14 +00:00
|
|
|
# pod-lispyclouds-sqlite
|
|
|
|
|
|
|
|
|
|
To run this:
|
|
|
|
|
|
|
|
|
|
- Install python3 and sqlite3
|
|
|
|
|
- Create a virtualenv: `python3 -m venv ~/.virtualenvs/babashka`
|
|
|
|
|
- Switch to it: `source ~/.virtualenvs/babashka/bin/activate`
|
|
|
|
|
- Run: `pip install bcoding` to install the bencode lib
|
|
|
|
|
- Create a new db: `sqlite3 /tmp/babashka.db "create table foo (foo int);"`
|
|
|
|
|
|
|
|
|
|
Then run as pod:
|
|
|
|
|
|
|
|
|
|
``` clojure
|
2020-05-06 19:30:56 +00:00
|
|
|
(babashka.pods/load-pod ["./pod-lispyclouds-sqlite.py"])
|
2020-05-06 19:14:14 +00:00
|
|
|
(require '[pod.lispy-clouds.sqlite :as sqlite])
|
|
|
|
|
(sqlite/execute! "create table if not exists foo ( int foo )")
|
|
|
|
|
(sqlite/execute! "delete from foo")
|
|
|
|
|
(sqlite/execute! "insert into foo values (1), (2)")
|
|
|
|
|
(sqlite/execute! "select * from foo") ;;=> ([1] [2])
|
|
|
|
|
```
|