Files
lightning/doc/lightning-deldatastore.7.md
Rusty Russell 533571a655 datastore: add generation, simple atomicity.
We add a generation counter, and allow update or del conditional
on a given generation.

Formalizes error codes, too, since we have more now.

Suggested-by: @shesek
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-25 10:06:31 +02:00

50 lines
1.3 KiB
Markdown

lightning-deldatastore -- Command for removing (plugin) data
============================================================
SYNOPSIS
--------
**deldatastore** *key* [*generation*]
DESCRIPTION
-----------
The **deldatastore** RPC command allows plugins to delete data it has
stored in the c-lightning database.
The command fails if the *key* isn't present, or if *generation*
is specified and the generation of the data does not exactly match.
RETURN VALUE
------------
[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:
- **key** (string): The key which has been removed from the datastore
- **generation** (u64): The number of times this has been updated
- **hex** (hex): The hex data which has removed from the datastore
- **string** (string, optional): The data as a string, if it's valid utf-8
[comment]: # (GENERATE-FROM-SCHEMA-END)
The following error codes may occur:
- 1200: the key does not exist
- 1201: the key does exist, but the generation is wrong
- -32602: invalid parameters
AUTHOR
------
Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible.
SEE ALSO
--------
lightning-listdatastore(7), lightning-datastore(7)
RESOURCES
---------
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:ca2b7b8f45b3ecd6332978599c803e38c4f80945119a777cb8ae346cbf063b10)