4 releases
| 0.1.3 | Aug 26, 2025 |
|---|---|
| 0.1.2 | Aug 26, 2025 |
| 0.1.1 | Aug 26, 2025 |
| 0.1.0 | Aug 25, 2025 |
#2026 in Database interfaces
77 downloads per month
210KB
4K
SLoC
polite-cli
A command-line interface for polite, the rusqlite × Polars bridge library.
Installation
cargo install polite-cli
Usage
The CLI takes:
polite "<SQL>" <DB_PATH>
and automatically decides:
- If the SQL starts with
SELECT→ runs it and prints a PolarsDataFrame. - Otherwise → executes the statement and prints rows affected.
⚠️ Important:
ConnectorX (used internally for DataFrame reads) requires a file-backed database.
You must provide a database file path (e.g. mydb.sqlite). In-memory databases (:memory:) are not supported.
Create a table
polite "CREATE TABLE t (id INTEGER, name TEXT)" mydb.sqlite
Insert a row
polite "INSERT INTO t VALUES (1, 'Alice')" mydb.sqlite
Query into a DataFrame
polite "SELECT * FROM t" mydb.sqlite
Example
polite "CREATE TABLE users (id INTEGER, name TEXT)" example.sqlite
polite "INSERT INTO users VALUES (1, 'Bob')" example.sqlite
polite "SELECT * FROM users" example.sqlite
Notes
- File-backed SQLite databases only. ConnectorX cannot read from in-memory databases.
- Temporary files (
tempfile) are a good option if you don’t want the DB to persist.
Documentation
- Library crate: polite
- Workspace guide: DEVELOPMENT.md
License
Licensed under the MIT License. See LICENSE for details.
Dependencies
~88MB
~1.5M SLoC