{"id":18906872,"url":"https://github.com/sequelize/sequelize-sscce","last_synced_at":"2025-05-16T05:07:49.334Z","repository":{"id":40313691,"uuid":"211987637","full_name":"sequelize/sequelize-sscce","owner":"sequelize","description":"Base repository for creating and sharing Sequelize SSCCEs","archived":false,"fork":false,"pushed_at":"2025-03-28T22:26:43.000Z","size":191,"stargazers_count":47,"open_issues_count":165,"forks_count":352,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-12T13:35:18.283Z","etag":null,"topics":["sequelize","sequelize-sscce","sscce"],"latest_commit_sha":null,"homepage":"https://sequelize.org/","language":"TypeScript","has_issues":false,"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/sequelize.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":"2019-10-01T01:05:15.000Z","updated_at":"2025-04-05T19:49:57.000Z","dependencies_parsed_at":"2023-02-17T23:16:01.618Z","dependency_job_id":"d5dd7114-b6c5-4957-b6ad-13ac883550be","html_url":"https://github.com/sequelize/sequelize-sscce","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sequelize%2Fsequelize-sscce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sequelize%2Fsequelize-sscce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sequelize%2Fsequelize-sscce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sequelize%2Fsequelize-sscce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sequelize","download_url":"https://codeload.github.com/sequelize/sequelize-sscce/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471059,"owners_count":22076585,"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":["sequelize","sequelize-sscce","sscce"],"created_at":"2024-11-08T09:19:01.623Z","updated_at":"2025-05-16T05:07:44.324Z","avatar_url":"https://github.com/sequelize.png","language":"TypeScript","readme":"# Sequelize Quick SSCCE Base Repository\n\nUse this repository to create an [SSCCE](http://www.sscce.org/) for your issue! It will greatly help us figure out what is going wrong and your issue\nwill be much easier to investigate.\n\n## Method 1: Create your SSCCE locally (preferred)\n\n### Step 1 - Install this repository locally\n\nStart by [Forking this repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo),\nthen [clone it on your machine](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository).\n\nRun `npm install` or `yarn` to install the necessary dependencies.\n\n### Step 1 - Create the SSCCE\n\nYou now need to create a failing test that accurately represents the issue you're experiencing.\n\nIf you want to test against Sequelize 6, modify [src/sscce-sequelize-6.ts](./src/sscce-sequelize-6.ts).\nIf you want to test against Sequelize 7, modify [src/sscce-sequelize-7.ts](./src/sscce-sequelize-7.ts).\n\nIf you are using a version older than Sequelize 6, unfortunately these versions are now EOL and won't receive support.\nYou should consider migrating to Sequelize 6.\n\nRemember the [SSCCE rules](http://www.sscce.org/). It should be:\n\n- *Short (Small)* - It should not include anything that is not relevant to your issue.\n- *Self Contained* - Ensure everything is included, ready to go.\n- *Correct* - It should demonstrate the problem you're encountering (i.e. the sscce should fail, but with the right error).\n- *Example* - Displays the problem we are trying to solve.\n\n### Step 2 - Run the SSCCE\n\nUse one of our npm scripts to run your SSCCE.\n\nRunning with a dialect other than sqlite will require installing an extra package\n\u0026 having a database running. For convenience, we provide docker containers for each database.\n\nYou can also opt to open a pull request, and run the code directly in our CI.\n\n#### sqlite\n\nThe easiest of the bunch. Simply run:\n\n```shell\nnpm run test:sqlite\n```\n\n#### postgres\n\nYou'll need to install the `pg` package and have a postgres database running.\n\n```shell\n# Do this only once.\nnpm install pg\n# or\nnpm install pg-native\n\n# if you need to use DataTypes.HSTORE, you also need this dependency\nnpm install pg-hstore\n\n# Start the postgres database using docker.\n# Requires docker. You can also run your own database if you prefer.\nnpm run start:postgres\n\n# run the sscce!\nnpm run test:postgres\n# or\nnpm run test:postgres-native\n\n# Remember to stop the docker container once you're done.\nnpm run stop:postgres\n```\n\n#### mariadb\n\n```shell\n# Do this only once.\nnpm install mariadb\n\n# Start the mariadb database using docker.\n# Requires docker. You can also run your own database if you prefer.\nnpm run start:mariadb\n\n# run the sscce!\nnpm run test:mariadb\n\n# Remember to stop the docker container once you're done.\nnpm run stop:mariadb\n```\n\n#### mysql\n\n```shell\n# Do this only once.\nnpm install mysql2\n\n# Start the mysql database using docker.\n# Requires docker. You can also run your own database if you prefer.\nnpm run start:mysql\n\n# run the sscce!\nnpm run test:mysql\n\n# Remember to stop the docker container once you're done.\nnpm run stop:mysql\n```\n\n#### mssql (SQL Server)\n\n```shell\n# Do this only once.\nnpm install tedious\n\n# Start the mssql database using docker.\n# Requires docker. You can also run your own database if you prefer.\nnpm run start:mssql\n\n# run the sscce!\nnpm run test:mssql\n\n# Remember to stop the docker container once you're done.\nnpm run stop:mssql\n```\n\n### Step 3 - Commit your SSCCE \u0026 sent it to us\n\nOpen an issue on the [main sequelize repo](https://github.com/sequelize/sequelize/) describing\nyour problem and include a link to your SSCCE in it.\n\nYou can also open a PR of your fork to [this repository](https://github.com/sequelize/sequelize-sscce),\nthis way your SSCCE will be run on our CI and will continue existing even if you delete your fork.\n\n## Method 2: Create your SSCCE on GitHub\n\nBy using this method, you won't have to worry about setting up any database.\nYou don't need to install anything, you don't need docker, you don't need to spend time configuring a development environment to create your SSCCE.\nEverything is already set up for you in our GitHub actions.\n\n**You just write your code and it works, directly from GitHub!**\n\n### Step 1 - Create the SSCCE\n\nIf you want to test against Sequelize 6, go to this file: [src/sscce-sequelize-6.ts](./src/sscce-sequelize-6.ts).\nIf you want to test against Sequelize 7, go to this file: [src/sscce-sequelize-7.ts](./src/sscce-sequelize-7.ts).\n\nThen click the edit button (a pencil).\n\nSince this is not your repository, a fork will be automatically created for you to perform your edit. You will see this message:\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/g2rjLmb.png\" /\u003e\u003c/div\u003e\n\nJust create your SSCCE in that file, and commit it to your fork:\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/HZP9oIg.png\" /\u003e\u003c/div\u003e\n\n### Step 2 - Run your SSCCE with GitHub Actions\n\nThis step is **extremely easy**. Now that you have commited your SSCCE to your fork, just open a Pull Request (don't worry, *I won't accept it!*):\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/TTvuBEM.png\" /\u003e\u003c/div\u003e\n\nThe idea here is that once you open the pull request, GitHub Actions will automatically execute it for you, since I have it configured in the main repository. I won't accept the pull request, since the goal is just to have your code executed.\n\nIt will run your SSCCE and show a green checkmark (or a red X) next to the commit:\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/QVAKvnz.png\" /\u003e\u003c/div\u003e\n\n## FAQ\n\n### What if you want to make some changes to the SSCCE?\n\nJust add more commits on top of it, in your fork, and your PR will be updated automatically, and the SSCCE will be executed again.\n\n### I don't want to open a pull request for this\n\nYou don't have to! If you've opted for method 1, you can just add a link to your forked repository in your issue.\n\nHowever, opening a pull request will ensure the SSCCE continues to exist even if you delete your fork. Less clutter in your repository list!\n\n### Creating a dialect-specific SSCCE\n\nBy default, your SSCCE will be executed on all dialects. If you only want a specific dialect,\nyou can remove dialects you don't need to test on from the `testingOnDialects` variable in your `sscce-sequelize-x.ts` file.\n\nFor example, if you only want to run your SSCCE for postgres, change the following line:\n\n```typescript\n// if your issue is dialect specific, remove the dialects you don't need to test on.\nexport const testingOnDialects = new Set(['mssql', 'sqlite', 'mysql', 'mariadb', 'postgres', 'postgres-native']);\n```\n\nto this:\n\n```typescript\n// if your issue is dialect specific, remove the dialects you don't need to test on.\nexport const testingOnDialects = new Set(['postgres']);\n```\n\n### Enabling specific postgres extensions\n\nIf your issue needs a postgres extension such as `uuid-ossp`, you should enable it at the beginning of your SSCCE:\n\n```js\nexport async function run() {\n  const sequelize = createSequelize6Instance();\n\n  // add it here, after createSequelizeInstance:\n  await sequelize.query(`CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\"`);\n\n  // The rest of the SSCCE goes here...\n}\n```\n\n## License\n\nMIT (c) Pedro Augusto de Paula Barbosa \u0026 The Sequelize Team\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsequelize%2Fsequelize-sscce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsequelize%2Fsequelize-sscce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsequelize%2Fsequelize-sscce/lists"}