Giter Site home page Giter Site logo

leota / electron-angular4-sqlite3 Goto Github PK

View Code? Open in Web Editor NEW
62.0 62.0 33.0 1.87 MB

Sample project to show how to build a desktop app using Electron, Angular 4 and Sqlite3

TypeScript 61.70% JavaScript 32.94% HTML 4.65% CSS 0.72%
angular4 desktop-app electron sqlite sqlite3

electron-angular4-sqlite3's People

Contributors

dependabot[bot] avatar leota avatar tonydiep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

electron-angular4-sqlite3's Issues

npm run electron-rebuild

When I run npm run electron-rebuild I get the error

npm ERR! missing script: electron-rebuild

[question] live development (watch/reload)

There is any way to build this project with watch enabled? I've tried to add the flag "--watch" and "-w" to the "build-electron" script, but it doesn't open the electron app.

list of user not coming (me.list = []; --> list coming "Undefined")

Hi,

I am new with electron and knex platform.
I am using the same git repository.
All commands are running successfully. (Using window 10 platform)

But I am not getting any user list.
Q : I have to add user in sql or users list already present ???
If present then list is not coming.
if not then how to add the user list using app.component.ts file.

App threw an error during load

Hi,

I was looking for similar setup and come across your project. I hope you don't mind.

I am encountering an error running "npm run electron-win ". I not quite sure why knex throwing out error.

App threw an error during load
D:\electron-sample\electron-angular4-sqlite3-master\node_modules\knex\src\migrate\Migrator.js:43
...knex.userParams,
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (D:\electron-sample\electron-angular4-sqlite3-master\node_modules\knex\src\util\make-knex.js:3:22)
at Object. (D:\electron-sample\electron-angular4-sqlite3-master\node_modules\knex\src\util\make-knex.js:284:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)

Thanks for the help.

Electron package for mac

I am using this sample code and got success with local database things.
But my issue is when i am trying to make package for mac it is showing error.
I am using electron-packager. I am attaching the screen shot of app when we are running angular-electron-sqlite.app file.

So can any one suggest how we can make it as package file

screen shot 2018-03-15 at 6 06 23 pm

npm run rebuild error

hi, @leota . I cloned your repo and run in local, but failed in npm run rebuild. could you tell me your npm version and python version and so on? thanks
image

Cannot find module node_sqlite3.node

When i type on terminal npm run electron i have this error:

Knex: run
$ npm install sqlite3 --save
Error: Cannot find module '/Users/vitolipari/job/LipariStudios/app/ElectronAngular4SQLite3_Sample/node_modules/sqlite3/lib/binding/electron-v1.7-darwin-x64/node_sqlite3.node'
    at Module._resolveFilename (module.js:470:15)
    at Function.Module._resolveFilename (/Users/vitolipari/job/LipariStudios/app/ElectronAngular4SQLite3_Sample/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/vitolipari/job/LipariStudios/app/ElectronAngular4SQLite3_Sample/node_modules/sqlite3/lib/sqlite3.js:4:15)
    at Object.<anonymous> (/Users/vitolipari/job/LipariStudios/app/ElectronAngular4SQLite3_Sample/node_modules/sqlite3/lib/sqlite3.js:190:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Client_SQLite3._driver (/Users/vitolipari/job/LipariStudios/app/ElectronAngular4SQLite3_Sample/node_modules/knex/lib/dialects/sqlite3/index.js:75:12)
    at Client_SQLite3.initializeDriver (/Users/vitolipari/job/LipariStudios/app/ElectronAngular4SQLite3_Sample/node_modules/knex/lib/client.js:219:26)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] electron: `npm run build-electron && electron dist`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] electron script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/vitolipari/.npm/_logs/2017-12-08T13_44_45_983Z-debug.log

Error: require is not defined in index.html

at first, I followed as given instruction to start electron app but during npm install electron was failing to install.

then I removed the electron from package.json and manually installed electron with the latest version.

now I am getting an error saying that require is not defined in index.html file at line 15
Uncaught ReferenceError: require is not defined at index.html:15

and another error is cannot read property ipcRenderer of undefined in AppComponent
AppComponent_Host.html:1 ERROR TypeError: Cannot read property 'ipcRenderer' of undefined

Compilation error

Cloning a fresh copy of the repo and running the commands in README fails at npm run electron with

A JavaScript error occurred in the main process
Uncaught Exception:
/mnt/usb-1t/projects/electron-angular4-sqlite3/node_modules/knex/lib/client.js:292
      ...this.getPoolSettings(config.pool),
      ^^^
SyntaxError: Unexpected token ...
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/mnt/usb-1t/projects/electron-angular4-sqlite3/node_modules/knex/lib/knex.js:2:16)

Is it possible to run it like an angular with ng serve ?

Hi. I would like to say thank you as I was trying to integrate sqlite + angular and electron for a few days and without success.
I'm not sure if this is an issue as you would find it already or rather this is because I'm new with angular :) . So please excuse me that I'm writing to you in such way.
I have just downloaded clear version of your project to see how to use the sqlite with standalone electron app. I wanted to test it from the browser so just stared it as usual Angular application with ng server and then I'm I'm getting following error from index.html

Uncaught ReferenceError: require is not defined
    at localhost/:14

btw. I have no error when running like you advised 'npm run electron'

Also could kindly please advise me how to make it working for inserting the data into the DB ? I mean, how to send any arguments from controller ?
Regards
Jan

how to get acces to DB folder created

have a sqlite implemented for mobile app.wants to resuse it in my electron angular app,i was able to get the sqliteservice package in app.component.ts. but stuck in providing path to db,,,

i tried like this..
this.db = window
.sqlitePlugin
.openDatabase({name: 'database.sqlite', location: ''../DB/''});
and this way:
this.db = {name: 'database.sqlite', location: '../DB/'};

ant help would be appreciated..

Performing SELECT/CRUD

Hello,
Your work helped me get started with my project, thank you.
I'm trying to execute queries outside the main.js of the electron folder, but I can't get it to work. I need to write a typescript file with all the functions needed to access the database.

could you please help me.

I keep getting Unhandled rejection TypeError: _this.driver.Database is not a constructor at ... in the console of the electron app

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.