datastore: turn keys into arrays

After some discussion with @shesek, and my own usage, we agreed that
a more comprehensive interface, which explicitly supports grouping,
is desirable.

Thus keys are now arrays, with the semantic that a key is either a
parent or has a value, never both.

For convenience in the JSON schema, we always return them as arrays,
though we accept simple strings as arguments.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-08-25 12:21:34 +09:30
committed by Christian Decker
parent 533571a655
commit fe86c117d9
18 changed files with 560 additions and 318 deletions

View File

@@ -92,6 +92,8 @@ static const errcode_t DATASTORE_DEL_WRONG_GENERATION = 1201;
static const errcode_t DATASTORE_UPDATE_ALREADY_EXISTS = 1202;
static const errcode_t DATASTORE_UPDATE_DOES_NOT_EXIST = 1203;
static const errcode_t DATASTORE_UPDATE_WRONG_GENERATION = 1204;
static const errcode_t DATASTORE_UPDATE_HAS_CHILDREN = 1205;
static const errcode_t DATASTORE_UPDATE_NO_CHILDREN = 1206;
/* Errors from wait* commands */
static const errcode_t WAIT_TIMEOUT = 2000;