Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use database with Vuido #41

Open
sdkcodes opened this issue Nov 26, 2018 · 3 comments
Open

How to use database with Vuido #41

sdkcodes opened this issue Nov 26, 2018 · 3 comments

Comments

@sdkcodes
Copy link

Hello, so I need to build a desktop work that needs to work without internet using Vuido, and I need a mechanism for storing data offline.

@yujingaya
Copy link

You can use all libraries compatible with Node.js so if you want, for example, postgre you can install node-postgre

@galliroberto
Copy link

i am trying to use sqlite3.

when I run build or build:dev i get some errors:

`WARNING in ./node_modules/sqlite3/lib/sqlite3.js 4:14-35
Critical dependency: the request of a dependency is an expression
@ ./src/MainWindow.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/MainWindow.vue?vue&type=script&lang=js&)
@ ./src/MainWindow.vue?vue&type=script&lang=js&
@ ./src/MainWindow.vue
@ ./src/main.js

WARNING in ./node_modules/node-pre-gyp/lib/pre-binding.js 20:22-48
Critical dependency: the request of a dependency is an expression
@ ./node_modules/node-pre-gyp/lib/node-pre-gyp.js
@ ./node_modules/sqlite3/lib/sqlite3.js
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/MainWindow.vue?vue&type=script&lang=js&
@ ./src/MainWindow.vue?vue&type=script&lang=js&
@ ./src/MainWindow.vue
@ ./src/main.js

WARNING in ./node_modules/node-pre-gyp/lib/util/versioning.js 17:20-67
Critical dependency: the request of a dependency is an expression
@ ./node_modules/node-pre-gyp/lib/pre-binding.js
@ ./node_modules/node-pre-gyp/lib/node-pre-gyp.js
@ ./node_modules/sqlite3/lib/sqlite3.js
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/MainWindow.vue?vue&type=script&lang=js&
@ ./src/MainWindow.vue?vue&type=script&lang=js&
@ ./src/MainWindow.vue
@ ./src/main.js

WARNING in ./node_modules/node-pre-gyp/lib/util/compile.js
Module not found: Error: Can't resolve 'npm' in 'C:\Users\rgalli\www\vuido\test\node_modules\node-pre-gyp\lib\util'
@ ./node_modules/node-pre-gyp/lib/util/compile.js
@ ./node_modules/node-pre-gyp/lib sync ^./.*$
@ ./node_modules/node-pre-gyp/lib/node-pre-gyp.js
@ ./node_modules/sqlite3/lib/sqlite3.js
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/MainWindow.vue?vue&type=script&lang=js&
@ ./src/MainWindow.vue?vue&type=script&lang=js&
@ ./src/MainWindow.vue
@ ./src/main.js

WARNING in ./node_modules/node-pre-gyp/lib/util/nw-pre-gyp/index.html 1:0
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.

<!doctype html>
|
|
@ ./node_modules/node-pre-gyp/lib sync ^./.*$ ./util/nw-pre-gyp/index.html
@ ./node_modules/node-pre-gyp/lib/node-pre-gyp.js
@ ./node_modules/sqlite3/lib/sqlite3.js
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/MainWindow.vue?vue&type=script&lang=js&
@ ./src/MainWindow.vue?vue&type=script&lang=js&
@ ./src/MainWindow.vue
@ ./src/main.js

WARNING in ./node_modules/node-gyp/lib/Find-VS2017.cs 7:6
Module parse failed: Unexpected token (7:6)
You may need an appropriate loader to handle this file type.
| // Usage:
| // powershell -ExecutionPolicy Unrestricted -Version "2.0" -Command "&{Add-Type -Path Find-VS2017.cs; [VisualStudioConfiguration.Main]::Query()}"

using System
| using System.Text
| using System.Runtime.InteropServices
@ ./node_modules/node-gyp/lib sync ^./.$ ./Find-VS2017.cs
@ ./node_modules/node-gyp/lib/node-gyp.js
@ ./node_modules/node-pre-gyp/lib/util/compile.js
@ ./node_modules/node-pre-gyp/lib sync ^./.
$
@ ./node_modules/node-pre-gyp/lib/node-pre-gyp.js
@ ./node_modules/sqlite3/lib/sqlite3.js
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/MainWindow.vue?vue&type=script&lang=js&
@ ./src/MainWindow.vue?vue&type=script&lang=js&
@ ./src/MainWindow.vue
@ ./src/main.js`

my environment

node: v10.15.1 npm: 6.4.1 windows: 10 visual studio code 2017

@dthompso99
Copy link

just solved this with a small webpack adjustment:
externals: { sqlite3: 'commonjs sqlite3' },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants