anyone using vercel sqlite3?

  • Hello! I am trying to use sqlite3 on Vercel just to setup my environment,

    but I don't know how. I saw that when deploying python app, Vercel installs sqlite3 on their own

    but I can't find a way to access it ... my python app can't find sqlite 3 module .

    How can I get an access to this package? thx for your help in advance!

    • This topic was modified 3 days, 12 hours ago by  lucasPeni.
  • I would recommend reaching out to Vercel about that as they will likely be more help than a SQL Server forum, but below is my advice.

    My experience with sqlite3 is that it is a single-user database tool.  My experience with it has all been in Android, but once something opens the database file, only that process can access it.  So if Vercel is reading and writing to the sqlite3 database constantly, your python app may not have access to it.

    You can probably install sqlite3 on your machine (android has an executable called sqlite3, I believe that linux should as well and I would be surprised if Windows didn't have one), and then you should be able to write queries to the database file as you see fit.

    NOTE - sqlite3 requires you to connect to the database file, it is not a service or an "engine" that is constantly running waiting for connections.  If you don't know where the file is, you are not going to be able to do anything with it.


    EDIT - just adding a bit more stuff I found from a quick google:

    Basically says that using sqlite3 with Vercel is not recommended.  The accepted answer is:

    Since sqlite stores data locally, we recommend using a different database that can share state between instances of your functions.

    You can't reliably write to sqlite because storage is ephemeral in Serverless Functions. As your function receives more concurrent traffic, we will create new instances of your function that don't share the same storage.


    • This reply was modified 5 days, 5 hours ago by  Mr. Brian Gale. Reason: adding results from a google search

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply