AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 17 Bitcoin

plugins/sql: add a delete_statement to toplevel tables with created_index values.

Public commit record

What the developer wrote

Authored by Rusty Russell

73/100 · Adequate
plugins/sql: add a delete_statement to toplevel tables with created_index values.

This will let us (efficiently) delete a single entry, so we can wean
tables with created_index off the default "delete all and reload" behavior.

Change insert_stmt to a const, too (and use a temporary when we're
building it).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This is a small internal cleanup in Core Lightning's SQL plugin. It adds a prepared 'DELETE' statement for tables that have a created_index column, and makes the existing insert statement constant. The change is meant to enable future efficient single-row deletion instead of deleting and reloading whole tables. There is no direct security bug visible in the diff, and no exploit path is shown.

Recommended action

No immediate action required. Treat as routine refactoring. If reviewing the broader feature, verify that future commits actually bind parameters correctly when delete_stmt is executed and that created_index values are unique and stable.

Security signals we found

01

SQL statement construction using tal_fmt with internal table names

02

Use of parameterized placeholder '?' for created_index in delete statement

03

No user-controlled input concatenated into generated SQL

04

Refactoring only; no functional deletion logic added in this commit