Expand description
§Polite: SQLite × Polars Integration
A Rust library that provides seamless integration between SQLite databases and Polars DataFrames using ConnectorX for efficient data transfer.
§Features
- Fast data loading: Use ConnectorX to efficiently load SQLite query results into Polars DataFrames
- Easy data writing: Save Polars DataFrames directly to SQLite tables
- Type preservation: Automatic mapping between Polars and SQLite data types
- Simple API: Minimal boilerplate for common database operations
§Quick Start
use polite::{connect_sqlite, to_dataframe, from_dataframe};
use polars::prelude::*;
// Open a SQLite connection
let conn = connect_sqlite(Some("data.db")).unwrap();
// Load data from SQLite into a DataFrame
let df = to_dataframe("data.db", "SELECT * FROM users").unwrap();
// Save a DataFrame to SQLite
from_dataframe(&conn, "new_table", &df).unwrap();§Modules
Re-exports§
pub use dataframe::from_dataframe;pub use dataframe::to_dataframe;pub use db::connect_sqlite;pub use db::execute_query;pub use error::PoliteError;
Modules§
Macros§
- impl_
transport - A macro to help define a Transport.
- impl_
typesystem - Associate physical representations to a typesystem.
Functions§
- load_
dataframe - Create a DataFrame from a SQLite file with error handling and logging.
- save_
dataframe - Save a DataFrame to SQLite with automatic table creation and better error handling.