TryGhost / node-sqlite3

SQLite3 bindings for Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Being able to connect to a database that is located in a Buffer variable

Dev-InSoft opened this issue · comments

Summary

In an Azure Functions server, a request receives an SQLite database file as a parameter. It reads it from FORMDATA and assigns it to a variable. It would be nice if you could connect to a database without having to store the buffer on disk.

Proposed implementation

Azure Functions do not allow writing to disk in certain environments, so it is not necessary to connect to the in-memory database

I'd assume the way to do this is binding sqlite3_serialize and sqlite3_deserialize. SQLite3 can't directly work against some random buffer, but it can deserialize from it and serialize to a new buffer.