{"id":29025002,"url":"https://github.com/mertcandav/ldb","last_synced_at":"2025-09-07T07:10:41.422Z","repository":{"id":300621422,"uuid":"1006517107","full_name":"mertcandav/ldb","owner":"mertcandav","description":"Local, easy-to-use, thread-safe database for Jule","archived":false,"fork":false,"pushed_at":"2025-07-06T07:05:49.000Z","size":36,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-18T16:00:48.859Z","etag":null,"topics":["database","documentdb","jule","julelang"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mertcandav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-06-22T12:58:17.000Z","updated_at":"2025-07-06T07:05:52.000Z","dependencies_parsed_at":"2025-06-22T19:26:33.352Z","dependency_job_id":"87b80b84-05b7-4528-9f12-5d40cce9e108","html_url":"https://github.com/mertcandav/ldb","commit_stats":null,"previous_names":["mertcandav/ldb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mertcandav/ldb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mertcandav%2Fldb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mertcandav%2Fldb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mertcandav%2Fldb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mertcandav%2Fldb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mertcandav","download_url":"https://codeload.github.com/mertcandav/ldb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mertcandav%2Fldb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274006268,"owners_count":25206111,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["database","documentdb","jule","julelang"],"created_at":"2025-06-26T05:01:01.318Z","updated_at":"2025-09-07T07:10:41.401Z","avatar_url":"https://github.com/mertcandav.png","language":null,"funding_links":[],"categories":["Databases"],"sub_categories":[],"readme":"# LDB: Local Database\n\nLDB is a local, easy-to-use, thread-safe database for [Jule](https://github.com/julelang/jule).\n\nIt stores data as collections.\\\nEach collection has its own name for lookup.\\\nThe data of the collections is basically a JSON array with query support.\n\nKey features:\n- Written in pure Jule\n- Thread-safe\n- Works on local and non-volatile memory\n- Optimized for performance and memory efficiency balance\n- Can store any JSON value, document oriented\n- Simple CRUD and queries\n\n## Quick Start Example\n\n```rust\nuse \"ldb\"\nuse \"std/fmt\"\n\nstruct User {\n\tName: str\n\tAge:  int\n}\n\nfn main() {\n\t// Open database, it will be created if not exist.\n\tmut db := Open(\"test.db\")!\n\tdefer { db.Close() }\n\n\t// Get users collection, it will be created if not exist.\n\tmut users := db.GetCollection[User](\"users\")!\n\n\t// Add sample data.\n\tusers.Append(\n\t\t{\"root\", 0},\n\t\t{\"admin\", -1},\n\t\t{\"Foo\", 18},\n\t\t{\"Bar\", 28},\n\t\t{\"Baz\", 93},\n\t\t{\"Fizz\", 53},\n\t\t{\"Buzz\", 36},\n\t\t{\"ABC\", 36},\n\t\t{\"XYZ\", 18})!\n\n\t// Query for user count per age.\n\t// Result is: map[age]usercount\n\tuserCounts := users.Query().\n\t\tWhere(fn|user| user.Age \u003e 0).\n\t\tGroupBy(fn|user| user.Age).\n\t\tMap(fn|group| group.Len())\n\n\tfmt::Println(\"user count per age: \", userCounts)\n}\n```\n\n## Query Examples with SQL\n\n```rust\n// SELECT * FROM users\nusers.Query().Unwrap()\n```\n```rust\n// SELECT * FROM users\n// WHERE age \u003e 25\nusers.Query().\n\tWhere(fn|u| u.Age \u003e 25).\n\tUnwrap()\n```\n```rust\n// SELECT SUM(Price) FROM Products;\nproducts.Query().\n  Sum(fn|p| p.Price)\n```\n```rust\n// SELECT * FROM Products\n// ORDER BY Price DESC;\nproducts.Query().\n  OrderByDesc(fn|p| p.Price).\n  Unwrap()\n```\n```rust\n// INSERT INTO Customers (Name, ContactName, Address, City, PostalCode, Country)\n// VALUES ('Cardinal', 'Tom B. Erichsen', 'Skagen 21', 'Stavanger', '4006', 'Norway');\ncustomers.Append({\n\tName: \"Cardinal\",\n\tContactName: \"Tom B. Erichsen\",\n\tAddress: \"Skagen 21\",\n\tCity: \"Stavanger\",\n\tPostalCode: \"4006\",\n\tCountry: \"Norway\",\n})!\n```\n```rust\n// DELETE FROM Customers WHERE Name = 'Alfreds Futterkiste';\ncustomers.Delete(fn|c| c.Name == \"Alfreds Futterkiste\")!\n```\n```rust\n// UPDATE Customers\n// SET ContactName = 'Alfred Schmidt', City = 'Frankfurt'\n// WHERE ID = 1;\ncustomers.Update(fn|mut c| {\n\tif c.ID == 1 {\n\t\tc.ContactName = \"Alfred Schmidt\"\n\t\tc.City = \"Frankfurt\"\n\t}\n})!\n```\n\n## License\n\nLDB is distributed under the terms of the BSD 3-Clause license. \u003cbr\u003e\n[See License Details](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmertcandav%2Fldb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmertcandav%2Fldb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmertcandav%2Fldb/lists"}