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
Allow setting custom RoowKey values #21
Comments
Doing this now, but even if we include rowKeyValue into the create function, the static createEntity in https://github.com/nestjs/azure-database/blob/master/lib/table-storage/azure-table.mapper.ts#L36 needs to be updated as well, yes? otherwise it's just going to replace rowKeyValue with a GUID... |
my other thought was simply modifying
static createEntity(partialDto, rowKeyValue) { and updating
if (null == partialDto.RowKey) {
entityDescriptor.RowKey._ = rowKeyValue
}
else {
entityDescriptor.RowKey._ = partialDto.RowKey;
} This way, we can define a RowKey in the entity / DTO which will take precedence, or if we don't implicitly define a RowKey a GUID will be created. Update: looks like we were both on the same correct path - there were a few extra changes required. Submitting PR now :) |
closed in 070bad3 |
This would be simple to add. Here are the steps:
The text was updated successfully, but these errors were encountered: