Reputation: 59
I'm used to use this WebSQL wrapper: https://github.com/psayre23/WebSQL
I want to use this in my Vue project, but I can't get it working. I did the following:
import * as WebSQL from './WebSQL';
var db = WebSQL('test');
Object.defineProperty(Vue.prototype, '$db', { value: db });
also tried:
require('./WebSQL');
var db = WebSQL('test');
Object.defineProperty(Vue.prototype, '$db', { value: db });
But I keep getting:
Can't find variable: WebSQL (WebSQL.js:429)
Upvotes: 0
Views: 900
Reputation: 1053
The repo you have provided is out-of-date. Last update was 5 years ago
.
webpack
.
E.g. this will not workimport * as WebSQL from './WebSQL';
WebSQL
which is deprecated. As @Ohgodwhy noticed, use IndexedDB
instead. If you'd prefer a simple API, try libraries such as localForage, dexie.js, ZangoDB and JsStore that make IndexedDB more programmer-friendly.Upvotes: 1