Firebird.attach(options, function(err, db) { if (err) throw err; // db = DATABASE // INSERT BUFFER as BLOB db.query('INSERT INTO USERS (ID, ALIAS, FILE) VALUES(?, ?, ?)', [1, 'Peter', fs.readFileSync('/users/image.jpg')], function(err, result) { // IMPORTANT: close the connection db.detach(); });});