bindings/python: Add "experimental_indexes" parameter to connect()

This commit is contained in:
Pekka Enberg
2025-07-21 12:45:19 +03:00
parent 87f0229e1f
commit 993079e39d

View File

@@ -315,9 +315,10 @@ impl Drop for Connection {
}
#[allow(clippy::arc_with_non_send_sync)]
#[pyfunction]
pub fn connect(path: &str) -> Result<Connection> {
match turso_core::Connection::from_uri(path, false, false) {
#[pyfunction(signature = (path, experimental_indexes=None))]
pub fn connect(path: &str, experimental_indexes: Option<bool>) -> Result<Connection> {
let experimental_indexes = experimental_indexes.unwrap_or(false);
match turso_core::Connection::from_uri(path, experimental_indexes, false) {
Ok((io, conn)) => Ok(Connection { conn, _io: io }),
Err(e) => Err(PyErr::new::<ProgrammingError, _>(format!(
"Failed to create connection: {e:?}"