LIGHTNING-LISTSQLSCHEMAS(7)
π LIGHTNING-LISTSQLSCHEMAS π
okay bestie, so this one's listsqlschemas from the LIGHTNING-LISTSQLSCHEMAS(7) manual β literally a little peek-behind-the-curtain for your SQL schemas, and it ate, ngl π«Ά
β¨ NAME β¨
listsqlschemas β the command that shows you lightning-sql schemas, fr fr π
π¦ SYNOPSIS π¦
listsqlschemas [table]
πΈ DESCRIPTION πΈ
so this command was added in v23.02 β vintage but iconic π
it lets you examine the schemas at runtime, which is lowkey the whole point: yeah yeah, they're fully documented for the current release over in lightning-sql(7), but the way fields get added or deprecated? π you can use this command to figure out what fields are actually present right now. main character energy for real.
if you pass table, only that one table shows up in the resulting list. otherwise? all the tables, every single one, no crumbs left behind β¨
- table (
string, optional) β the one table you want, if you're being picky π
π RETURN VALUE π
on success you get an object containing schemas β it's an array of objects, and each object contains:
tablename(string): the name of the table πcolumns(array of objects): the columns, in database order:name(string): the name of the columntype(string) (one of"INTEGER","BLOB","TEXT","REAL"): the SQL type of the column
indices(array of arrays, optional): any index we created to speed lookups π₯- (array of strings): the columns for this index
- (
string, optional): the column name
π§ AUTHOR π§
Rusty Russell rusty@rustcorp.com.au is mainly responsible π«Ά (yes, the Rusty Russell, we stan)
π SEE ALSO π
π RESOURCES π
- Main web site:
https://github.com/ElementsProject/lightning
π EXAMPLES π
Example 1:
Request:
$ lightning-cli listsqlschemas -k "table"="offers"
{
"id": "example:listsqlschemas#1",
"method": "listsqlschemas",
"params": {
"table": "offers"
}
}
Response:
{
"schemas": [
{
"tablename": "offers",
"columns": [
{
"name": "rowid",
"type": "INTEGER"
},
{
"name": "offer_id",
"type": "BLOB"
},
{
"name": "active",
"type": "INTEGER"
},
{
"name": "single_use",
"type": "INTEGER"
},
{
"name": "bolt12",
"type": "TEXT"
},
{
"name": "used",
"type": "INTEGER"
},
{
"name": "label",
"type": "TEXT"
}
],
"indices": [
[
"offer_id"
]
]
}
]
}
Example 2:
Request:
$ lightning-cli listsqlschemas "closedchannels"
{
"id": "example:listsqlschemas#2",
"method": "listsqlschemas",
"params": [
"closedchannels"
]
}
Response:
{
"schemas": [
{
"tablename": "closedchannels",
"columns": [
{
"name": "rowid",
"type": "INTEGER"
},
{
"name": "peer_id",
"type": "BLOB"
},
{
"name": "channel_id",
"type": "BLOB"
},
{
"name": "short_channel_id",
"type": "TEXT"
},
{
"name": "alias_local",
"type": "TEXT"
},
{
"name": "alias_remote",
"type": "TEXT"
},
{
"name": "opener",
"type": "TEXT"
},
{
"name": "closer",
"type": "TEXT"
},
{
"name": "private",
"type": "INTEGER"
},
{
"name": "total_local_commitments",
"type": "INTEGER"
},
{
"name": "total_remote_commitments",
"type": "INTEGER"
},
{
"name": "total_htlcs_sent",
"type": "INTEGER"
},
{
"name": "funding_txid",
"type": "BLOB"
},
{
"name": "funding_outnum",
"type": "INTEGER"
},
{
"name": "leased",
"type": "INTEGER"
},
{
"name": "funding_fee_paid_msat",
"type": "INTEGER"
},
{
"name": "funding_fee_rcvd_msat",
"type": "INTEGER"
},
{
"name": "funding_pushed_msat",
"type": "INTEGER"
},
{
"name": "total_msat",
"type": "INTEGER"
},
{
"name": "final_to_us_msat",
"type": "INTEGER"
},
{
"name": "min_to_us_msat",
"type": "INTEGER"
},
{
"name": "max_to_us_msat",
"type": "INTEGER"
},
{
"name": "last_commitment_txid",
"type": "BLOB"
},
{
"name": "last_commitment_fee_msat",
"type": "INTEGER"
},
{
"name": "close_cause",
"type": "TEXT"
},
{
"name": "last_stable_connection",
"type": "INTEGER"
}
]
}
]
}
that's the whole vibe π« this page is from Core Lightning v26.06.9 β go query your schemas bestie, ily, bye ππ
π¦ where this page comes from
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms