{"id":22550918,"url":"https://github.com/abdurahmans/libsql-query","last_synced_at":"2026-04-19T17:02:16.870Z","repository":{"id":265819156,"uuid":"896689852","full_name":"AbduRahmanS/libsql-query","owner":"AbduRahmanS","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-12T03:35:58.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T10:34:23.205Z","etag":null,"topics":["libsql","query-builder","rust","rust-crate","rust-library","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AbduRahmanS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-12-01T03:22:45.000Z","updated_at":"2025-01-29T09:45:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"a82fb55d-e0a9-45c1-8a9a-f5398447caae","html_url":"https://github.com/AbduRahmanS/libsql-query","commit_stats":null,"previous_names":["abdurahmans/libsql-query"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbduRahmanS%2Flibsql-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbduRahmanS%2Flibsql-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbduRahmanS%2Flibsql-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbduRahmanS%2Flibsql-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AbduRahmanS","download_url":"https://codeload.github.com/AbduRahmanS/libsql-query/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246009078,"owners_count":20708881,"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":["libsql","query-builder","rust","rust-crate","rust-library","sqlite"],"created_at":"2024-12-07T17:08:59.157Z","updated_at":"2026-04-19T17:02:11.807Z","avatar_url":"https://github.com/AbduRahmanS.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libsql-query\n\n`libsql-query` is a Rust library that provides a simple interface for interacting with SQLite databases using the [`libsql`](https://crates.io/crates/libsql) crate. It simplifies common database operations like `SELECT`, `INSERT`, `UPDATE`, and `DELETE` by providing high-level abstractions and automatic parameter handling.\n\n## Features\n\n- **Easy-to-use API**: Simplifies database interactions with straightforward methods.\n- **JSON Integration**: Utilizes `serde_json` for seamless JSON data handling.\n- **Transaction Support**: Provides methods for transaction management.\n- **Parameterized Queries**: Protects against SQL injection with parameterized queries.\n\n## Installation\n\nAdd `libsql-query` to your `Cargo.toml` dependencies:\n\n```toml\n[dependencies]\nlibsql-query = \"0.1.0\"\n```\n\n## Usage\n\n#### 1. Add the `DB_PATH` to your environment variables.\n\n#### 2. Create a libsql-query client instance.\n\n```rust\nuse libsql_query::client::Client;\nlet client = Client::new().await\n```\n\n#### 3. Insert data into a table.\n\n```rust\nlet data = json!({\n    \"name\": \"Alice\",\n    \"age\": 30,\n    \"email\": \"alice@company.com\"\n});\nlet rows = client.table(\"users\").insert(data).await?;\n// rows: libsql::Rows\n```\n\n#### 4. Retrieve data from a table.\n\n```rust\nlet rows = client.table(\"users\").select(json!({\"id\": 1})).await?;\n// rows: libsql::Rows\n```\n\n#### 5. Transactions\n\n```rust\nlet mut client = Client::new().await; // Client should be mutable\nclient.begin_transaction().await;\nlet result = async {\n    // Perform operations like usualy\n    client.table(\"users\").update(data).await?;\n    client.table(\"users\").delete().await?;\n};\n\nif result.is_ok() {\n    client.commit().await;\n} else {\n    client.rollback().await;\n}\n```\n\n## Roadmap\n\n\u003e **Note:** No particular order and subject to change.\n\n- [x] **Improve Documentation**: Enhance documentation with more examples and detailed explanations.\n- [ ] **Testing**: Implement comprehensive tests to ensure the library's correctness and reliability.\n- [ ] **Error Handling**: Enhance error handling to cover more edge cases and provide better diagnostics.\n- [ ] **Advanced Queries**: Support advanced queries like joins, subqueries, and aggregations.\n- [ ] **Filtering**: Implement flexible filtering mechanisms for more precise data retrieval.\n- [ ] **Type-Safe Columns**: Introduce type-safe representations of table columns for better compile-time checks and safety.\n- [ ] **Performance Optimization**: Optimize the library for better performance and efficiency.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdurahmans%2Flibsql-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdurahmans%2Flibsql-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdurahmans%2Flibsql-query/lists"}