Owoof
A glorified query-builder inspired by Datomic that uses a datalog-like format for querying and modifying information around a SQLite database.
Be warned, this is a toy project not meant to be used for anything serious. It's derpy and has (un)known issues.
This is implemented as a rust library. It is documented, you can read the source or maybe find the documentation published on docs.rs.
There is an accompanying rust executable target that provides a command-line-interface.
CLI
Compile this with cargo build using --features cli --bin cli.
The CLI can be used to initialize new database files, assert/create, retract/remove, or query information.
Here are some examples:
$ echo '' \
| owoof assert
$ echo '' \
| owoof assert
$ owoof '?pet :pet/owner ?owner' \
--show '?pet :pet/name' \
--show '?owner :person/name'
$ owoof '?person :person/starship "USS Enterprise (NCC-1701-D)"' \
'?pet :pet/owner ?person' \
'?pet :pet/name ?n'
Imported from the goodbooks-10k dataset.
$ owoof '?r :rating/score 1' \
'?r :rating/book ?b' \
'?b :book/authors "Dan Brown"' \
--show '?r :rating/user' \
--show '?b :book/title' \
--limit 5
TODO/Caveats
-
Testing is poor. Many "unit tests" require the goodbooks-10k dataset to be available in the project root repository.
-
The schema isn't enforced consistently. For example, you can destroy attributes that are in use. Unsurprisingly, this breaks things and queries will fail. Triggers used to enforce this stuff better but I removed them due to performance reasons and haven't finished enforcing everything at the application-level.
-
Proper logging ought to be implemented. Right now, stuff just vomits all over stderr...
See Also
My blog post associated with this software: https://froghat.ca/blag/dont-woof
License
This is licensed under Apache License, Version 2.0.