tursodatabase / tursodatabase/libsql

Support for stored procedure

Open
#57 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
17.2k
Forks
531
Avg merge
1h 12m
Merged PRs (30d)
1

Description

We want to add support for stored procedures.

There is a thread about this feature on the SQLite forum: https://sqlite.org/forum/info/78a60bdeec7c1ee9, many use-cases are described there, and this is also something that meta added to their custom extension of SQLite for messenger: https://engineering.fb.com/2020/03/02/data-infrastructure/messenger/

We want to follow the syntax described in https://www.w3schools.com/sql/sql_stored_procedures.asp

Unresolved questions:

  • How to handle procedures that depend on a table when that table is deleted
  • How should procedures interact with UDF? i.e should we allow procs and UDF to conflict? This should be ok if procs are invoked with EXEC as seems to be the standard syntax in SQL.
  • How should procedures be stored? As bytecode, plain SQL statement? Serialized AST?
  • How should params be handled?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked SQLite forum thread and the Messenger engineering post, then compare their stored-procedure use cases with the requested W3Schools syntax. Resolve how procedures depend on deleted tables, interact with UDFs, are stored, and accept parameters; the issue names no source files or tests, so completion requires defining the design before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql, sqlite
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.