{"id":17008738,"url":"https://github.com/i-e-b/demapio","last_synced_at":"2026-05-08T19:30:55.757Z","repository":{"id":156316998,"uuid":"632950340","full_name":"i-e-b/demapio","owner":"i-e-b","description":"Small SQL mapper for C#","archived":false,"fork":false,"pushed_at":"2024-12-16T12:18:22.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T07:54:00.787Z","etag":null,"topics":["working"],"latest_commit_sha":null,"homepage":"","language":"C#","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/i-e-b.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":"2023-04-26T13:13:58.000Z","updated_at":"2024-12-16T12:18:26.000Z","dependencies_parsed_at":"2024-06-28T04:48:28.195Z","dependency_job_id":null,"html_url":"https://github.com/i-e-b/demapio","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/i-e-b/demapio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2Fdemapio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2Fdemapio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2Fdemapio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2Fdemapio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-e-b","download_url":"https://codeload.github.com/i-e-b/demapio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2Fdemapio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32794502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["working"],"created_at":"2024-10-14T05:29:09.205Z","updated_at":"2026-05-08T19:30:55.752Z","avatar_url":"https://github.com/i-e-b.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Demapio\n=======\n\nSmall SQL mapper for C#\n\n### What?\n\nIt's like [Dapper](https://github.com/DapperLib/Dapper), but smaller and more focussed.\n\n### Why not just use Dapper?\n\nIf that works, do it. I keep having trouble with new versions of Dapper being 'smart' and re-writing my working SQL into broken SQL.\n\nDemapio does a lot less, and aims to be small and stable rather than big and clever.\nNo guarantees on speed.\n\nDemapio deliberately uses unusual names for its extension methods, so it can be easily used alongside Dapper.\n\n### How?\n\nSelect a single value:\n\n```\nvar conn = new NpgsqlConnection(ConnStr);\n\nobject? result = conn.QueryValue(\"SELECT ('Hello, ' || :para) as result;\", new { para = \"world\" });\n```\n\nQuery data to a list of C# objects:\n\n```\nvar conn = new NpgsqlConnection(ConnStr);\n\nvar result = conn.SelectType\u003cSamplePoco\u003e(\"SELECT * FROM TestTable WHERE userId=:userId\", new {userId = 10}).ToList()!;\n```\n\nQuery data to a list of dynamic C# objects:\n\n```\nvar conn = new NpgsqlConnection(ConnStr);\n\nvar result = conn.SelectDynamic(\"SELECT id, myValue FROM TestTable WHERE userId=:userId\", new {userId = 10}).ToList()!;\nConsole.WriteLine(result.id, result.myValue);\n```\n\nRepeat a single statement with a batch of parameters:\n\n```\nvar conn = new NpgsqlConnection(ConnStr);\n\nconn.RepeatCommand(\"INSERT INTO TestTable (id, userId, deviceId) VALUES (:id, :userId, :deviceId);\",\n    new {id=1, userId=10, deviceId=\"User10 Phone\"},\n    new {id=2, userId=10, deviceId=\"User10 PC\"},\n    new {id=3, userId=20, deviceId=\"User20 Phone\"},\n    new {id=4, userId=20, deviceId=\"User20 Modem\"}\n);\n```\n\nExecute a statement, returning rows changed:\n\n```\nvar conn = new NpgsqlConnection(ConnStr);\n\nvar changeCount = conn.CountCommand(\"UPDATE TestTable SET userId = :userId, deviceId = :deviceId WHERE id = :id;\", new {id=1, userId=10, deviceId=\"User10 Phone\"});\nif (changeCount \u003c 1) ...\n```\n\nQuery data to an IDataReader:\n\n```\nvar conn = new NpgsqlConnection(ConnStr);\n\nusing var result = conn.QueryReader(\"SELECT * FROM TestTable WHERE userId=:userId\", new {userId = 10});\nwhile (result.Read()) { ...\n```\n\n### Custom type mappings\n\nYou can add custom type mappings by calling `Demapio.SetTypeMapping((dbValue)=\u003eFromDatabaseMethod(dbValue), (dotnetValue)=\u003eToDatabaseMethod(dotnetValue));`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-e-b%2Fdemapio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-e-b%2Fdemapio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-e-b%2Fdemapio/lists"}