GithubHelp home page GithubHelp logo

sqlite3-transactions's People

Contributors

graham--m avatar richacker avatar strix-cz avatar

Stargazers

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

Watchers

 avatar  avatar

sqlite3-transactions's Issues

DeprecationWarning: sys is deprecated. Use util instead.

hello
i started to use sqlite3-transactions
but when i try to use it i got that error

(node:6747) DeprecationWarning: sys is deprecated. Use util instead.

my nodejs version 6.1.0
also i tested it in V6.0.0 and i got the same error

regards

library update

Hi there, I'd like to use transactions with sqlite3, but it seems like this library has not received a lot of love recently. Does node-sqlite3 now support transactions? I don't see that in their docs.

TypeError: Argument 1 must be a function

There is a bug, when I execute some queries after commit (inside callback). I keep getting:
node_modules\sqlite3-transactions\sqlite3-transactions.js:135
object[method].apply(object, args);

Here is test code:

var TransactionTest = function () {
    var testBeginId = 0;
    var transaction = function (err, transaction) {
        for (var i = 0; i < 30; i++) {
            transaction.run("INSERT INTO _test (Var1, Var2) VALUES (?,?)", i, i + 5);
        }
        transaction.commit(function (err) {
            if (err) {
                console.log(err);
                db.exec("DELETE FROM _test WHERE Id = ?", 1);
                return;
            }
            db.exec("UPDATE _test SET Var2 = ? WHERE Id = ?", 'update', testBeginId);
        });
    };
    db.run("INSERT INTO _test (Var1, Var2) VALUES ('TestBegin', datetime())", function (err) {
        if (err) {
            console.log(err);
            return;
        }
        testBeginId = this.lastID;
        db.beginTransaction(transaction);
    });
};
TransactionTest();

error native deadlock

Hi

I was testing your node module, the test i made was to put intencionally a error in one query in a list of queries to generate a rollback, but every error dead the app, i tried to capture error putting the commit funcion in a try catch, but the app died with any error in a query by error native.

`transaction i'm use

    db.beginTransaction(function(err, transaction){

        try {
            for (var key in listQueries) {
                transaction.run(listQueries[key]);
            }
            transaction.commit(function (err) {
                callback(err);
            });
        }
        catch(err){
            logger.write(err, logger.level.ERROR);
            callback(err);
        }

    });`

Publish new version

We are looking at using sqlite3-transactions in the azure-mobile-apps product. I notice you have fixed the warning about the sys module being deprecated, but this has not hit npm.

Any chance you could publish an update? Your module will likely get significant usage and testing if we proceed.

:memory: Database is undefined

var sqlite3 = require('sqlite3').verbose();
var TransactionDatabase = require("sqlite3-transactions").TransactionDatabase;
var db = new TransactionDatabase( new sqlite3.Database(":memory:") );
db.run( ....

db is undefined...

However, if no TransactionDatabase is used, the above run statement would work...
I did place the run statement in a call back for the sqlite3 new database call and that seems to work..

no rollback is performed on error

Running this on a nwjs-compiled sqlite3 in nwjs


db.run ("CREATE TABLE `test` (`index` INTEGER) PRIMARY KEY(`INTEGER`);");

db.beginTransaction(function(err, transaction) {
   transaction.run("INSERT ..."); //left this in by accident and even this did not trigger a rollback
   for (var i = 0; i < 3; i++) {
      transaction.run("INSERT INTO `test` VALUES (1);");
   }
   transaction.commit(function(err) {
      if (err) return console.log("Sad panda :-( commit() failed.", err);
      console.log("Happy panda :-) commit() was successful.");
   });
});

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.