Closed GoWind closed 4 years ago
Hi Govind, thanks for this!
Could you please provide some more context/motivation? Is this an enhancement? A fix for something?
Much appreciated, cheers :-)
I feel it is idiomatic with respect to the general interface of the library. The put-item
fn accept a keyword or a string as an argument for the table's name ((faraday/put-item client :table-name)
and (faraday/put-item client "table-name")
are equivalent).
Keywords as names of indexes is also prevalent. For e.g.,
(fr/create-table
client
:table-a
[:name :s]
{:gsindexes [{:name :index-a
:throughput {:read 5 :write 5}
:hash-keydef [:type :s]
:projection :all}])
So intuitively, I expected the scan
and query
fns to accept a keyword index name when I was using the library and ran into exceptions as the .setIndexName
method expects a string but got a keyword instead. It is a rather minor enhancement, but I feel that allowing keywords for index names would make the library's APIs more consistent.
@GoWind and @ptaoussanis I'm looking into this one now. More soon.
Yep, this one's a no-brainer. Thanks @GoWind !
do a
(name index)
in scan-request and query-request fns so that the index names can be keywords.