Skip to main content

sierradb_client/
lib.rs

1#![allow(unused_parens, deprecated)]
2
3use uuid::{Uuid, uuid};
4
5#[macro_use]
6mod macros;
7mod commands;
8mod error;
9mod options;
10mod subscription;
11mod types;
12
13// Re-export public types
14pub use commands::*;
15// pub use connection::*;
16pub use error::*;
17pub use options::*;
18pub use subscription::*;
19pub use types::*;
20
21// Re-export protocol types for convenience
22pub use sierradb_protocol::{CurrentVersion, ErrorCode, ExpectedVersion, VersionGap};
23
24// Uuid::new_v5(&Uuid::NAMESPACE_DNS, b"sierradb.tqwewe.com")
25pub const NAMESPACE_PARTITION_KEY: Uuid = uuid!("219bd637-e279-53e9-9e2b-eabe5d9120cc");
26
27pub fn stream_partition_key(stream_id: &str) -> Uuid {
28    Uuid::new_v5(&NAMESPACE_PARTITION_KEY, stream_id.as_bytes())
29}