{"id":21861726,"url":"https://github.com/alertbox/snikt","last_synced_at":"2026-03-14T16:31:47.060Z","repository":{"id":4772074,"uuid":"5923438","full_name":"alertbox/snikt","owner":"alertbox","description":"Snikt! is a SQL data access helper to query and materialize data.","archived":false,"fork":false,"pushed_at":"2016-11-12T08:17:34.000Z","size":2037,"stargazers_count":3,"open_issues_count":0,"forks_count":5,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-28T08:03:06.969Z","etag":null,"topics":["c-sharp","dotnet","micro-orm","microsoft","snikt","sql"],"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/alertbox.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}},"created_at":"2012-09-23T15:40:53.000Z","updated_at":"2016-10-23T04:28:49.000Z","dependencies_parsed_at":"2022-09-21T00:42:25.907Z","dependency_job_id":null,"html_url":"https://github.com/alertbox/snikt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alertbox%2Fsnikt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alertbox%2Fsnikt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alertbox%2Fsnikt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alertbox%2Fsnikt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alertbox","download_url":"https://codeload.github.com/alertbox/snikt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248948178,"owners_count":21187825,"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":["c-sharp","dotnet","micro-orm","microsoft","snikt","sql"],"created_at":"2024-11-28T03:12:29.548Z","updated_at":"2026-03-14T16:31:42.024Z","avatar_url":"https://github.com/alertbox.png","language":"C#","readme":"## SNIKT!\n\n[![StackShare](https://img.shields.io/badge/tech-stack-0690fa.svg?style=flat)](https://stackshare.io/alertbox/snikt)\n[![Gitter](https://badges.gitter.im/alertbox/snikt.svg)](https://gitter.im/alertbox/snikt?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n[![Stories in Ready](https://badge.waffle.io/alertbox/snikt.svg?label=ready\u0026title=Ready)](http://waffle.io/alertbox/snikt)\n\nSnkit! is nothing but a light-weight micro-ORM. Originally, it is the switchblade-sound of Wolverine's claws locking into place.\n\n## OVERVIEW\nI wrote Snikt! to take away the pain of data access logic.\n* It is a simple Assembly you can refer in your Data Access Layer that will provide utilities, wrappers, and extensions to simplify work in the data access objects.\n* Snikt! provides database connection lifetime management and execution store commands.\n* It materialize CLR-types given a data reader as well as result set of a store command.\n* It has templates and abstract classes for business entities, data access objects, and search query arguments.\n* Snikt! has no database specific implementations. Technically, you should be able to use it on MySQL, SQL Server, or even on Oracle.\n\n## LICENSE\nSnikt! code is free for commercial and non-commercial deployments and distribution. Snikt! is release under [MIT License](http://www.opensource.org/licenses/mit-license.php).\n\n## FEATURES\nSnikt! provides 3 simple helpers:\n* [Materializer.cs](https://github.com/kosalanuwan/snikt/blob/master/Snikt/Materializer.cs)\n* [Database.cs](https://github.com/kosalanuwan/snikt/blob/master/Snikt/Database.cs)\n* [DbConnectionFactory.cs](https://github.com/kosalanuwan/snikt/blob/master/Snikt/DbConnectionFactory.cs)\n\n### Map query results to a strong-typed list\n```csharp\nIDataReader queryResult = command.ExecuteReader();\nMaterializer\u003cCategory\u003e categoryMaterializer = new Materializer\u003cCategory\u003e(queryResult);\nList\u003cCategory\u003e categories = new List\u003cCategory\u003e();\nwhile (queryResult.Read())\n{\n    categories.Add(categoryMaterializer.Materialize(queryResult));\n}\n\nAssert.IsTrue(categories.Any());\n```\n\n### Execute a Stored Procedure\n```csharp\nIDatabase db = new Database(\"name=DefaultConnection\");\n\nList\u003cCategory\u003e categories = db.SqlQuery\u003cCategory\u003e(\"dbo.GetAllCategories\").ToList();\n\nAssert.IsTrue(categories.Any());\n```\n\n### Execute a Stored Procedure that obtain Parameters\n```csharp\nIDatabase db = new Database(\"name=DefaultConnection\");\nvar criteria = new { Id = 1 };\n\nList\u003cCategory\u003e categories = db.SqlQuery\u003cCategory\u003e(\"dbo.GetCategory\", criteria).ToList();\n\nforeach (Category cat in categories)\n{\n    Assert.AreEqual(criteria.Id, cat.Id);\n}\n```\n\n### Provide DbContext as the Connection\n```csharp\npublic class DbContextConnectionFactory : IDbConnectionFactory\n{\n    public IDbConnection CreateIfNotExists(string nameOrConnectionString)\n    {\n\t\tMiniNWDbContext dbContext = new MiniNWDbContext(\"name=DefaultConnection\");\n        return dbContext.Database.Connection;\n    }\n}\n\nIDatabase db = new Database(\"name=DefaultConnection\", new DbContextConnectionFactory());\nList\u003cCategory\u003e categories = db.SqlQuery\u003cCategory\u003e(\"dbo.GetAllCategories\").ToList();\nAssert.IsTrue(categories.Any());\n```\n\n## OTHER RESOURCES\nSnikt! is created to demonstrate How to apply some of the available .NET technologies with the Data Access Layer in Layered Architecture design pattern. The main focus of the specifications is \u003cstrong\u003eHow to code the Data Access Layer?\u003c/strong\u003e and not the actual functionality of the chosen MiniNW application.\n\n* Snikt! has a comprehensive test project that demonstrates \u003cstrong\u003eHow Do I\u003c/strong\u003e in [Specifications](https://github.com/kosalanuwan/snikt/tree/master/Snikt.Specifications).\n* You can download the [Snikt! NuGet package](https://nuget.org/packages/Snikt/) from NuGet Gallery.\n\n\n/KP\u003cbr /\u003e\ne: kosala.nuwan@gmail.com\u003cbr /\u003e\nt: [@kosalanuwan](https://www.twitter.com/kosalanuwan)\u003cbr /\u003e\nb: http://kosalanuwan.tumblr.com\u003cbr /\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falertbox%2Fsnikt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falertbox%2Fsnikt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falertbox%2Fsnikt/lists"}