vwkd / denokv-graphql

GraphQL bindings for Deno KV
https://deno.land/x/denokv_graphql
MIT License
11 stars 0 forks source link

Support secondary indeces #6

Closed vwkd closed 1 year ago

vwkd commented 1 year ago

Alternative to id. Would require to maintain the mapping, update for each mutation, increases complexity. How to specify in schema? Using directive? How to specify in query which index (id, or secondary) is passed as argument?

vwkd commented 1 year ago

This is already possible. One can create a second table with the desired column as id, and either with the same columns as the primary table duplicating all the data, or one reference column to the row in the primary table. The mapping needs to be kept up-to-date for mutations.

Similar to Deno KV, we'll leave this to the user to offer full flexibility and decrease internal complexity.