{"id":36873382,"url":"https://github.com/xfali/neve-database","last_synced_at":"2026-01-12T15:03:49.895Z","repository":{"id":57544243,"uuid":"296061666","full_name":"xfali/neve-database","owner":"xfali","description":"neve的数据库扩展组件，用于集成数据库相关操作。","archived":false,"fork":false,"pushed_at":"2022-06-24T01:33:58.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-27T09:09:36.086Z","etag":null,"topics":["database","neve","orm"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xfali.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":"2020-09-16T14:44:39.000Z","updated_at":"2021-12-15T14:07:17.000Z","dependencies_parsed_at":"2022-09-16T23:00:25.297Z","dependency_job_id":null,"html_url":"https://github.com/xfali/neve-database","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/xfali/neve-database","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfali%2Fneve-database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfali%2Fneve-database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfali%2Fneve-database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfali%2Fneve-database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xfali","download_url":"https://codeload.github.com/xfali/neve-database/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfali%2Fneve-database/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"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":["database","neve","orm"],"created_at":"2026-01-12T15:03:46.747Z","updated_at":"2026-01-12T15:03:49.889Z","avatar_url":"https://github.com/xfali.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# neve-database\n\nneve-database是neve的数据库扩展组件，用于集成数据库相关操作。\n\n内置ORM工具为[gobatis](https://github.com/xfali/gobatis)\n\n## 安装\n```\ngo get github.com/xfali/neve-database\n```\n\n## 使用\n  \n### 1. neve集成（依赖[neve-core](https://github.com/xfali/neve-core)）\n```\napp := neve.NewFileConfigApplication(\"assets/config-example.yaml\")\napp.RegisterBean(gobatiseve.NewProcessor())\n\n//Register other beans...\n//app.RegisterBean(test.NewMyTest())\napp.Run()\n```\n\n### 2. 配置\n在config-example.yaml中配置示例如下：\n```\nneve:\n  dataSources:\n    testDB:\n      driverName: \"mysql\"\n      driverInfo: \"test:123@tcp(127.0.0.1:3306)/test?timeout=10s\u0026readTimeout=15s\u0026charset=uft8\"\n      maxConn: 1000\n      maxIdleConn: 500\n      connMaxLifetime: 15\n\ngobatis:\n  mapper:\n    dir: \"assets/mappers\"\n  log:\n    level: DEBUG\n  pagehelper:\n    enable: true\n```\n* 【neve.dataSources.testDB】为注入的DataSource名称，请根据实际项目进行修改，通过inject注入名称为testDB可直接获得SessionManager（testDB下为数据库相关配置）。\n\n    (SessionManager用法参考[gobatis](https://github.com/xfali/gobatis)及[gobatis-cmd](https://github.com/xfali/gobatis-cmd))\n```\ntype MyTest struct {\n\tSessMgr *gobatis.SessionManager `inject:\"testDB\"`\n} \n\nfunc (t *MyTest) test() {\n\tsess := t.SessMgr.NewSession()\n\tvar ret []test\n\tsess.Select(\"select * from test\").Param().Result(\u0026ret)\n}\n```\n* 【gobatis.mapper.dir】配置扫描mapper文件的路径\n* 【gobatis.mapper.log】配置日志级别，默认为info\n* 【gobatis.mapper.pagehelper】配置是否启用自动分页（集成分页插件）\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxfali%2Fneve-database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxfali%2Fneve-database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxfali%2Fneve-database/lists"}