{"id":14155164,"url":"https://github.com/stainless-steel/sqlite","last_synced_at":"2025-04-08T04:15:09.307Z","repository":{"id":32872722,"uuid":"36466875","full_name":"stainless-steel/sqlite","owner":"stainless-steel","description":"Interface to SQLite","archived":false,"fork":false,"pushed_at":"2024-04-25T07:22:50.000Z","size":460,"stargazers_count":216,"open_issues_count":2,"forks_count":45,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-25T13:46:47.567Z","etag":null,"topics":["bindings","database"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stainless-steel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-28T21:22:19.000Z","updated_at":"2024-06-18T19:53:05.959Z","dependencies_parsed_at":"2024-06-18T20:11:12.427Z","dependency_job_id":null,"html_url":"https://github.com/stainless-steel/sqlite","commit_stats":{"total_commits":430,"total_committers":13,"mean_commits":33.07692307692308,"dds":0.09302325581395354,"last_synced_commit":"4db9121be68f7eaea34c251dfdb980fbcb30ba06"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-steel%2Fsqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-steel%2Fsqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-steel%2Fsqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-steel%2Fsqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stainless-steel","download_url":"https://codeload.github.com/stainless-steel/sqlite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773719,"owners_count":20993639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bindings","database"],"created_at":"2024-08-17T08:02:19.128Z","updated_at":"2025-04-08T04:15:09.281Z","avatar_url":"https://github.com/stainless-steel.png","language":"Rust","funding_links":[],"categories":["database"],"sub_categories":[],"readme":"# SQLite [![Package][package-img]][package-url] [![Documentation][documentation-img]][documentation-url] [![Build][build-img]][build-url]\n\nThe package provides an interface to [SQLite].\n\n## Example\n\nOpen a connection, create a table, and insert a few rows:\n\n```rust\nlet connection = sqlite::open(\":memory:\").unwrap();\n\nlet query = \"\n    CREATE TABLE users (name TEXT, age INTEGER);\n    INSERT INTO users VALUES ('Alice', 42);\n    INSERT INTO users VALUES ('Bob', 69);\n\";\nconnection.execute(query).unwrap();\n```\n\nSelect some rows and process them one by one as plain text, which is generally\nnot efficient:\n\n```rust\nlet query = \"SELECT * FROM users WHERE age \u003e 50\";\n\nconnection\n    .iterate(query, |pairs| {\n        for \u0026(name, value) in pairs.iter() {\n            println!(\"{} = {}\", name, value.unwrap());\n        }\n        true\n    })\n    .unwrap();\n```\n\nRun the same query but using a prepared statement, which is much more efficient\nthan the previous technique:\n\n```rust\nuse sqlite::State;\n\nlet query = \"SELECT * FROM users WHERE age \u003e ?\";\nlet mut statement = connection.prepare(query).unwrap();\nstatement.bind((1, 50)).unwrap();\n\nwhile let Ok(State::Row) = statement.next() {\n    println!(\"name = {}\", statement.read::\u003cString, _\u003e(\"name\").unwrap());\n    println!(\"age = {}\", statement.read::\u003ci64, _\u003e(\"age\").unwrap());\n}\n```\n\nRun the same query but using a cursor, which is iterable:\n\n```rust\nlet query = \"SELECT * FROM users WHERE age \u003e ?\";\n\nfor row in connection\n    .prepare(query)\n    .unwrap()\n    .into_iter()\n    .bind((1, 50))\n    .unwrap()\n    .map(|row| row.unwrap())\n{\n    println!(\"name = {}\", row.read::\u003c\u0026str, _\u003e(\"name\"));\n    println!(\"age = {}\", row.read::\u003ci64, _\u003e(\"age\"));\n}\n```\n\n## Contribution\n\nYour contribution is highly appreciated. Do not hesitate to open an issue or a\npull request. Note that any contribution submitted for inclusion in the project\nwill be licensed according to the terms given in [LICENSE.md](LICENSE.md).\n\n[SQLite]: https://www.sqlite.org\n\n[build-img]: https://github.com/stainless-steel/sqlite/workflows/build/badge.svg\n[build-url]: https://github.com/stainless-steel/sqlite/actions/workflows/build.yml\n[documentation-img]: https://docs.rs/sqlite/badge.svg\n[documentation-url]: https://docs.rs/sqlite\n[package-img]: https://img.shields.io/crates/v/sqlite.svg\n[package-url]: https://crates.io/crates/sqlite\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstainless-steel%2Fsqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstainless-steel%2Fsqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstainless-steel%2Fsqlite/lists"}