Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does SQLite support store Procedures

I am evaluating the SQLite database for my requirement. Does SQLite support stored procedures?

If yes then what are the limitations? Does SQLite support the range?

like image 762
CrazyC Avatar asked Aug 04 '10 05:08

CrazyC


People also ask

What are the limitations of SQLite?

An SQLite database is limited in size to 281 terabytes (248 bytes, 256 tibibytes). And even if it could handle larger databases, SQLite stores the entire database in a single disk file and many filesystems limit the maximum size of files to something less than this.

Does SQLite support CTE?

SQLite doesn't support CTEs, window functions, or any of the like.

Can multiple processes write to SQLite?

SQLite allows multiple processes to have the database file open at once, and for multiple processes to read the database at once. When any process wants to write, it must lock the entire database file for the duration of its update.


1 Answers

A key reason for having stored procs in a database is that you're executing SP code in the same process as the SQL engine. This makes sense for database engines designed to work as a network connected service but the imperative for SQLite is much less. Given that it run as a DLL in your current process it makes more sense to implement SP in the client language.

You can however extend SQLite with your own user defined functions in the host language (PHP, Python, Perl, C#, Javascript, Ruby etc). I've done this in C# using DevArt's SQLite to implement password hashing.

like image 64
Tony O'Hagan Avatar answered Sep 25 '22 12:09

Tony O'Hagan