#sqlite #polars #schema #command-line

app polite-cli

Command-line interface for rusqlite × Polars integration

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

Download history 130/week @ 2025-08-20 92/week @ 2025-08-27 7/week @ 2025-09-03 3/week @ 2025-10-01

77 downloads per month

MIT license

210KB
4K SLoC

polite-cli

crates.io MIT licensed

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 Polars DataFrame.
  • 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

License

Licensed under the MIT License. See LICENSE for details.

Dependencies

~88MB
~1.5M SLoC