You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am interested in exploring and building two new features which are currently not supported. I am hoping to discuss here before submitting code to check if this is something we would like to have and what the API design looks like.
1. Ability to customize type of partition key.
Currently you can define a new hash_key with table but are not allowed to specify a type.
OR
If you want a different type, the comments suggest to explicitly define id with the new type. This still prints warning because id is already defined.
I am proposing
Add a new hash_key_type to be defined with table
Allow overriding id without warning.
2. Ability to specify one of the timestamp fields as range_key
Using timestamps of created_at/updated_at as range_key is fairly common. Dynamoid offers a neat way to automagically add and sync created_at/update_at timestamps, but doesn't allow to cleanly use one of auto-added fields as the range key.
If created_at is specified as range param in conjunction with timestamps options , it will print warning.
If you turn off timestamps, you don't get the neat functionality of having created_at, updated_at maintained for you.
I am not sure what the API of this one should look like, we can add either extra options with timestamps or allow setting range_key but the field has to be declared separately.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am interested in exploring and building two new features which are currently not supported. I am hoping to discuss here before submitting code to check if this is something we would like to have and what the API design looks like.
1. Ability to customize type of partition key.
Currently you can define a new hash_key with
table
but are not allowed to specify a type.OR
If you want a different type, the comments suggest to explicitly define
id
with the new type. This still prints warning becauseid
is already defined.I am proposing
hash_key_type
to be defined with tableid
without warning.2. Ability to specify one of the
timestamp
fields as range_keyUsing timestamps of created_at/updated_at as range_key is fairly common. Dynamoid offers a neat way to automagically add and sync created_at/update_at timestamps, but doesn't allow to cleanly use one of auto-added fields as the range key.
If created_at is specified as
range
param in conjunction withtimestamps
options , it will print warning.If you turn off
timestamps
, you don't get the neat functionality of having created_at, updated_at maintained for you.I am not sure what the API of this one should look like, we can add either extra options with
timestamps
or allow settingrange_key
but the field has to be declared separately.Beta Was this translation helpful? Give feedback.
All reactions