Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pnc/basque
execute shell commands from a SQLite function
https://github.com/pnc/basque
rust-ffi sqlite sqlite3 sqlite3-extension
Last synced: 24 days ago
JSON representation
execute shell commands from a SQLite function
- Host: GitHub
- URL: https://github.com/pnc/basque
- Owner: pnc
- Created: 2019-03-17T16:26:38.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-23T18:19:15.000Z (almost 6 years ago)
- Last Synced: 2024-12-13T06:04:54.333Z (27 days ago)
- Topics: rust-ffi, sqlite, sqlite3, sqlite3-extension
- Language: Rust
- Size: 20.5 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Basque - execute shell commands from SQLite
## Pitch
`xargs`/`parallel` are all fun and games until you need to include or escape quotes. What if you could use the full power of SQLite to generate, query, and store the results of shell commands?
## Anti-pitch
Anything you could do by running shell commands from SQLite, you could do by piping the output of those commands to SQLite using the incredible [q](http://harelba.github.io/q/) tool. You probably want that instead.
## Example usage
```bash
$ cargo build
$ sqlite3
``````sql
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .load ./target/debug/libbasque
sqlite> create table websites(url text, body text);
sqlite> insert into websites(url) values('https://www.sqlite.org/');
sqlite> insert into websites(url) values('https://www.rust-lang.org/');
sqlite> update websites set body = basque_cmd("curl", "-L", url);
sqlite> select url, substr(body, 1, 20) from websites;
https://www.sqlite.org/|*
*
*
*
*
*