{"id":21954804,"url":"https://github.com/mgernand/litedb.queryable","last_synced_at":"2025-08-03T02:11:33.017Z","repository":{"id":64162215,"uuid":"572218155","full_name":"mgernand/LiteDB.Queryable","owner":"mgernand","description":"A queryable wrapper implementation for LiteDB with additional async extensions.","archived":false,"fork":false,"pushed_at":"2025-03-03T11:53:01.000Z","size":78,"stargazers_count":24,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T05:25:11.993Z","etag":null,"topics":["async","dotnet","dotnet-core","dotnet7","linq","litedb","netstandard","netstandard20","netstandard21","queryable"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mgernand.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}},"created_at":"2022-11-29T19:57:58.000Z","updated_at":"2025-03-10T15:50:39.000Z","dependencies_parsed_at":"2024-01-04T13:24:26.854Z","dependency_job_id":"e9d998f8-218a-4a0d-8cb9-88ecbb4b1613","html_url":"https://github.com/mgernand/LiteDB.Queryable","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"949736d5e0541ae3714fd6b6d390b8cccce89947"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgernand%2FLiteDB.Queryable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgernand%2FLiteDB.Queryable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgernand%2FLiteDB.Queryable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgernand%2FLiteDB.Queryable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgernand","download_url":"https://codeload.github.com/mgernand/LiteDB.Queryable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245767350,"owners_count":20668826,"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":["async","dotnet","dotnet-core","dotnet7","linq","litedb","netstandard","netstandard20","netstandard21","queryable"],"created_at":"2024-11-29T07:26:10.504Z","updated_at":"2025-03-27T02:09:50.551Z","avatar_url":"https://github.com/mgernand.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LiteDB.Queryable\n\nAn IQueryable wrapper implementation for LiteDB with additional async extensions.\n\nThis library allows the use of LINQ extensions methods for querying LiteDB.\n\nThe ```LiteQueryable\u003cT\u003e``` implementation is a warpper around a ```ILiteCollection\u003cT\u003e```\nor a ```ILiteCollectionAsync\u003c\u003e```. The LINQ extenions call are delegated to the \nequivalent methods of the LiteDB API.\n\n## This repository was moved to https://codeberg.org/mgernand/LiteDB.Queryable\n\n## Usage\n\nAdd the NuGet package to your project: ```LiteDB.Queryable```\n\nYou can then aquire an ```IQueryable\u003cT\u003e``` instance using one of the available ```AsQueryable```\nextension methods for ```ILiteCollection\u003cT\u003e``` or ```ILiteCollectionAsync\u003cT\u003e```. The async \nvariant is provided by the [litedb-async](https://github.com/mlockett42/litedb-async) project.\n\n```C#\nLiteDatabase database = new LiteDatabase(\"test.db\");\nILiteCollection\u003cPerson\u003e collection = database.GetCollection\u003cPerson\u003e(\"people\");\nIQueryable\u003cPerson\u003e queryable = collection.AsQueryable();\n```\n\nor \n\n```C#\nLiteDatabaseAsync database = new LiteDatabaseAsync(\"test.db\");\nILiteCollectionAsync\u003cPerson\u003e collection = database.GetCollection\u003cPerson\u003e(\"people\");\nIQueryable\u003cPerson\u003e queryable = collection.AsQueryable();\n```\n\nAfter that you can use the synchronous LINQ extensions with both variants and the asynchronous\nones with the second variant.\n\n## Supported LINQ extensions\n\nYou can use the following methods to configure your query. Those methods are available in both\nvariants.\n\n- Where\n- OrderBy\n- OrderByDescending\n- Skip\n- Take\n- Include\n- Select\n\nThe ```ThenBy/ThenByDescending``` methods and multiple OrderBy/OrderByDescending class are not\nsupported at the moment, because LiteDB doesn't support multiple order exprssions.\n\n### Synchronous extenions\n\n- ToList\n- ToArray\n- ToDictionary\n- First\n- FirstOrDefault\n- Single\n- SingleOrDefault\n- Count\n- LongCount\n- Any\n- Sum\n- Average\n- Min\n- Max\n\n### Asynchronous extenions\n\n- ToListAsync\n- ToArrayAsync\n- ToDictionaryAsync\n- FirstAsync\n- FirstOrDefaultAsync\n- SingleAsync\n- SingleOrDefaultAsync\n- CountAsync\n- LongCountAsync\n- AnyAsync\n- SumAsync\n- AverageAsync\n- MinAsync\n- MaxAsync\n\n## Example\n\n```C#\nLiteDatabase database = new LiteDatabase(\"test.db\");\nILiteCollection\u003cPerson\u003e collection = database.GetCollection\u003cPerson\u003e(\"people\");\nIQueryable\u003cPerson\u003e queryable = collection.AsQueryable();\n\nIList\u003cPerson\u003e result = queryable\n\t.Where(x =\u003e x.Name.StartsWith(\"T\"))\n\t.OrderBy(x =\u003e x.Age)\n\t.ToList();\n\nPerson result = queryable\n\t.Where(x =\u003e x.Age \u003e 35)\n\t.FirstOrDefault();\n\nstring result = queryable\n\t.Where(x =\u003e x.Age \u003e 35)\n\t.Select(x =\u003e x.Name)\n\t.FirstOrDefault();\n```\n\nor \n\n```C#\nLiteDatabaseAsync database = new LiteDatabaseAsync(\"test.db\");\nILiteCollectionAsync\u003cPerson\u003e collection = database.GetCollection\u003cPerson\u003e(\"people\");\nIQueryable\u003cPerson\u003e queryable = collection.AsQueryable();\n\nIList\u003cPerson\u003e result = await queryable\n\t.Where(x =\u003e x.Name.StartsWith(\"T\"))\n\t.OrderBy(x =\u003e x.Age)\n\t.ToListAsync();\n\nPerson result = await queryable\n\t.Where(x =\u003e x.Age \u003e 35)\n\t.FirstOrDefaultAsync();\n\nstring result = await queryable\n\t.Where(x =\u003e x.Age \u003e 35)\n\t.Select(x =\u003e x.Name)\n\t.FirstOrDefaultAsync();\n```\n\n## References\n\n- [LiteDB](https://github.com/mbdavid/LiteDB)\n- [LiteDB Async](https://github.com/mlockett42/litedb-async)\n- [Entity Framework Core](https://github.com/dotnet/efcore)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgernand%2Flitedb.queryable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgernand%2Flitedb.queryable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgernand%2Flitedb.queryable/lists"}