Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
sqlite3-sync
Advanced tools
Readme
Synchronous Napi-bindings for libsqlite.
While the sqlite3-package for node.js is fine and usefull for server applications, its use tends to become overly complicated for simple scripting tasks..
So I immplemented a simple Napi based wrapper for libsqlite. Unlike other implementations, this package does not use libffi, mainly because i got into trouble using libffi on my target plattform. And just wrapping libsqlite myself seemed to be easier than tweaking or fixing foreign code.
Install the package via npm:
npm install sqlite3-sync
and use it:
let Sqlite = require('sqlite3-sync');
let db = Sqlte('my-db.sqlite');
db.each("SELECT name FROM customer",
(row) => { console.log(row.customer); },
() => { console.log("eof); }
);
let database = Sqlite(dbname, mode)
creates a database connection.
database.close()
close the database
row = database.get(sql_statment, arg_array)
prepares a statement, binds an array of arguments and returns the first resulting row.
list = database.all(sql_statment, arg_array)
prepares a statement, binds an array of arguments and returns the all resulting rows as an array.
database.run(sql_statment, arg_array)
prepares a statement, binds an array of arguments and runs the statement. This is equivalent to get()
database.exec(sql_statment, arg_array)
prepares a statement, binds an array of arguments and runs the statement. This is equivalent to get()
database.each(sql_statment, arg_array, function callback (row) => { }, function finally() => {} )
prepares a statement, binds an array of arguments and and opens a cursor for the query.
the callback is called once for each resulting row, after that the finally callback is called.
statement = database.prepare(sql_statment, opt_arg_array)
create a raw statemwnt object. This might be seldomly used, refer to index.js for further documention.
FAQs
synchronous sqlite bindings
We found that sqlite3-sync demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).