How to post data into database in electron


I am new for electron,
I am trying to build a smalll app using electron,That i am trying to to insert the data which is taken from front end,I am using SQL has database and react as front end can any give suggestions, How to insert data. Can any one please give me the solution for it,please help me


Assalamu 3alaykum

Do you need a node module for your database.



No I need sample code


What database are you using? There are many. Each one needs a driver to handle your SQL statements and return resultsets to you. Your code talks to the driver. The driver code talks to the database and to your code. So you must have interface code. The database vendor will have an API fthat you can use. This is also true of nosql databases such as MongoDB. If you are looking for sample JavaScript or CoffeeScript code, you can probably find it on the web. So check with your database vendor for the API you need.

You need to review two things: the driver documentation provided by the database vendor and the sample code you find. Vendors may supply sample code as well, and I’m sure Stack Overflow has bits and pieces of code, which you will have experiment with. Change it for your own application.

So for example here is a list of all the drivers that MongoDB supports: MongoDB Node Driver

Here is the API documentation for the Node.js driver that MongoDB, the company supports: API

The rest is up to you: it is sweat, sweat, sweat work.




I am using SQL server.i want to know that for desktop apps how can i pass data to the database from front end.I am using react.js as my front end,is node modules are working in electron and if possible please give me suggestions.



Please check whether SQL Server offers a driver of the type you need. Also check its documentation. I believe there are a few books on SQL Server and plenty of online documentation, too. There is very likely documentation in your native language, and that will be helpful for you.

I think you will have to write out a “road map” of what you want to do. Then you need to do the research that will let you travel the route that you map out.

SQL Server may or may not have a Node.js driver, I do not know. I use mainly MongoDB.




Thank You,I will look on that.


can you please give me a sample that how to give connection from front end to back-end(MongoDB) in electron

please provide sample code for it.

Hussian Shaik