{"repo":"aergoio/sqlite-stored-procedures","free":true,"listed":false,"github":"https://github.com/aergoio/sqlite-stored-procedures","clone":"git clone https://github.com/aergoio/sqlite-stored-procedures.git","description":"Stored Procedures for SQLite","language":"C","stars":78,"topics":["sqlite","sqlite3","stored-procedures"],"license":null,"category":"databases-storage","readme_excerpt":"presents: Stored Procedures for SQLite 中文 日本語 Русский Example procedure: And how to call it: Wait, but why? Indeed, in most cases SQLite does not need this because applications can run the SQL commands directly on the local database! But stored procedures are useful when using replicated SQLite , mainly when the replicas are used by different programming languages. This feature will be added to AergoLite, the most secure replication of SQLite databases. The procedures will work almost as smart contracts in this case. Another potential use is in Node.js with node-sqlite3 , where some kind of transactions are hard to manage. Supported Commands The following commands are available: - DECLARE - SET - IF .. ELSEIF .. ELSE .. END IF - LOOP .. BREAK .. CONTINUE .. END LOOP - FOREACH .. BREAK .. CONTINUE .. END LOOP - CALL - RETURN - RAISE EXCEPTION DECLARE The DECLARE statement is used to declare a variable. The variable is local to the procedure and is not visible outside the procedure. The affinity is optional. If specified, it can be one of the following: - TEXT - INTEGER - REAL - BLOB The affinity is used to convert the value of the variable to the specified affinity when the variable is used in an expression. In the current version, we do not need to declare the variables if you do not need affinity. Just use the SET command to create new variables. SET The SET statement is used to assign a value to one or more variables. It has this format: The first form is used to assign a v","default_branch":null,"files":null,"tree":[],"storefront":"/r/aergoio","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/aergoio/sqlite-stored-procedures/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}