| Crates.io | libsql_core |
| lib.rs | libsql_core |
| version | 0.0.1 |
| created_at | 2023-07-11 14:07:02.906547+00 |
| updated_at | 2023-07-11 14:07:02.906547+00 |
| description | libSQL library: the main gateway for interacting with the database |
| homepage | |
| repository | https://github.com/libsql/libsql |
| max_upload_size | |
| id | 913813 |
| size | 95,973 |
use libsql_core::Database;
let db = Database::open("hello.db");
let conn = db.connect().unwrap();
conn.execute("CREATE TABLE IF NOT EXISTS users (email TEXT)", ()).unwrap();
conn.execute("INSERT INTO users (email) VALUES ('alice@example.org')", ()).unwrap();
let rows = conn.execute("SELECT * FROM users WHERE email = ?", params!["alice@example.org"]).unwrap().unwrap();
let row = rows.next().unwrap().unwrap();
// prints "alice@example.org"
println!("{}", row.get::<&str>(0).unwrap());
Setting up the environment:
export LIBSQL_STATIC_LIB_DIR=$(pwd)/../../.libs
Building the APIs:
cargo build
Running the tests:
cargo test
Running the benchmarks:
cargo bench
Run benchmarks and generate flamegraphs:
echo -1 | sudo tee /proc/sys/kernel/perf_event_paranoid
cargo bench --bench benchmark -- --profile-time=5