How to include supporting files like a SQLITE3 database in Netlify Functions?

I’m trying to understand how to attach files such as local file-based databases to Netlify Functions. Is there any information or examples on how to attach binaries to functions so that when they execute, they can load up a local database to perform some calculations and output the results?

I might be misunderstanding here, but iirc functions have their own execution environment so they couldn’t access your folders / file tree. Unless… Maybe, you can zip up the local db with the function so that they have access. I’m not 100% on this so hopefully throwing ideas out there! Then to read the db information you’d need to request via function?

@jonsully Maybe Jon here can help us!

@Null Maybe I don’t understand your question, but you cannot run SQLITE on Netlify. You’d have to migrate your data to one of the online database services that allow you to gain access to your data via an API call, or convert the data to a text or JSON file and parse it with JavaScript.

1 Like

Yeah I essentially read this as wanting to using a file in the code (JSON etc) as data. And can modify etc though by writing to that file.

Thanks for the feedback. So from what I’m understanding, you cannot attach a binary file, even with zip-it-and-ship-it. And Netlify functions only accepts JS files. Is this correct?

Ah, personally I’ve never encountered this but does this thread here help?Deploy non-JS binary files with functions

Or maybe view the zip it and ship it repo to see if anyone has enabled functionality to include binaries in the zip