{"id":21659164,"url":"https://github.com/cockroachdb/sequelize-cockroachdb","last_synced_at":"2025-06-17T09:10:06.952Z","repository":{"id":37270965,"uuid":"84351820","full_name":"cockroachdb/sequelize-cockroachdb","owner":"cockroachdb","description":"Use Sequelize and CockroachDB together","archived":false,"fork":false,"pushed_at":"2022-06-20T22:40:30.000Z","size":301,"stargazers_count":54,"open_issues_count":20,"forks_count":17,"subscribers_count":49,"default_branch":"master","last_synced_at":"2025-06-13T14:02:36.063Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/cockroachdb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-03-08T18:12:47.000Z","updated_at":"2025-01-10T19:07:34.000Z","dependencies_parsed_at":"2022-09-04T16:01:41.720Z","dependency_job_id":null,"html_url":"https://github.com/cockroachdb/sequelize-cockroachdb","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/cockroachdb/sequelize-cockroachdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachdb%2Fsequelize-cockroachdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachdb%2Fsequelize-cockroachdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachdb%2Fsequelize-cockroachdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachdb%2Fsequelize-cockroachdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cockroachdb","download_url":"https://codeload.github.com/cockroachdb/sequelize-cockroachdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachdb%2Fsequelize-cockroachdb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260326793,"owners_count":22992388,"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":[],"created_at":"2024-11-25T09:30:36.495Z","updated_at":"2025-06-17T09:10:06.929Z","avatar_url":"https://github.com/cockroachdb.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# sequelize-cockroachdb\n\n[This NPM package](https://www.npmjs.com/package/sequelize-cockroachdb) makes Sequelize compatible with CockroachDB.\n\n[Learn how to build a Node.js app with CockroachDB.](https://www.cockroachlabs.com/docs/stable/build-a-nodejs-app-with-cockroachdb-sequelize.html)\n\nPlease file bugs against the [sequelize-cockroachdb project](https://github.com/cockroachdb/sequelize-cockroachdb/issues/new)\n\n## Requirements\n\nThis package needs Node.js v12 or later\n\n## Setup and run tests\n\nFirst make sure you have CockroachDB installed. You can run `cockroach version` to see if is installed or you can [download here](https://www.cockroachlabs.com/docs/stable/install-cockroachdb.html)\n\nRun `cockroach start-single-node --insecure --logtostderr` to start the database. If this returns `ERROR: cockroach server exited with error: unable to lookup hostname` run with `--host localhost` flag.\n\nRun `cockroach sql --insecure` to enter in SQL mode and type `CREATE DATABASE sequelize_test;`\n\nThen install the depedencies with `npm i` and `npm test` to run all tests\n\n## Limitations\n\n### Dealing with transactions\n\nFrom the [docs](https://www.cockroachlabs.com/docs/stable/transactions.html)\n\n\u003e CockroachDB guarantees that while a transaction is pending, it is isolated from other concurrent transactions with serializable isolation.\n\nWhich means that any other query made in another connection to the same [node](https://www.cockroachlabs.com/blog/how-cockroachdb-distributes-atomic-transactions/) will hang.\n\nFor example:\n```js\nconst t = await this.sequelize.transaction();\nawait this.User.create({ name: \"bob\" }, { transaction: t });\nawait this.User.findAll({ transaction: null }); // Query will hang!\n```\n\n### CockroachDB does not support yet:\n\n\n- [CITEXT](https://github.com/cockroachdb/cockroach/issues/22463)\n- [TSVector](https://github.com/cockroachdb/cockroach/issues/41288)\n- [lower](https://github.com/cockroachdb/cockroach/issues/9682?version=v20.2) function for index\n\nSee `tests/model_create_test.js` to browse those implementations.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcockroachdb%2Fsequelize-cockroachdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcockroachdb%2Fsequelize-cockroachdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcockroachdb%2Fsequelize-cockroachdb/lists"}