{"id":22491706,"url":"https://github.com/leisaupei/creeper","last_synced_at":"2025-10-09T09:34:56.167Z","repository":{"id":143307981,"uuid":"328945377","full_name":"leisaupei/creeper","owner":"leisaupei","description":".NetStandard2.1轻量级ORM","archived":false,"fork":false,"pushed_at":"2025-01-17T06:43:49.000Z","size":777,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-27T23:40:07.454Z","etag":null,"topics":["access","dotnet","dotnet-core","mysql","netstandard21","oracle","orm","postgresql","sqlserver"],"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/leisaupei.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-01-12T10:07:39.000Z","updated_at":"2021-09-26T16:50:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc088115-94a9-4e32-82fc-956d40aafc73","html_url":"https://github.com/leisaupei/creeper","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/leisaupei/creeper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leisaupei%2Fcreeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leisaupei%2Fcreeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leisaupei%2Fcreeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leisaupei%2Fcreeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leisaupei","download_url":"https://codeload.github.com/leisaupei/creeper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leisaupei%2Fcreeper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001121,"owners_count":26083022,"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-09T02:00:07.460Z","response_time":59,"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":["access","dotnet","dotnet-core","mysql","netstandard21","oracle","orm","postgresql","sqlserver"],"created_at":"2024-12-06T18:09:15.588Z","updated_at":"2025-10-09T09:34:56.143Z","avatar_url":"https://github.com/leisaupei.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Creeper介绍\n[![Creeper](https://img.shields.io/nuget/v/Creeper.svg?label=Creeper\u0026logo=nuget)](https://www.nuget.org/packages/Creeper)\n[![Creeper.Access](https://img.shields.io/nuget/v/Creeper.Access.svg?label=Creeper.Access\u0026logo=nuget)](https://www.nuget.org/packages/Creeper.Access)\n[![Creeper.MySql](https://img.shields.io/nuget/v/Creeper.MySql.svg?label=Creeper.MySql\u0026logo=nuget)](https://www.nuget.org/packages/Creeper.MySql)\n[![Creeper.Oracle](https://img.shields.io/nuget/v/Creeper.Oracle.svg?label=Creeper.Oracle\u0026logo=nuget)](https://www.nuget.org/packages/Creeper.Oracle)\n[![Creeper.PostgreSql](https://img.shields.io/nuget/v/Creeper.PostgreSql.svg?label=Creeper.PostgreSql\u0026logo=nuget)](https://www.nuget.org/packages/Creeper.PostgreSql)\n[![Creeper.Sqlite](https://img.shields.io/nuget/v/Creeper.Sqlite.svg?label=Creeper.Sqlite\u0026logo=nuget)](https://www.nuget.org/packages/Creeper.Sqlite)\n[![Creeper.SqlServer](https://img.shields.io/nuget/v/Creeper.SqlServer.svg?label=Creeper.SqlServer\u0026logo=nuget)](https://www.nuget.org/packages/Creeper.SqlServer)\n1. 基于.NetStandard2.1的轻量级ORM框架。\n2. 适配多种支持的不同种类数据库开发场景。\n3. 自带Entity生成器，一键即可生成数据库模型代码。\n4. 支持单条记录的自定义数据库缓存，可自定义缓存策略。\n5. 支持一主多从数据库策略，自由切换主从。\n6. 所有查询支持异步方法。\n7. [使用指南](https://github.com/leisaupei/creeper/wiki)\n---\n\n# 如何开始？\n[安装](https://github.com/leisaupei/creeper/wiki/Install)\n# 配置DbContext\n\n## Startup\n``` C#\npublic void ConfigureServices(IServiceCollection services)\n{\n    services.AddCreeper(options =\u003e\n    {\n        //PostgreSqlContext可由生成器生成或继承CreeperContextBase实现即可\n        options.AddPostgreSqlContext\u003cPostgreSqlContext\u003e(context =\u003e\n        {\n            context.UseCache\u003cRedisDbCache\u003e();\n            //数据库主从策略 从库优先,没有会报错/从库优先,没有会使用主库/只使用主库\n            context.UseStrategy(DataBaseTypeStrategy.MainIfSecondaryEmpty);\n            //添加主库配置\n            context.UseConnectionString(\"MainDbConnectionString\");\n            //添加多个从库配置\n            context.UseSecondaryConnectionString(new[] { \"SecondaryDbConnectionStrings\" });\n        });\n        //此处可添加多种数据库配置, 使用DbContext的对象名称作区分\n        //options.AddMySqlContext\u003cMySqlSqlContext\u003e(t =\u003e\n        //{\n        //    context.UseCache\u003cRedisDbCache\u003e();\n        //    //数据库主从策略 从库优先,没有会报错/从库优先,没有会使用主库/只使用主库\n        //    context.UseStrategy(DataBaseTypeStrategy.MainIfSecondaryEmpty);\n        //    //添加主库配置\n        //    context.UseConnectionString(\"MainDbConnectionString\");\n        //    //添加多个从库配置\n        //    context.UseSecondaryConnectionString(new[] { \"SecondaryDbConnectionStrings\" });\n        //});\n    });\n}\n```\n\u003e ``context.UseCache\u003cDbCache\u003e()``参阅[数据库缓存](https://github.com/leisaupei/creeper/wiki/DbCache)\n\n\u003e ``PostgreSqlContext``参阅[DbContext说明](https://github.com/leisaupei/creeper/wiki/DB-First#creepercontext%E8%AF%B4%E6%98%8E)\n## Controller或其他注入类\n``` C#\npublic class SomeController : Controller\n{\n    //如果此处使用多个DbContext, 直接使用DbContext名称或使用以下调用方式也行\n    //private readonly Creeper.Driver.ICreeperContext _context;\n    //public SomeController(IEnumerable\u003cCreeper.Driver.ICreeperContext\u003e contexts)\n    //{\n    //    _context = contexts.FirstOrDefault(c =\u003e c is PostgreSqlContext);\n    //}\n    private readonly Creeper.Driver.ICreeperContext _context;\n    public SomeController(Creeper.Driver.ICreeperContext context)\n    {\n        _context = context;\n    }\n\n    [HttpGet]\n    public DbModel SomeAction()\n    {\n        return _context.Select\u003cDbModel\u003e().Where(a =\u003e a.DbField == SomeValue).ToOne();\n    }\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleisaupei%2Fcreeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleisaupei%2Fcreeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleisaupei%2Fcreeper/lists"}