{"id":13736445,"url":"https://github.com/rahmanfadhil/cotton","last_synced_at":"2025-09-24T13:21:56.063Z","repository":{"id":39177257,"uuid":"266013196","full_name":"rahmanfadhil/cotton","owner":"rahmanfadhil","description":"SQL Database Toolkit for Deno","archived":false,"fork":false,"pushed_at":"2022-06-01T14:19:45.000Z","size":1345,"stargazers_count":140,"open_issues_count":15,"forks_count":23,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-02T14:20:08.842Z","etag":null,"topics":["deno","sql","typescript"],"latest_commit_sha":null,"homepage":"https://rahmanfadhil.github.io/cotton","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/rahmanfadhil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-22T03:55:20.000Z","updated_at":"2025-08-27T13:21:31.000Z","dependencies_parsed_at":"2022-09-26T18:20:41.933Z","dependency_job_id":null,"html_url":"https://github.com/rahmanfadhil/cotton","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/rahmanfadhil/cotton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahmanfadhil%2Fcotton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahmanfadhil%2Fcotton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahmanfadhil%2Fcotton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahmanfadhil%2Fcotton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rahmanfadhil","download_url":"https://codeload.github.com/rahmanfadhil/cotton/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahmanfadhil%2Fcotton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276757060,"owners_count":25699466,"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-09-24T02:00:09.776Z","response_time":97,"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":["deno","sql","typescript"],"created_at":"2024-08-03T03:01:21.946Z","updated_at":"2025-09-24T13:21:55.997Z","avatar_url":"https://github.com/rahmanfadhil.png","language":"TypeScript","funding_links":[],"categories":["基础设施","Modules","TypeScript"],"sub_categories":["Deno 源","Database"],"readme":"# Cotton\n\n![ci](https://github.com/rahmanfadhil/cotton/workflows/ci/badge.svg?branch=master) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/rahmanfadhil/cotton)\n\n**SQL Database Toolkit for Deno.**\n\n- Well-tested\n- Type-safe\n- Supports **MySQL**, **SQLite**, and **PostgreSQL**\n- Semantic versioning\n\n## Documentation\n\n- [Getting started guide](https://rahmanfadhil.github.io/cotton)\n- [Explore the API](https://doc.deno.land/https/deno.land/x/cotton/mod.ts)\n\n## Getting Started\n\nHere's an example of a Deno project that uses Cotton.\n\n```ts\nimport { connect } from \"https://deno.land/x/cotton@v0.7.2/mod.ts\";\n\nconst db = await connect({\n  type: \"sqlite\",\n  database: \"db.sqlite3\",\n});\n```\n\nTo use Cotton in your project, you can import `cotton` package from [deno.land/x](https://deno.land/x) in your file. We highly recommend you to use semantic versioning by explicitly tell Deno which version you want to use in the import URL.\n\nTypically, the first thing you want to do is to create a connection to a database. Here, we're using `connect` and pass our database configuration. You can read more about connection [here](connection.md).\n\nOnce our database is connected, do anything with it such as performing an SQL query.\n\n```ts\nconst users = await db.query(\"SELECT * FROM users\");\n\nfor (const user of users) {\n  console.log(user); // { email: 'a@b.com', age: 16, ... }\n}\n```\n\nYou can learn more about Cotton through these links. Have fun! 😃\n\n- [Creating a connection](docs/guide/connection.md)\n- [Query builder](docs/guide/query-builder.md)\n- [Object-relational mapper](docs/guide/model.md)\n- [Database migrations](docs/guide/migrations.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahmanfadhil%2Fcotton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahmanfadhil%2Fcotton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahmanfadhil%2Fcotton/lists"}