Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(storage): re-export rusqlite from the storage driver

Steven Enamakeld2087d0fad83
diff --git a/crates/openhuman-core/src/config/workspace/state.rs b/crates/openhuman-core/src/config/workspace/state.rs
index b28795658d..61f03fc57f 100644
--- a/crates/openhuman-core/src/config/workspace/state.rs
+++ b/crates/openhuman-core/src/config/workspace/state.rs
@@ -23,6 +23,7 @@
//! );
//! ```
+use crate::storage::rusqlite;
use rusqlite::{params, Connection, OptionalExtension, Result as SqlResult};
use std::path::{Path, PathBuf};
diff --git a/crates/openhuman-core/src/cron/policy.rs b/crates/openhuman-core/src/cron/policy.rs
index 2ee7b50c34..f37286f94a 100644
--- a/crates/openhuman-core/src/cron/policy.rs
+++ b/crates/openhuman-core/src/cron/policy.rs
@@ -14,6 +14,7 @@
//! running is skipped silently. `true` additionally records each missed slot
//! as a `skipped` run and refuses a manual "Run now" while a run is in flight.
+use crate::storage::rusqlite;
use std::path::PathBuf;
use anyhow::{Context, Result};
diff --git a/crates/openhuman-core/src/cron/policy_tests.rs b/crates/openhuman-core/src/cron/policy_tests.rs
index 0a24d578ff..156af3f64c 100644
--- a/crates/openhuman-core/src/cron/policy_tests.rs
+++ b/crates/openhuman-core/src/cron/policy_tests.rs
@@ -1,3 +1,4 @@
+use crate::storage::rusqlite;
use super::*;
use tempfile::TempDir;
use tinyflows_schedule::types::Schedule;
diff --git a/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs b/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
index 6de113dc6e..abecfbd33e 100644
--- a/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
@@ -2,6 +2,7 @@
//! dispatched twice, single-flight skips are recorded, per-job retry budgets
//! are honoured and a system job's handler result is what gets recorded.
+use crate::storage::rusqlite;
use super::*;
use crate::cron::policy::{set_policy, JobPolicy};
use crate::cron::system_job_handlers::{register, SystemJobContext};
diff --git a/crates/openhuman-core/src/desktop/notifications/store.rs b/crates/openhuman-core/src/desktop/notifications/store.rs
index b0c1f91d02..8eb6bc5379 100644
--- a/crates/openhuman-core/src/desktop/notifications/store.rs
+++ b/crates/openhuman-core/src/desktop/notifications/store.rs
@@ -6,6 +6,7 @@
//! Uses a synchronous `rusqlite::Connection` opened per call, following the
//! same `with_connection` pattern as the cron domain.
+use crate::storage::rusqlite;
use anyhow::{Context, Result};
use chrono::Utc;
use rusqlite::{params, Connection};
diff --git a/crates/openhuman-core/src/desktop/notifications/store/store_rows.rs b/crates/openhuman-core/src/desktop/notifications/store/store_rows.rs
index abafb02a1f..ffc7a12aa8 100644
--- a/crates/openhuman-core/src/desktop/notifications/store/store_rows.rs
+++ b/crates/openhuman-core/src/desktop/notifications/store/store_rows.rs
@@ -1,5 +1,6 @@
//! Row conversion for the SQLite notification store.
+use crate::storage::rusqlite;
use anyhow::{Context, Result};
use chrono::{DateTime, Utc};
diff --git a/crates/openhuman-core/src/desktop/notifications/store_import.rs b/crates/openhuman-core/src/desktop/notifications/store_import.rs
index 8e53d5bab8..b8f811e945 100644
--- a/crates/openhuman-core/src/desktop/notifications/store_import.rs
+++ b/crates/openhuman-core/src/desktop/notifications/store_import.rs
@@ -15,6 +15,7 @@
//! ([`crate::storage::local`]) writes the documents and then renames the
//! tables to `_legacy_<name>`.
+use crate::storage::rusqlite;
use anyhow::{Context, Result};
use rusqlite::Connection;
use serde_json::json;
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
index 70376e0711..79bc7ac735 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
@@ -1,3 +1,4 @@
+use crate::storage::rusqlite;
use super::*;
use tinyagents_harness::tool::response_fields_from_schema;
use tinyflows::nodes::integration::agent_prompt::scale_timeout_for_iteration_cap;
diff --git a/crates/openhuman-core/src/integrations/task_sources/store.rs b/crates/openhuman-core/src/integrations/task_sources/store.rs
index 3625b5ef09..777c21a572 100644
--- a/crates/openhuman-core/src/integrations/task_sources/store.rs
+++ b/crates/openhuman-core/src/integrations/task_sources/store.rs
@@ -12,6 +12,7 @@
//! function here is served from the document port instead
//! (`store_documents.rs`).
+use crate::storage::rusqlite;
use std::collections::HashSet;
use std::path::{Path, PathBuf};
use std::sync::{Mutex, OnceLock};
diff --git a/crates/openhuman-core/src/integrations/task_sources/store/store_rows.rs b/crates/openhuman-core/src/integrations/task_sources/store/store_rows.rs
index a6f43d9760..017b35e212 100644
--- a/crates/openhuman-core/src/integrations/task_sources/store/store_rows.rs
+++ b/crates/openhuman-core/src/integrations/task_sources/store/store_rows.rs
@@ -1,5 +1,6 @@
//! Row conversion for the SQLite task-source store.
+use crate::storage::rusqlite;
use anyhow::{Context, Result};
use chrono::{DateTime, Utc};
diff --git a/crates/openhuman-core/src/integrations/task_sources/store_import.rs b/crates/openhuman-core/src/integrations/task_sources/store_import.rs
index 25e11c4754..3b95d0a75d 100644
--- a/crates/openhuman-core/src/integrations/task_sources/store_import.rs
+++ b/crates/openhuman-core/src/integrations/task_sources/store_import.rs
@@ -7,6 +7,7 @@
//! ([`crate::storage::local`]) writes the documents and then renames the
//! tables to `_legacy_<name>`.
+use crate::storage::rusqlite;
use anyhow::{Context, Result};
use chrono::DateTime;
use rusqlite::Connection;
diff --git a/crates/openhuman-core/src/integrations/task_sources/store_import_tests.rs b/crates/openhuman-core/src/integrations/task_sources/store_import_tests.rs
index 175253a795..24e82ab890 100644
--- a/crates/openhuman-core/src/integrations/task_sources/store_import_tests.rs
+++ b/crates/openhuman-core/src/integrations/task_sources/store_import_tests.rs
@@ -1,3 +1,4 @@
+use crate::storage::rusqlite;
use super::*;
use crate::integrations::composio::contract::NormalizedTask;
use crate::integrations::task_sources::store as live;
diff --git a/crates/openhuman-core/src/integrations/task_sources/store_tests.rs b/crates/openhuman-core/src/integrations/task_sources/store_tests.rs
index 4b37a7b52c..c7ef6203d8 100644
--- a/crates/openhuman-core/src/integrations/task_sources/store_tests.rs
+++ b/crates/openhuman-core/src/integrations/task_sources/store_tests.rs
@@ -1,3 +1,4 @@
+use crate::storage::rusqlite;
use super::*;
use crate::config::Config;
use serde_json::json;
diff --git a/crates/openhuman-core/src/memory/import_connector_tests.rs b/crates/openhuman-core/src/memory/import_connector_tests.rs
index 1b2084e5c3..b415f41cb0 100644
--- a/crates/openhuman-core/src/memory/import_connector_tests.rs
+++ b/crates/openhuman-core/src/memory/import_connector_tests.rs
@@ -1,5 +1,6 @@
//! The import leaves out what v1 synced from Composio and the connectors.
+use crate::storage::rusqlite;
use super::tests::{chunk_only_workspace, legacy_workspace, memory_doc, wait_until_settled};
use super::*;
use crate::memory::test_fixtures::{bind_reference, config_in, stored};
diff --git a/crates/openhuman-core/src/memory/import_tests.rs b/crates/openhuman-core/src/memory/import_tests.rs
index 5be906d7b2..3f13eb2791 100644
--- a/crates/openhuman-core/src/memory/import_tests.rs
+++ b/crates/openhuman-core/src/memory/import_tests.rs
@@ -1,3 +1,4 @@
+use crate::storage::rusqlite;
use super::*;
use crate::memory::error::{INVALID_REQUEST, MEMORY_OFF};
use crate::memory::test_fixtures::{bind_reference, config_in, stored};
diff --git a/crates/openhuman-core/src/security/approval/store.rs b/crates/openhuman-core/src/security/approval/store.rs
index 6671e71abd..8bb896cffe 100644
--- a/crates/openhuman-core/src/security/approval/store.rs
+++ b/crates/openhuman-core/src/security/approval/store.rs
@@ -30,6 +30,7 @@
//! mode without one). With no backend — the desktop default — nothing
//! changes and `approval/approval.db` is used as before.
+use crate::storage::rusqlite;
use anyhow::{Context, Result};
use chrono::{DateTime, Utc};
use rusqlite::{params, types::Type, Connection};
diff --git a/crates/openhuman-core/src/security/approval/store_agent.rs b/crates/openhuman-core/src/security/approval/store_agent.rs
index 61ff8cfa5f..8e1cfd74ea 100644
--- a/crates/openhuman-core/src/security/approval/store_agent.rs
+++ b/crates/openhuman-core/src/security/approval/store_agent.rs
@@ -1,6 +1,7 @@
//! Approval rows by the embedded agent that parked them, and whether the
//! store exists to hold any.
+use crate::storage::rusqlite;
use anyhow::{Context, Result};
use rusqlite::params;
diff --git a/crates/openhuman-core/src/security/approval/store_flow_trust.rs b/crates/openhuman-core/src/security/approval/store_flow_trust.rs
index 89540d925e..be253f0a6a 100644
--- a/crates/openhuman-core/src/security/approval/store_flow_trust.rs
+++ b/crates/openhuman-core/src/security/approval/store_flow_trust.rs
@@ -6,6 +6,7 @@
//! this flow" grants used by `ApprovalGate::intercept_audited` to
//! short-circuit parking for a trusted flow/tool pair.
+use crate::storage::rusqlite;
use anyhow::{Context, Result};
use chrono::Utc;
use rusqlite::params;
diff --git a/crates/openhuman-core/src/security/approval/store_import.rs b/crates/openhuman-core/src/security/approval/store_import.rs
index 86a5d2f3d4..4af709c277 100644
--- a/crates/openhuman-core/src/security/approval/store_import.rs
+++ b/crates/openhuman-core/src/security/approval/store_import.rs
@@ -9,6 +9,7 @@
//! ([`crate::storage::local`]) writes them and then renames both tables to
//! `_legacy_<name>`.
+use crate::storage::rusqlite;
use anyhow::{Context, Result};
use chrono::{DateTime, Utc};
use rusqlite::Connection;
diff --git a/crates/openhuman-core/src/security/approval/store_import_tests.rs b/crates/openhuman-core/src/security/approval/store_import_tests.rs
index 02693e3bd5..d3faf24d5a 100644
--- a/crates/openhuman-core/src/security/approval/store_import_tests.rs
+++ b/crates/openhuman-core/src/security/approval/store_import_tests.rs
@@ -1,3 +1,4 @@
+use crate::storage::rusqlite;
use super::*;
use crate::security::approval::store as live;
use crate::security::approval::types::{
diff --git a/crates/openhuman-core/src/security/approval/store_tests.rs b/crates/openhuman-core/src/security/approval/store_tests.rs
index 35f1f7d604..9cac1b70af 100644
--- a/crates/openhuman-core/src/security/approval/store_tests.rs
+++ b/crates/openhuman-core/src/security/approval/store_tests.rs
@@ -1,3 +1,4 @@
+use crate::storage::rusqlite;
use super::*;
use crate::security::approval::types::{ApprovalDecision, PendingApproval};
use chrono::Duration;
diff --git a/crates/openhuman-core/src/security/devices/store.rs b/crates/openhuman-core/src/security/devices/store.rs
index 31014b1354..1448f79ae1 100644
--- a/crates/openhuman-core/src/security/devices/store.rs
+++ b/crates/openhuman-core/src/security/devices/store.rs
@@ -8,6 +8,7 @@
//! workspace directory, execute DDL on each open (idempotent), then run
//! the requested query and return.
+use crate::storage::rusqlite;
use anyhow::{Context, Result};
use chrono::Utc;
use rusqlite::{params, Connection};
diff --git a/crates/openhuman-core/src/security/devices/store_import.rs b/crates/openhuman-core/src/security/devices/store_import.rs
index 9ea46fb69d..0dcd8cc7f2 100644
--- a/crates/openhuman-core/src/security/devices/store_import.rs
+++ b/crates/openhuman-core/src/security/devices/store_import.rs
@@ -5,6 +5,7 @@
//! carried over. The driver ([`crate::storage::local`]) writes the documents
//! and then renames the table to `_legacy_paired_devices`.
+use crate::storage::rusqlite;
use anyhow::{Context, Result};
use rusqlite::Connection;
use serde_json::{json, Value};
diff --git a/crates/openhuman-core/src/security/devices/store_import_tests.rs b/crates/openhuman-core/src/security/devices/store_import_tests.rs
index 8495469c7e..084c9e914f 100644
--- a/crates/openhuman-core/src/security/devices/store_import_tests.rs
+++ b/crates/openhuman-core/src/security/devices/store_import_tests.rs
@@ -1,3 +1,4 @@
+use crate::storage::rusqlite;
use super::*;
use crate::security::devices::store as live;
use crate::storage::local::{forget, table_names};
diff --git a/crates/openhuman-core/src/storage/local.rs b/crates/openhuman-core/src/storage/local.rs
index 6cff339ca3..10fade6bff 100644
--- a/crates/openhuman-core/src/storage/local.rs
+++ b/crates/openhuman-core/src/storage/local.rs
@@ -35,6 +35,7 @@
//! out ([`super::config::CLASSIC`]), in SaaS mode, or in a build without
//! `storage-sqlite`: those keep the legacy tables.
+use crate::storage::rusqlite;
use std::path::Path;
use std::sync::Arc;
#[cfg(feature = "storage-sqlite")]
diff --git a/crates/openhuman-core/src/storage/mod.rs b/crates/openhuman-core/src/storage/mod.rs
index e126aeef1f..2de3d94e7a 100644
--- a/crates/openhuman-core/src/storage/mod.rs
+++ b/crates/openhuman-core/src/storage/mod.rs
@@ -36,6 +36,10 @@ pub mod secrets;
use std::future::Future;
use std::sync::{Arc, LazyLock, OnceLock, RwLock};
+/// SQLite bindings re-exported by the storage driver crate, for the readers
+/// of legacy per-domain SQLite files. The core has no `rusqlite` dependency
+/// of its own: tinystoragedrivers owns the one copy.
+pub use tinystoragedrivers::sqlite::rusqlite;
pub use tinystoragedrivers::{
Blocking, CollectionSpec, DocumentStore, DocumentStoreExt, MemoryStorage, Precondition, Scope,
ScopedStorage, StorageBackend, StorageConfig as StorageUrl, StorageError,
diff --git a/tests/storage_default_import_e2e.rs b/tests/storage_default_import_e2e.rs
index 505b15c3a7..21cc18c8bb 100644
--- a/tests/storage_default_import_e2e.rs
+++ b/tests/storage_default_import_e2e.rs
@@ -4,6 +4,7 @@
//! tables once and keeps them as `_legacy_<name>`. Through the real binary
//! and its JSON-RPC surface.
+use openhuman_core::storage::rusqlite;
use std::path::Path;
use std::process::{Child, Command, Stdio};
use std::time::{Duration, Instant};