{"id":13484745,"url":"https://github.com/kawasin73/prsqlite","last_synced_at":"2025-03-27T16:31:16.809Z","repository":{"id":186242524,"uuid":"603339868","full_name":"kawasin73/prsqlite","owner":"kawasin73","description":"Pure Rust implementation of SQLite","archived":false,"fork":false,"pushed_at":"2024-08-25T15:29:41.000Z","size":770,"stargazers_count":604,"open_issues_count":23,"forks_count":27,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-03-02T00:56:12.114Z","etag":null,"topics":["sqlite","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kawasin73.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/code-of-conduct.md","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":"2023-02-18T07:53:47.000Z","updated_at":"2025-02-05T05:20:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"303fa538-5f79-4035-8320-0cccd15db112","html_url":"https://github.com/kawasin73/prsqlite","commit_stats":null,"previous_names":["kawasin73/prsqlite"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawasin73%2Fprsqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawasin73%2Fprsqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawasin73%2Fprsqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawasin73%2Fprsqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kawasin73","download_url":"https://codeload.github.com/kawasin73/prsqlite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245882352,"owners_count":20687870,"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":["sqlite","sqlite3"],"created_at":"2024-07-31T17:01:32.264Z","updated_at":"2025-03-27T16:31:15.821Z","avatar_url":"https://github.com/kawasin73.png","language":"Rust","readme":"# prsqlite - Pure Rust SQLite\n\nPure Rust implementation of [SQLite](https://www.sqlite.org/index.html).\n\nThis is WIP and my hobby project.\n\n* Compatible with database file generated by sqlite3\n  * prsqlite uses the SQLite\n  [Database File Format](https://www.sqlite.org/fileformat2.html#b_tree_pages).\n* Support SQL syntax which SQLite supports\n  * See [SQL As Understood By SQLite](https://www.sqlite.org/lang.html).\n  * Some syntax is not implemented yet.\n* Zero dependency\n  * except dev-dependency.\n  * While developing as WIP, prsqlite is using `anyhow` for development\n  velocity. It will be replaced with a proprietary errors in the future.\n* Validating file format\n  * prsqlite does not trust the file is valid unlike sqlite3 and validates pages\n  in the file while parsing.\n  * `trust-file` feature will be added to disable the file validation.\n* No unsafe\n  * Will provide `unsafe` feature for better performance.\n\nNOTE: This repository is not stable yet. I may force-push commit tree even on\nthe main branch.\n\n## Usage\n\nSee [integration_test.rs](./tests/integration_test.rs) for what prsqlite\nsupports.\n\n`prsqlite::Connection::open()` is the entrypoint interface for library users.\n\n```rs\nuse std::path::Path;\n\nuse prsqlite::Connection;\nuse prsqlite::Value;\n\nlet conn = Connection::open(Path::new(\"path/to/sqlite.db\")).unwrap();\n\nlet stmt = conn.prepare(\"INSERT INTO example (col) VALUES (1), (2);\").unwrap();\nassert_eq!(stmt.execute().unwrap(), 2);\n\nlet stmt = conn.prepare(\"SELECT * FROM example WHERE col = 1;\").unwrap();\nlet mut rows = stmt.query().unwrap();\n\nlet row = rows.next_row().unwrap().unwrap();\nlet columns = row.parse().unwrap();\nassert_eq!(columns.get(0), Some(\u0026Value::Integer(1)));\ndrop(row);\n\nassert!(rows.next_row().unwrap().is_none());\n```\n\nprsqlite provides REPL command.\n\n```bash\n$ git clone https://github.com/kawasin73/prsqlite.git\n\n$ cd ./prsqlite\n\n$ sqlite3 tmp/sqlite.db\nsqlite\u003e CREATE TABLE example(col1, col2 integer);\nsqlite\u003e CREATE INDEX i_example ON example(col2);\nsqlite\u003e INSERT INTO example(col1, col2) values(null, 1);\nsqlite\u003e INSERT INTO example(col1, col2) values(10, 2);\nsqlite\u003e INSERT INTO example(col1, col2) values(1.1, 3);\nsqlite\u003e INSERT INTO example(col1, col2) values('Hello prsqlite!', 4);\nsqlite\u003e INSERT INTO example(col1, col2) values(X'707273716c697465', 5);\nsqlite\u003e .quit\n\n$ cargo build \u0026\u0026 ./target/debug/prsqlite tmp/sqlite.db\nprsqlite\u003e SELECT * FROM sqlite_schema;\ntable|example|example|2|CREATE TABLE example(col1, col2 integer)\nindex|i_example|example|3|CREATE INDEX i_example ON example(col2)\nprsqlite\u003e SELECT * FROM example;\n|1\n10|2\n1.1|3\nHello prsqlite!|4\nprsqlite|5\nprsqlite\u003e SELECT col1 FROM example WHERE col2 == 4;\nHello prsqlite!\nprsqlite\u003e INSERT INTO example(col1, col2) VALUES (123, 6);\nprsqlite\u003e INSERT INTO example(rowid, col2) VALUES (20, 20);\nprsqlite\u003e INSERT INTO example(rowid, col2) VALUES (6, 6);\nthe rowid already exists\nprsqlite\u003e INSERT INTO example(rowid, col2) VALUES (7, 7);\nprsqlite\u003e INSERT INTO example(col1, col2) VALUES ('hello', 21);\nprsqlite\u003e SELECT rowid, * FROM example WHERE col2 \u003e= 6;\n6|123|6\n7||7\n20||20\n21|hello|21\nprsqlite\u003e DELETE FROM example WHERE col2 \u003c 20;\nprsqlite\u003e SELECT * FROM example;\n|20\nhello|21\nprsqlite\u003e DELETE FROM example;\nprsqlite\u003e SELECT * FROM example;\nprsqlite\u003e .quit\n```\n\n## Contributing\n\nSee [`CONTRIBUTING.md`](CONTRIBUTING.md) for details.\n\n## License\n\nApache 2.0; see [`LICENSE`](LICENSE) for details.\n\n## Disclaimer\n\nThis project is not an official Google project. It is not supported by\nGoogle and Google specifically disclaims all warranties as to its quality,\nmerchantability, or fitness for a particular purpose.\n","funding_links":[],"categories":["Rust","sqlite"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkawasin73%2Fprsqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkawasin73%2Fprsqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkawasin73%2Fprsqlite/lists"}