From d1047791e9e25bc5a30ffc62f31c3d898843f042 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Thu, 19 Nov 2026 11:57:17 +0100 Subject: Insert list data --- lib/query/tests/insert_list.t | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lib/query/tests/insert_list.t (limited to 'lib/query/tests') diff --git a/lib/query/tests/insert_list.t b/lib/query/tests/insert_list.t new file mode 100644 index 0000000..3499bf8 --- /dev/null +++ b/lib/query/tests/insert_list.t @@ -0,0 +1,45 @@ +Insert rows in the lists declared in the configuration, then display the list +tables. Two rows are inserted per list; text and integer fields get a value +derived from the field name, and references point to the row of id 1: + + $ tests --insert_list < { + > "list": [ + > { + > "id": "country_list", + > "field": [ + > { "name": "name", "label": {}, "type": "text" }, + > { "name": "code", "label": {}, "type": "text" } + > ] + > }, + > { + > "id": "user_type_list", + > "field": [ + > { "name": "label", "label": {}, "type": "text" }, + > { "name": "rank", "label": {}, "type": "integer" }, + > { + > "name": "country", + > "label": {}, + > "type": { "content": "country_list" } + > }, + > { + > "name": "aliases", + > "label": {}, + > "type": { "content": "country_list", "multivaluated": true } + > } + > ] + > } + > ], + > "content": [ { "id": "entity" } ] + > } + > EOF + country_list: + {"id":1,"name":"name-1","code":"code-1"} + {"id":2,"name":"name-2","code":"code-2"} + user_type_list: + {"id":1,"label":"label-1","rank":1,"country":1,"country_table":"country_list"} + {"id":2,"label":"label-2","rank":2,"country":1,"country_table":"country_list"} + user_type_list.aliases: + {"parent":1,"target":1,"target_table":"country_list"} + {"parent":1,"target":2,"target_table":"country_list"} + {"parent":2,"target":2,"target_table":"country_list"} -- cgit v1.2.3