Is it somehow possible to create a stored procedure, when using SQLite?
Is it somehow possible to create a stored procedure, when using SQLite?
No, but you can :
Vars to hold variablesView over a Recursive CTE to program arbitrary functions in pure SQL queries.So you can do most things you would normally do with stored procs.
For how to program functions in a SQL View see https://www.cafe-encounter.net/p3300/pretending-that-sqlite-has-stored-procedures-and-functions.
Alternatively you can:
This is easier and less work than you might think!
A step-by-step guide is at https://www.cafe-encounter.net/p3244/installing-and-using-sqlite-extensions-on-macos-and-maybe-windows-linux-too . This does add some deployment work: you will have to deploy the additional dll/so/dylib files with your application.
I've come across this question myself. I think stored procedures are supported in php pdo, but that module is handling it and building normal sql queries to send to sqlite. So, in php, possible to write stored procedures in your code, but no performance gain from using them.
correct me if I'm wrong, please.