GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - patrickmoffitt/local-sqlite-example: Demonstrates database-driven Electron using local SQLite with SQL.js.

This repository was archived by the owner on Dec 14, 2020. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

14 Commits
14 Commits

Folders and files

NameName
Last commit message
Last commit date
app
app
 
 
node_modules
node_modules
 
 
screenshots
screenshots
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
main.js
main.js
 
 
package.json
package.json
 
 

Repository files navigation

Logo

How to Build an Electron App with a Local SQLite3 Database That's Portable.

This project demonstrates how to install and use a local SQLite3 database in Electron using SQL.js. SQL.js is a port of SQLite to JavaScript, by compiling the SQLite C code with Emscripten. Using only JavaScript means there are no C bindings or node-gyp compilations to deal with.

Updates

September 2020

  • Added enableRemoteModule: true to webPreferences in main.js to address a breaking change in Electron 10 wherein the remote module is now disabled by default. Thank you to Barbarosse
    for reporting the issue.

January 2018

  • Updated SQL.js to 0.4.0
  • Updated Bootstrap to 4.0.0-beta.3. Form validation was revised to agree with current documentation. Improved responsive layout and UTF-8 support.
  • Dropped all non-functional UI features.

Quick Code Tour

  • The code entry point is in package.json under the key "main". The value is "main.js"
  • main.js calls model.initDb() from model.js which creates a new SQLite3 database from schema.sql. A callback creates a BrowserWindow and loads index.html.
  • index.html loads Bootstrap's CSS in the <head> tag and renderer.js after the closing <body> tag.
  • renderer.js loads Cheerio, jQuery, Bootstrap and it's dependency; Tether.
  • A composed HTML pattern is used to load the markup.
  • The application's database work is all done in model.js. Here you'll find functions to open and close the database as well as functions to select, insert, update, and delete records. Prepared statements are used throughout.
  • The application opens with a list of people. Click a red X to delete a person's record.

People

  • Click a pencil (shown above) to edit a person:

Edit

  • Click Add in the left rail to add a new person record:

Add

Uninstalling

Please note that running this application will install a tiny SQLite database in the folder returned by electron.app.getPath('userData'). To uninstall simply delete this folder.

Project Status

This project has been archived and is no longer being maintained by the author.

About

Demonstrates database-driven Electron using local SQLite with SQL.js.

Topics

electronemscriptensqlitesqlite3-database

Resources

Readme
MIT license
Activity

Stars

193 stars

Watchers

1 watching

Forks

44 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.