简体   繁体   中英

Electron & Node: How to read an SQL file?

I have a local sql file, not a server, which I need to query information from. How should I do this?

  • I have tried to install sqlite3 with npm , however I need to first install Microsoft visual studio to compile it:

    1. Will Visual Studio Community Edition 2017 (free) be able to compile this? The CLI error asks for version 2005.

    2. Is there an x86 flag for NPM when building this instead of using x64 from my system?

  • Or, are there other options? For example, localForage and WebSQL?

I would like an easy to install and use way, which is cross-platform compatible.

If you have just an sql file you need to import it into sqlite DB and save it as binary DB file, Only then you will be able to query as you probably want. This will work cross platform.

WebSQL will work inside of the browser and won't be able to access the HDD file.

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