This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
from sqlite3 import Error | |
from datetime import datetime | |
print(sqlite3.version) | |
# Prefix Load up | |
class PrefixDB: | |
def __init__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[pyclass] | |
struct TestIssue { | |
rt: tokio::runtime::Runtime, | |
} | |
#[pymethods] | |
impl TestIssue { | |
#[new] | |
fn new() -> Self { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"john grishamme", | |
"helloo world, todayy we will party on saturdy", | |
"best booke i've listened to!", | |
"pushing searches to it's limitss!", | |
"here's some searchh samples in all it's glorary", | |
"favouritee " | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::time::Duration; | |
use datacake_crdt::{OrSWotSet, HLCTimestamp}; | |
fn main() { | |
let mut node_a = HLCTimestamp::now(0, 0); | |
// Simulating a node begin slightly ahead in time. | |
let mut node_b = HLCTimestamp::new(node_a.datacake_timestamp() + Duration::from_secs(5), 0, 1); | |
let mut node_a_set = OrSWotSet::default(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use datacake_node::{ClusterExtension, DatacakeNode}; | |
use async_trait::async_trait; | |
pub struct MyExtension; | |
#[async_trait] | |
impl ClusterExtension for MyExtension { | |
type Output = (); | |
type Error = MyError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::net::SocketAddr; | |
use datacake_node::{ConnectionConfig, DCAwareSelector, DatacakeNodeBuilder}; | |
#[tokio::main] | |
async fn main() -> anyhow::Result<()> { | |
let bind_addr = "127.0.0.1:8000".parse::<SocketAddr>().unwrap(); | |
// We setup our connection config for the node passing in the bind address, public address and seed nodes. | |
// Here we're just using the bind address as our public address with no seed, but in the real world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use datacake_node::{ClusterExtension, DatacakeNode}; | |
use async_trait::async_trait; | |
pub struct MyExtension; | |
#[async_trait] | |
impl ClusterExtension for MyExtension { | |
type Output = (); | |
type Error = MyError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::net::SocketAddr; | |
use bytecheck::CheckBytes; | |
use datacake_rpc::{ | |
Channel, | |
Handler, | |
Request, | |
RpcClient, | |
RpcService, | |
Server, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::net::SocketAddr; | |
use datacake_node::{Consistency, ConnectionConfig, DCAwareSelector, DatacakeNodeBuilder}; | |
use datacake_eventual_consistency::test_utils::MemStore; | |
use datacake_eventual_consistency::EventuallyConsistentStoreExtension; | |
async fn main() -> anyhow::Result<()> { | |
let addr = "127.0.0.1:8080".parse::<SocketAddr>().unwrap(); | |
let connection_cfg = ConnectionConfig::new(addr, addr, Vec::<String>::new()); | |
let node = DatacakeNodeBuilder::<DCAwareSelector>::new(1, connection_cfg) | |
.connect() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anyhow::Result; | |
use std::net::SocketAddr; | |
use datacake_eventual_consistency::EventuallyConsistentStoreExtension; | |
use datacake_node::{ | |
ConnectionConfig, | |
Consistency, | |
DCAwareSelector, | |
DatacakeNodeBuilder, | |
}; | |
use datacake_sqlite::SqliteStorage; |
OlderNewer