sqlvec

Crates.iosqlvec
lib.rssqlvec
version0.0.2
sourcesrc
created_at2024-02-15 23:32:44.382143
updated_at2024-03-02 18:34:19.92994
descriptionA generic container for vectors allowing for rusqlite operations
homepagehttps://github.com/5-pebbles/sqlvec
repositoryhttps://github.com/5-pebbles/sqlvec
max_upload_size
id1141710
size42,828
Owen Friedman (5-pebbles)

documentation

README

SqlVec

A generic container for vectors allowing for rusqlite operations.

The vector must contain elements that implement ToString & FromStr.

SqlVec implements ToSql & FromSql storing values as \u{F1} delimited text.

If the sqlite conversion is to be bidirectional then the ToString & FromStr must also be bidirectional.

[dependencies]
sqlvec = { version = "0.0.1", features = ["serde"] }

Usage

Wrap a vector with SqlVec before passing to the database.

use sqlvec::SqlVec;

let values = SqlVec::new(vec!["one".to_string(), "two".to_string()]);
connection.execute(
    "INSERT INTO test (data) VALUES (?1)",
    params![values],
).unwrap();
Commit count: 0

cargo fmt