Git Product home page Git Product logo

sequelize-sscce's Introduction

Sequelize Quick SSCCE Base Repository

Use this repository to quickly create an SSCCE for your issue! This way your issue will be much easier to investigate.

By using this repository, you won't have to worry about setting up any database. You 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. Everything is already set up for you.

You just write your code and it works, directly from GitHub!

Step 1 - Create the SSCCE

Go to the src/sscce.js file in this repository, and click the edit button (a pencil).

Since this is not your repository, a fork will be automatically created for you to perform your edit. You will see this message:

Just create your SSCCE in that file, and commit it to your fork:

Step 2 - Run your SSCCE with Travis CI / AppVeyor

This 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!):

The idea here is that once you open the pull request, Travis CI and AppVeyor will automatically execute it for you, since I have them configured in the main repository. I won't accept the pull request, since the goal is just to have your code executed.

These are Continuous Integration services, free to use on open source projects, that are used in Sequelize itself to run all the automated tests, such as here and here. They will run your SSCCE and show show a green checkmarks (or a red X) next to the commit:

What if you want to make some changes to the SSCCE?

Just add more commits on top of it, in your fork, and your PR will be updated automatically, and the SSCCE will be executed again.

I don't feel confortable doing this

Why not? This repository was created exactly for this purpose. Please feel free to use it.

However, if you prefer, you can also enable Travis CI and AppVeyor in your own fork, so you can have them execute your code without having to open the PR.

Creating a dialect-specific SSCCE

By default, your SSCCE will be executed on all dialects. If you only want a specific dialect, you can check the process.env.DIALECT variable. For example, if you only want to run your SSCCE for postgres, you can add the following at the beginning of your SSCCE code:

if (process.env.DIALECT !== "postgres") return;
// The rest of the SSCCE goes here...

Enabling specific postgres extensions

If your issue needs a postgres extension such as uuid-ossp, you should enable it at the beginning of your SSCCE:

await sequelize.query(`CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`);
// The rest of the SSCCE goes here...

Creating a SSCCE with TypeScript

Just use the src/sscce.ts file instead of the src/sscce.js file. That's it, super easy. Also works directly from GitHub.

Running the SSCCE locally

This repository also comes with built-in support for running your SSCCE locally on SQLite:

  • Clone this repository
  • npm install
  • Edit the src/sscce.js as you like
  • npm start

The above will run your SSCCE locally on SQLite, with no need for any other extra setup.

There is no local support for other dialects; this is harder because requires setting up local databases. It is doable, but out of scope for this repository. Learn more.

Running the SSCCE locally for TypeScript

Do the same as above, except:

  • Edit the src/sscce.ts file instead of the src/sscce.js file
  • Run npm run ts instead of npm start

License

MIT (c) Pedro Augusto de Paula Barbosa

sequelize-sscce's People

Contributors

papb avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.