Coder Social home page Coder Social logo

Comments (3)

kkaefer avatar kkaefer commented on May 24, 2024 2

Can you please post the test files? Without these, it's pretty hard to determine why this error occurs. My guess is that one of the statements in your code isn't finalized. When you create statements with Database#prepare(), you have to call .finalize() on them; otherwise, sqlite will keep them around infinitely and won't allow closing the database.

from node-sqlite3.

markc avatar markc commented on May 24, 2024

Yes, of course, sorry. It was just the example at the top of README.md but with :memory: changed to an on disk file so I could check the results against my /usr/bin/sqlite3 v3.7.5.

var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database('./test.sqlite');

db.serialize(function() {
  db.run("CREATE TABLE lorem (info TEXT)");

  var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
  for (var i = 0; i < 10; i++) {
      stmt.run("Ipsum " + i);
  }

  db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
      console.log(row.id + ": " + row.info);
  });
});

db.close();

from node-sqlite3.

kkaefer avatar kkaefer commented on May 24, 2024

Thank you, I fixed the error in the readme

from node-sqlite3.

Related Issues (20)

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.