SQLite User Forum

can I insert an 8GB file into sqlite?
Login
Hi, I am entirely new to virtual file systems. I want to build a local web app that uses sqlite as its file system. This is for a number of reasons:

* portability
* ease of migration
* avoiding folder count limits
* this article which I found very intriguing [https://www.sqlite.org/fasterthanfs.html](https://www.sqlite.org/fasterthanfs.html)

The database will be used to store media files (images, videos and audio) and relevant metadata and tags. File sizes can vary from 100KB to 30GB. (I put 8GB in the title just for an easy to digest question)


Again, possibly a very naiive approach, but I plan to write this in typescript with the npm package [better-sqlite3](https://github.com/JoshuaWise/better-sqlite3). Without using the `blob_open`, `blob_read` and `blob_write` functions, I can access large files stored in sqlite using `substr` on BLOBs piece-wise (for streaming to a web page). However the part I am unsure of is if I am even able to store large files in sqlite. Attempting to change the `SQLITE_MAX_LENGTH`, I saw this comment:

> The hard limit is the ability of a 32-bit signed integer to count the size: 2^31-1 or 2147483647.

which pretty much sounds like I am limited to ~2GB max file storage. In addition, even if files were under 2GB, I dont see any way to concatenate BLOBs or TEXT into a row without reading the whole column into memory first. Even reading 2GB into memory is pretty resource intensive and seriously limits the amount of things my program can do concurrently. Can I ask for some guidance on this here? Thank you very much in advance!