The current design of RPC API /v1/chain/get_table_rows allows querying data with one or consecutive range of keys. If application wants to query data with discontinuous keys, it should send multiple requests to nodeos and results in inconvenience and network overhead.
Proposal
Allow optional field keys in the arguments of /v1/chain/get_table_rows:
When keys is not an empty array, lower_bound and upper_bound should be an empty string. keys field is optional (can be omitted), so it doesn't break backward compatibility.
Each value will be included in the returned rows when exactly same key exists, but if a non-existent key is included in keys parameter, null is returned for the value at the index of non-existent key.
Background
The current design of RPC API
/v1/chain/get_table_rows
allows querying data with one or consecutive range of keys. If application wants to query data with discontinuous keys, it should send multiple requests to nodeos and results in inconvenience and network overhead.Proposal
Allow optional field
keys
in the arguments of/v1/chain/get_table_rows
:When
keys
is not an empty array,lower_bound
andupper_bound
should be an empty string.keys
field is optional (can be omitted), so it doesn't break backward compatibility.Each value will be included in the returned rows when exactly same key exists, but if a non-existent key is included in
keys
parameter,null
is returned for the value at the index of non-existent key.cf) primary_key
bob
doesn't exist:Implementation
turnpike/eos@4e6dd13ee00f98374800251b3b23f31be4dd6ecc