LIGHTNING-LISTSQLSCHEMAS(7)

πŸ“¦
version 26.06.9 Β· 2 versions
, in nixpkgs unstable

πŸ’… 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 column
    • type (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 🌈


πŸ’œ 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