All Projects → stainless-steel → Sqlite

stainless-steel / Sqlite

Licence: other
Interface to SQLite

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Sqlite

D2sqlite3
A small wrapper around SQLite for the D programming language
Stars: ✭ 67 (-9.46%)
Mutual labels:  database, bindings
Laravel Db Normalizer
Normalize all database results to one unified interface, to make swapping repositories a breeze.
Stars: ✭ 72 (-2.7%)
Mutual labels:  database
Keydb
high performance key value database written in Go
Stars: ✭ 70 (-5.41%)
Mutual labels:  database
Mongoaudit
🔥 A powerful MongoDB auditing and pentesting tool 🔥
Stars: ✭ 1,174 (+1486.49%)
Mutual labels:  database
Bolt
Fast approximate vector operations
Stars: ✭ 70 (-5.41%)
Mutual labels:  database
Fruity
Rusty bindings for Apple libraries
Stars: ✭ 72 (-2.7%)
Mutual labels:  bindings
Scan
Scan database/sql rows directly to structs, slices, and primitive types
Stars: ✭ 69 (-6.76%)
Mutual labels:  database
Lxhive
A lightweight Experience API Learning Record Store (LRS)
Stars: ✭ 73 (-1.35%)
Mutual labels:  database
Gnes
GNES is Generic Neural Elastic Search, a cloud-native semantic search system based on deep neural network.
Stars: ✭ 1,178 (+1491.89%)
Mutual labels:  database
Ebean
Ebean ORM
Stars: ✭ 1,172 (+1483.78%)
Mutual labels:  database
Laravel Optimistic Locking
Adds optimistic locking feature to eloquent models.
Stars: ✭ 71 (-4.05%)
Mutual labels:  database
Appdocs
Application Performance Optimization Summary
Stars: ✭ 1,169 (+1479.73%)
Mutual labels:  database
Yukiko
powerful Discord bot that includes XP system, Leaderboard, Music, Welcome and farewell message, Moderation, and much more!
Stars: ✭ 72 (-2.7%)
Mutual labels:  database
Avocado
Strongly-typed MongoDB driver for Rust
Stars: ✭ 70 (-5.41%)
Mutual labels:  database
Tidis
Distributed transactional NoSQL database, Redis protocol compatible using tikv as backend
Stars: ✭ 1,182 (+1497.3%)
Mutual labels:  database
Node Blog
🔥✨ A react blog project base on nodejs, nestjs, mongoose, typescript, react, ant-design,nextjs
Stars: ✭ 69 (-6.76%)
Mutual labels:  database
Wrenpp
Minimal, zero dependency C++ binding generator for the Wren programming language
Stars: ✭ 70 (-5.41%)
Mutual labels:  bindings
Postgresql Provider
PostgreSQL Provider for the Vapor web framework.
Stars: ✭ 71 (-4.05%)
Mutual labels:  database
Ejdb
🏂 EJDB 2.0 — Embeddable JSON Database engine C library. Simple XPath like query language (JQL). Websockets / Android / iOS / React Native / Flutter / Java / Dart / Node.js bindings. Docker image.
Stars: ✭ 1,187 (+1504.05%)
Mutual labels:  database
Locopy
locopy: Loading/Unloading to Redshift and Snowflake using Python.
Stars: ✭ 73 (-1.35%)
Mutual labels:  database

SQLite Package Documentation Build

The package provides an interface to SQLite.

Example

Open a connection, create a table, and insert some rows:

let connection = sqlite::open(":memory:").unwrap();

connection
    .execute(
        "
        CREATE TABLE users (name TEXT, age INTEGER);
        INSERT INTO users VALUES ('Alice', 42);
        INSERT INTO users VALUES ('Bob', 69);
        ",
    )
    .unwrap();

Select some rows and process them one by one as plain text:

connection
    .iterate("SELECT * FROM users WHERE age > 50", |pairs| {
        for &(column, value) in pairs.iter() {
            println!("{} = {}", column, value.unwrap());
        }
        true
    })
    .unwrap();

The same query using a prepared statement, which is much more efficient than the previous technique:

use sqlite::State;

let mut statement = connection
    .prepare("SELECT * FROM users WHERE age > ?")
    .unwrap();

statement.bind(1, 50).unwrap();

while let State::Row = statement.next().unwrap() {
    println!("name = {}", statement.read::<String>(0).unwrap());
    println!("age = {}", statement.read::<i64>(1).unwrap());
}

The same query using a cursor, which is a wrapper around a prepared statement providing the concept of row and featuring all-at-once binding:

use sqlite::Value;

let mut cursor = connection
    .prepare("SELECT * FROM users WHERE age > ?")
    .unwrap()
    .cursor();

cursor.bind(&[Value::Integer(50)]).unwrap();

while let Some(row) = cursor.next().unwrap() {
    println!("name = {}", row[0].as_string().unwrap());
    println!("age = {}", row[1].as_integer().unwrap());
}

Contribution

Your contribution is highly appreciated. Do not hesitate to open an issue or a pull request. Note that any contribution submitted for inclusion in the project will be licensed according to the terms given in LICENSE.md.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].