简体   繁体   中英

Node.js, SQLite and C++

I am totally a beginner in Node.js and I am trying to follow tutorials and read books so I can learn more on the topic, but I had a question regarding Node.js and SQLite. I am trying to build a small website that will have a backend database. I will use Node.js to set up the website. When it comes to connecting Node.js and the database, I know there are modules (like sqlite3) that can be "imported" and used in Node.js. But I also know that SQLite can be used with the C++ library (I use C++ as a tool to start/kill Node.js files).

Would you suggest connecting the database directly with Node.js, or use it with C++? Are there any advantages for either way?

Most developers are using a Node.js-specific library like node-sqlite3 . All sqlite libraries for Node.js that I know of use the C++ library to interact with the database, so you can probably expect to get at least as good performance using one of these well-tested Node.js libraries as you will doing it in C++ yourself.

Your best bet is to do it directly in Node.js.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM