{"id":13721054,"url":"https://github.com/so1ve/dittorm-deno","last_synced_at":"2025-07-08T06:07:02.402Z","repository":{"id":41808695,"uuid":"466136358","full_name":"so1ve/dittorm-deno","owner":"so1ve","description":"[WIP] A Deno ORM for MySQL, SQLite, PostgreSQL, MongoDB, GitHub and serverless service like Deta, InspireCloud, CloudBase, LeanCloud.","archived":false,"fork":false,"pushed_at":"2022-12-10T04:56:22.000Z","size":47,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T20:14:51.831Z","etag":null,"topics":["deno","deta","leancloud","orm"],"latest_commit_sha":null,"homepage":"https://deno.land/x/dittorm","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/so1ve.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":"2022-03-04T13:36:47.000Z","updated_at":"2023-07-21T09:23:10.000Z","dependencies_parsed_at":"2022-08-12T07:50:08.126Z","dependency_job_id":null,"html_url":"https://github.com/so1ve/dittorm-deno","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/so1ve/dittorm-deno","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/so1ve%2Fdittorm-deno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/so1ve%2Fdittorm-deno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/so1ve%2Fdittorm-deno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/so1ve%2Fdittorm-deno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/so1ve","download_url":"https://codeload.github.com/so1ve/dittorm-deno/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/so1ve%2Fdittorm-deno/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264207142,"owners_count":23572737,"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","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":["deno","deta","leancloud","orm"],"created_at":"2024-08-03T01:01:11.831Z","updated_at":"2025-07-08T06:07:02.376Z","avatar_url":"https://github.com/so1ve.png","language":"TypeScript","funding_links":[],"categories":["ORM's"],"sub_categories":["JavaScript ORM"],"readme":"# dittorm-deno\n\nA Deno ORM for MySQL, SQLite, PostgreSQL, MongoDB, GitHub and serverless\nservice like Deta, InspireCloud, CloudBase, LeanCloud. Ported from [walinejs/dittorm](https://github.com/walinejs/dittorm)\n\n\u003e **WARNING**: Currently, only leancloud and deta are supported.\n\n## Quick Start\n\n```ts\nimport dittorm from \"https://deno.land/x/dittorm/mod.ts\";\n\nconst userModel = dittorm(\"leancloud\")(\"user\", {\n  appId: \"xxx\",\n  appKey: \"xxx\",\n  masterKey: \"xxx\",\n});\nconst user = await userModel.add({\n  username: \"lizheming\",\n  email: \"i@imnerd.org\",\n});\nconst findUser = await user.select({ email: \"i@imnerd.org\" });\n```\n\n## Documentation\n\n### Configuration\n\n#### LeanCloud\n\n```ts\nimport dittorm from \"https://deno.land/x/dittorm/mod.ts\";\n\nconst userModel = dittorm(\"leancloud\")(\"user\", {\n  appId: \"xxx\",\n  appKey: \"xxx\",\n  masterKey: \"xxx\",\n});\n```\n\n| Name        | Required | Default | Description |\n| ----------- | -------- | ------- | ----------- |\n| `appId`     | ✅        |         |             |\n| `appKey`    | ✅        |         |             |\n| `masterKey` | ✅        |         |             |\n\n\n#### Deta\n\n```ts\nimport dittorm from \"https://deno.land/x/dittorm/mod.ts\";\n\nconst userModel = dittorm(\"deta\")(\"user\", {\n  projectKey: 'xxx'\n});\n```\n\n\n| Name    | Required | Default | Description             |\n| ------- | -------- | ------- | ----------------------- |\n| `projectKey` | ✅        |         | Deta project secret key |\n\n\nTODO\n\n### API\n\n#### add(data)\n\nSave store data.\n\n```ts\nconst data = await userModel.add({\n  username: \"lizheming\",\n  email: \"i@imnerd.org\",\n});\nconsole.log(data.id);\n```\n\n#### select(where, options)\n\nFind store data by condition.\n\n```js\n// SELECT * FROM user WHERE username = 'lizheming';\nconst data = await userModel.select({ username: \"lizheming\" });\n\n// SELECT email FROM user WHERE username = 'lizheming' ORDER BY email DESC LIMIT 1 OFFSET 1;\nconst data = await userModel.select({ username: \"lizheming\" }, {\n  field: [\"email\"],\n  desc: \"email\",\n  limit: 1,\n  offset: 1,\n});\n\n// SELECT * FROM user WHERE username != 'lizheming';\nconst data = await userModel.select({ username: [\"!=\", \"lizheming\"] });\n\n// SELECT * FROM user WHERE create_time \u003e '2022-01-01 00:00:00';\nconst data = await userModel.select({ username: [\"\u003e\", \"2022-01-01 00:00:00\"] });\n\n// SELECT * FROM user WHERE username IN ('lizheming', 'michael');\nconst data = await userModel.select({\n  username: [\"IN\", [\"lizheming\", \"michael\"]],\n});\n\n// SELECT * FROM user WHERE username NOT IN ('lizheming', 'michael');\nconst data = await userModel.select({\n  username: [\"NOT IN\", [\"lizheming\", \"michael\"]],\n});\n\n// SELECT * FROM user WHERE username LIKE '%li%';\nconst data = await userModel.select({ username: [\"LIKE\", \"%li%\"] });\n\n// SELECT * FROM user WHERE username = 'lizheming' AND create_time \u003e '2022-01-01 00:00:00';\nconst data = await userModel.select({\n  username: \"lizheming\",\n  create_time: [\"\u003e\", \"2022-01-01 00:00:00\"],\n});\n\n// SELECT * FROM user WHERE username = 'lizheming' OR create_time \u003e '2022-01-01 00:00:00';\nconst data = await userModel.select({\n  _complex: {\n    username: \"lizheming\",\n    create_time: [\"\u003e\", \"2022-01-01 00:00:00\"],\n    _logic: \"or\",\n  },\n});\n```\n\n#### update(data, where)\n\nUpdate store data by condition. `where` format same as `select(where, options)`.\n\n#### count(where)\n\nReturn store data count by condition. `where` format same as\n`select(where, options)`.\n\n#### delete(where)\n\nClean store data by condition. `where` format same as `select(where, options)`.\n\n### Types\n\nSee [Here](./src/types.ts).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fso1ve%2Fdittorm-deno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fso1ve%2Fdittorm-deno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fso1ve%2Fdittorm-deno/lists"}