This is old but just putting this out there:
If you don't want to deal with ORM or GraphQL, and just need a quick start, then just do
npm i tedious sequelize sql-template-string
tedious is the low-level library for connecting to MSSQL, while sequelize offers a nice interface and supports sql-template-string.
tedious
sequelize
sql-template-string
You can then just do this:
const Sequelize = require('sequelize'); const sql = require('sql-template-string'); const sequelize = new Sequelize('database', 'username', 'password', { dialect: 'mssql', dialectOptions: { options: { useUTC: false, dateFirst: 1, } } }) async function main() { const [results, metadata] = await sequelize.query(sql`SELECT 1`); } main();
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is old but just putting this out there:
If you don't want to deal with ORM or GraphQL, and just need a quick start, then just do
tediousis the low-level library for connecting to MSSQL, whilesequelizeoffers a nice interface and supportssql-template-string.You can then just do this: