| Crates.io | wavesyncdb |
| lib.rs | wavesyncdb |
| version | 0.2.0 |
| created_at | 2025-12-23 15:21:58.09582+00 |
| updated_at | 2025-12-23 15:21:58.09582+00 |
| description | WaveSyncDB is a lightweight, distributed database synchronization engine designed to bridge the gap between real-time data streaming and relational storage. It ensures high-consistency data replication across decentralized nodes with a focus on low-latency updates. |
| homepage | |
| repository | https://github.com/pvg13/WaveSyncDB |
| max_upload_size | |
| id | 2001714 |
| size | 135,008 |
WaveSyncDB is a lightweight, distributed database synchronization engine designed for high-consistency data replication. It bridges the gap between real-time data streaming and relational storage, ensuring that your decentralized nodes stay in perfect harmony with low-latency "wave" updates.
To get started with WaveSyncDB, clone the repository:
git clone [https://github.com/pvg13/WaveSyncDB.git](https://github.com/pvg13/WaveSyncDB.git)
cd WaveSyncDB
Check out the examples folder for more complex usage
For a quick start:
pub fn main() {
let database_url = std::env::var("DATABASE_URL").expect("DATABASE_URL must be set");
// Create a pool connection
let manager = ConnectionManager::<SqliteConnection>::new(database_url);
let pool = Pool::builder()
.max_size(16)
.build(manager)?;
// Connection used by the user
let conn = pool.get().unwrap();
// Set up the channels
let (tx, rx) = tokio::sync::mpsc::channel(100);
// Add a custom topic
let topic = "topic";
// Set the instrumentation as the WaveSyncInstrument
conn.set_instrumentation(WaveSyncInstrument::new(tx, topic, DialectType::SQLite));
// Start the Wavesync engine to run in the background
let mut wavesync_engine = wavesyncdb::sync::WaveSyncEngine::new(rx, pool.get()?, "wsexample");
tokio::spawn(async move {
wavesync_engine.run().await;
});
// Use the diesel connection as usual
...
diesel::insert_into(schema::tasks::table)
.values(&new_task)
.execute(&mut alice)
.expect("Error inserting new task");
}