Querying data from Microsoft SQL Server using GraphQL in a Node.js app - node.js

I have a node app (using express) that I built which can query my MS SQL server via the mssql npm package. I want to be able to use something like the express-graphql package to handle those queries. I have done this before with a Mongo DB and mongoose but I am having difficulty fitting these things together now. Does anyone know where I might find a tutorial ? I googled around and everything seemed to be for different SQL dbs. Alternatively, is there a better package I should be using?

Related

Is it ok for a NodeJs API to have both MongoDb and MySQL(with prisma), but for different purposes?

Let me explain, so, I'm building this web application that visualizes data and the dataset that I'm working with is uploaded on a mongodb cluster. I'm also planning on making a login system using prisma and mysql. Should I build a new api for the whole user part or work with both databases in the same project?

Connect to SQL Server Express in Node.js

According to the below link, We can connect to SQL Server host in Node.js
connect to msserver in Node.js
But in this SQL Server version, it's necessary to install software and set some the setting for it.
The easy way to SQL Server database is an express version
In this version, We can connect to the SQL server database directly and without install any software
Actually, like Sqlite that no need to install any software
Unfortunately, I cannot find node.js npm for use express version
Can you help me with how do use it?
Finally, I found a solution for stand-alone database :)
You can use mini server MySQL
It's lightweight, high speed
Only run start_server.bat and use client MySQL to connect to it
Download from:
https://sourceforge.net/projects/miniserver/files/MiniServer/MiniServer_%20MySQL%205.0.67%20Portable/mini_server_11.exe/download

I am trying to connect Angular to MongoDB

I have a simple Angular app and it is running in Local Host 4200. How do I save the form values and store them in a MongoDB database?
Angular is a web framework dedicated for the client-side, MongoDB is
a NoSQL database, to save your data put into your angular app to your
Database, you need a server-side implementation like nodejs or
python, java, etc ..
I recommend for you to use expressjs as an API framework it can helps you to get started
Angular is not supposed to connect directly to a DB in an real project, so there is not much of a point to practice doing so. You should have an server-side application or a mock to do so. If you are trying to build a front for studies you can use packages such as this one to begin: https://www.npmjs.com/package/auto-api
It is of simple use and you can save data without configuring or installing a DB.

Migration generator files tools for nodejs and postgresql

I use nodejs and i have a postgresql database and I'm thinking of using sequelize or db-migration to migrate my existing database. Do you know a way to generate the migration files for my existing database?
Node.js database migration management for Postgresql
Here is how to go about it.
There exist a node package manager called node-pg-migrate
install the package using npm install node-pg-migrate pg
here is the github URL with code samples. https://github.com/salsita/node-pg-migrate#node-pg-migrate
Best of Luck

Existing Angular 2 project needs data from sql server?

I have a small Angular 2 application, but I can't find a way to connect and send queries to an existing sql server.
I found that I need to build a rest API and that I can use 'express.js'.
I also found that express.js can run my Angular 2 app at the same time as the backend server, but how do I set this up?
Can anyone point me in the right direction?
Thanks!!
Edit:
I'm still stuck, can anyone point me to a tutorial or something I can use to build an Angular 2 app that can send sql queries to a Microsoft SQL server and use this data in its templates?
Edit 2:
I used the Node package MSSQL to do this. Pretty easy when you get it set up.
MSSQL
You should look into setting up a SEAN stack application that would use Sequelize ORM to read from your SQL database.
https://github.com/MangoTools/sean
http://docs.sequelizejs.com/en/v3/

Resources