简体   繁体   中英

How to create a database for electron app from python

I want to create a database with Python and then use this database in an Electron app.

There are a few requirements that I have:

  1. The database shared should be in a file format
  2. Ideally, the database created by Python can be used directly in Node without much trouble
  3. The database is in some form of JSON

I've learned about tinydb for Python and it seems great. However, I'm having trouble to use the result in the Electron app since I can't find packages that can provide database-like operations on the JSON created by tinydb

SQLite is pretty much the 'go to' database for simple databases in Electron. It's proven and robust. SQLite 3.9 introduced a new extension (JSON1) that allows you to easily work with JSON data. It provides json_insert(), json_replace, and json_set() functions for JSON data.

There's a discussion here on HN about using the JSON1 extension in SQLite - https://news.ycombinator.com/item?id=19277809

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