Skip to content

Instantly share code, notes, and snippets.

View markazmierczak's full-sized avatar

Marcin Kaźmierczak markazmierczak

View GitHub Profile
@markazmierczak
markazmierczak / Cargo.toml
Last active March 8, 2022 01:33
Sqlx - Sqlite Pool
[package]
name = "sqlx-pool-sqlite"
version = "0.1.0"
edition = "2018"
[dependencies]
sqlx = { version = "0.4", default-features = false, features = [ "runtime-tokio-native-tls", "macros", "sqlite" ] }
tokio = { version = "0.2", features = ["full"] }
@markazmierczak
markazmierczak / Cargo.toml
Created November 1, 2020 07:03
Multiple writers with SQLite and diesel
[package]
name = "r2d2-locked"
version = "0.1.0"
edition = "2018"
[dependencies]
crossbeam = { version = "0.7.1" }
diesel = { version = "1.4.2", features = ["sqlite", "r2d2"] }
tokio = { version = "0.2", features = ["full"] }
// License: MIT OR Apache-2.0
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, LinkedList, VecDeque};
use std::fmt;
use std::hash::{BuildHasher, Hash};
use std::marker::PhantomData;
pub trait SerializeAs<T> {
fn serialize_as<S>(source: &T, serializer: S) -> Result<S::Ok, S::Error>