-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Set data types #12
Comments
Hi, so this contains 2 different requests i think -
so for 1, we haven't talked about it yet but we think it completely makes sense -
(because of reflect-metadata limit we have no choice to use NumberSet like custom class instead of clean Set) for 2, we don't really have plan as of now, since that consumes same write capacity anyway - though it does have some beneficial usage. for 1, I'd love to get PR and review - @dankochetov thanks. |
@breath103 Within Dyngoose, we dropped the use of reflect-metadata in favor of more explicit specifications, and there you can use sets and maps. Although it doesn't optimize updates to perform |
I'm not sure you understand what i meant by limit of reflect-metadata so NN should be typed as
compiled as
in short, we just need to create
and handle those on ORM query layer. this is completely possible, just need work; |
@breath103 You could also change this by creating more explicit decorators. You could maintain the existing support you have for
This would then allow you to avoid using reflect-metadata and you'd know what the value format should be. That is how Dyngoose implemented this, while it maintains An example string.metadata.ts
This could be added to Dynamorm without losing the reflect-metadata usage. See more examples of how it can work on Dyngoose Attributes doc. |
oh you mean not using reflect-metadata at all. i mean that's technically much easier way - it's just trading off developer's convenience of manually mapping types - this was design decision on system. |
@breath103 With sets, you can query using the I actually only see the the Except, Dynamorm currently does not use If you're going to attempt to optimize performance of sets, it might first be worth optimizing every single update operation of Dynamorm. Dyngoose does this by determining the best operation given the state and changes of the instance, see Although, the limitations in Dynamorm is why I ended up forking dynamo-types into Dyngoose. I've ended up adding a lot of functionality to Dyngoose that did not exist in dynamo-types. I'd eagerly merge the two projects back together if possible. |
Just another thought. I think developers would find it more convenient to change the decorator than to utilize a special set class. But a special set class for |
Well those are are very often talked issue:
so in summary, it doesn't really have material performance (or dynamodb capacity) impact unless record is crazy big.
I don't think second one is better not only because of Decorator dependent definition, but also giving out implicit option for Array and Set. also, this is design decision. you can create it on Dynagoose if you want |
When I was evaluating dynamo-types, that limitation was probably the single largest reason I couldn't convert to using dynamo-types. We have some massive tables and cloning the entire table into an index would be wasteful, by loading data from that index with dynamo-types and then saving would corrupt our tables. But all of dynamorm is designed around the concept that GSIs will have Unfortunately, at scale, there are too many times when loading the entire record is wasteful. The ability to perform a partial update to documents, without losing attributes that were not loaded, is necessary in those situations.
|
Yes indeed this assumes ProjectionType=All, since this is "ORM". technically in order to make sense the consistency of ORM, it's required to create "separated" model if the data schema is different. otherwise developers are always exposed to use none-existing attribute, since there is no explicit and safe way of knowing which attributes exists or not. Again this is simply system design trade offs. I mean i'm literally AWS certified Serverless Hero. me and team didn't implement those cause we decided that it's better tradeoff to not have those. both on productivity and performance wise. I'm not sure about your intention here precisely because of that. if you don't agree with the view of this repo and maintainers, you can just fork this repository and create your own. not to even mention since your point of view on designing ORM is completely opposite from us thus i've never had intention to merge with Dynagoose anyway. Instead you just copy-and-pasted a lot of codes from this repository, which is against ISC license. |
Are you planning to support Set data types (
SS
,NS
,BS
)? If there is no current progress in that direction, I'm willing to work on this.The text was updated successfully, but these errors were encountered: