{"id":18249410,"url":"https://github.com/chenhb23/gitee-db","last_synced_at":"2026-05-04T12:33:22.478Z","repository":{"id":134625143,"uuid":"347910741","full_name":"chenhb23/gitee-db","owner":"chenhb23","description":"免费的增删改查数据库😏。可在静态页面上直接修改数据库数据，免去服务器环节的费用。可跨域、响应速度快、ts 编写，有完整的接口类型提示!","archived":false,"fork":false,"pushed_at":"2021-05-11T08:10:36.000Z","size":570,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-20T03:45:12.423Z","etag":null,"topics":["cross-domain","database","free","openapi","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/chenhb23.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":"2021-03-15T09:37:07.000Z","updated_at":"2024-09-19T03:47:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"55963ba7-2777-48c5-971d-5332d4e37fef","html_url":"https://github.com/chenhb23/gitee-db","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chenhb23/gitee-db","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenhb23%2Fgitee-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenhb23%2Fgitee-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenhb23%2Fgitee-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenhb23%2Fgitee-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenhb23","download_url":"https://codeload.github.com/chenhb23/gitee-db/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenhb23%2Fgitee-db/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32607547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: 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":["cross-domain","database","free","openapi","typescript"],"created_at":"2024-11-05T09:39:56.702Z","updated_at":"2026-05-04T12:33:22.462Z","avatar_url":"https://github.com/chenhb23.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `gitee-db` 数据库\n\n白嫖数据库功能😏，实现了增、删、改、查功能。有了它，就可让静态页面拥有动态交互功能，从此免去服务器的费用💰。使用码云的 OpenAPI 实现，可跨域，响应速度一级棒😏。\n\n使用 ts 编写，同时支持 `web`、`node`、`react-native`，有完整的接口入参/出参类型提示，enjoy it !\n\n## 预览\n\n![](./media/request.png)\n\n## 用法\n\n安装: `yarn add https://github.com/chenhb23/gitee-db.git`\n\n使用前先用 `registry` 注册，`registry` 信息获取途径：\n\n1. 在 `gitee` 新建一个仓库（最好设置为私有仓库，防止他人随意提 issue）\n2. 获取 `私人令牌`，获取路径：`设置 -\u003e 私人令牌 -\u003e 生成新令牌`\n\n```ts\nimport {registry, DB} from 'gitee-db'\n\nregistry({\n  access_token: 'your owner access_token', // 私人令牌\n  owner: 'your owner name', // 用户名\n  repo: 'your repo name',  // 仓库名\n})\n\n;(async () =\u003e {\n  const db = new DB()\n  // 获取 table 对象\n  const table = await db.table('tableName')\n  // 查询第一条数据\n  const data = await table.findOne()\n\n  const info = {\n    user: 'username',\n    array: [1, 3, 4],\n    object: {name: 'this is name'},\n  }\n  console.log('before', data)\n  if (data) {\n    const dto = await table.update(data.id, info)\n    console.log('after update', dto)\n  } else {\n    const dto = await table.insert(info)\n    console.log('after insert', dto)\n  }\n})()\n```\n\n## Api\n\n- `findOne\u003cT\u003e(id?: string): Promise\u003cDTO\u003cT\u003e\u003e`\n\n\n- `findMany\u003cT\u003e(options?: {limit?: number; startPage?: number}): Promise\u003c{cur_page: number; list: DTO\u003cT\u003e[]}\u003e`\n\n\n- `insert\u003cT\u003e(body: T): Promise\u003cDTO\u003cT\u003e\u003e`\n\n\n- `update\u003cT\u003e(id: string, body: Partial\u003cT\u003e, options?: {replace: boolean}): Promise\u003cDTO\u003cT\u003e\u003e`\n\n\n- `delete(id: string): AxiosPromise\u003cany\u003e;`\n\n\n- `where\u003cT\u003e(filter: (value: DTO\u003cT\u003e) =\u003e boolean)`。where 之后只能使用 findOne 和 findMany\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenhb23%2Fgitee-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenhb23%2Fgitee-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenhb23%2Fgitee-db/lists"}