{"id":16640502,"url":"https://github.com/nmsazulx/mellivora","last_synced_at":"2025-10-24T09:56:36.709Z","repository":{"id":144161602,"uuid":"100599228","full_name":"NMSAzulX/Mellivora","owner":"NMSAzulX","description":"A Mini Orm","archived":false,"fork":false,"pushed_at":"2017-08-30T03:19:36.000Z","size":1538,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T14:40:33.280Z","etag":null,"topics":["il","net","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/NMSAzulX.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":"2017-08-17T12:05:53.000Z","updated_at":"2019-11-15T22:51:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"31cf262e-5eb2-4c57-ae96-271ce1f8cf70","html_url":"https://github.com/NMSAzulX/Mellivora","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NMSAzulX/Mellivora","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NMSAzulX%2FMellivora","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NMSAzulX%2FMellivora/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NMSAzulX%2FMellivora/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NMSAzulX%2FMellivora/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NMSAzulX","download_url":"https://codeload.github.com/NMSAzulX/Mellivora/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NMSAzulX%2FMellivora/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280776482,"owners_count":26388950,"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-10-24T02:00:06.418Z","response_time":73,"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":["il","net","sql"],"created_at":"2024-10-12T07:09:03.543Z","updated_at":"2025-10-24T09:56:36.703Z","avatar_url":"https://github.com/NMSAzulX.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mellivora\n\n**事先声明：该类库仅供学习和参考。[文档地址](https://nmslanx.github.io/Mellivora)**\n## 历程：  \n\u0026emsp;\u0026emsp;由于在学习中接触到了Dapper等优秀的ORM，因此激发了兴趣，想自己也尝试写一下类似的ORM。\n## 技术实现\n\u003e\u0026emsp;\u0026emsp;本库同样是对IDbConnection进行了扩展，在起初写Mellivora的时候，动态缓存也是由纯Emit来实现的，代码量大，不容易调试。一个缓存方法写下来有小1000行。因此2017年，发布了[Natasha2016](https://github.com/dotnetcore/Natasha)版，这一版初次对IL编程进行了简化优化操作，使用Natasha对之前的Mellivora进行了缓存方法重构，代码量减少了二分之一左右，另外保证了性能。  \n### 以下是两者ORM动态缓存方法的性能对比（未迁移至Core）\n![Natasha缓存性能](https://nmslanx.github.io/Mellivora/images/Cache.png)\n\u003e在细节优化的时候，Mellivora参照了大量的Dapper代码，而在缓存的设计上，Mellivora更为直观。\n并且配备了实体类分析库Vasily，对实体类进行分析以及Sql自动生成,从而直接支持Add、Delete、Modify、Get方法，其中Vasily中增加了对String类的[扩展](https://github.com/NMSLanX/Mellivora/blob/master/src/Vasily/Utils/NMSString.cs)，让字符串拼接更佳快速（优于StringBuilder,join）\n## 性能对比  \n\u003e以下是Mellivora与Dapper预热完成之后的性能对比：\n* 执行1次  \n![执行1次对比](https://nmslanx.github.io/Mellivora/images/1M.png)\n* 执行1000次  \n![执行1000次对比](https://nmslanx.github.io/Mellivora/images/1000M.png)\n* 执行10000次  \n![执行10000次对比](https://nmslanx.github.io/Mellivora/images/10000M.png)\n* 执行100000次  \n![执行100000次对比](https://nmslanx.github.io/Mellivora/images/100000M.png)\n\n以上库可以拿来修改，研究，发布。  \n经过编写Mellivora发现，Dapper在稳定性以及性能的平衡上做的非常好，细致入微。  \n开源地址：[Mellivora Github](https://github.com/NMSLanX/Mellivora)  \n文档参考：[Mellivora API](https://nmslanx.github.io/Mellivora/api/index.html)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmsazulx%2Fmellivora","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmsazulx%2Fmellivora","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmsazulx%2Fmellivora/lists"}