oskarer / websql-promisified Goto Github PK
View Code? Open in Web Editor NEWUse Web SQL and Cordova SQLite with ES6 promises
License: MIT License
Use Web SQL and Cordova SQLite with ES6 promises
License: MIT License
That's what actually happens with the example from README:
It says that
The results array returned from transaction() is filled in the same order your queries execute.
and for me it never works. First it executes all "root" statements, and then in chained statements it lose expected order. Is that ever possible to fix it?
can i use it in angular 2 ...when i'm try do this and import
import websql from 'websql-promisified'; it..give me red line under websql-promisified . ???
I would expect the promise returned by transaction to only return Web SQL results that originated in that transaction - however - If I call two transactions in close succession the 2nd transaction promise includes the transaction from the first.
Not sure if this is intended or a bug, but it makes it difficult to have unrelated code that shares a database - Any suggestions?
Example:
var openDatabase = require('websql');
var webSqlPromise = require('websql-promisified').default;
var db = webSqlPromise(openDatabase('test-db', "1.0", "Test Database", 50000));
db.transaction(function(tx) {
tx.executeSql('select "hello" as greeting');
})
.then(function(results) {
console.log('first transaction results');
console.log(results);
// returns first transaction result
});
db.transaction(function(tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS Person (name TEXT, age Integer)');
})
.then(function(results) {
console.log('second transaction results');
console.log(results);
//return first AND second transaction result
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.