Skip to content
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 column name alias mapping #356

Open
PhVHoang opened this issue Aug 15, 2023 · 0 comments
Open

Support column name alias mapping #356

PhVHoang opened this issue Aug 15, 2023 · 0 comments

Comments

@PhVHoang
Copy link

There are cases when a table have already been created but the column names are not conform with typescript naming convention. (eg: "Order_Number"). In case we want to work with these tables while maintaining the naming convention, can we support the column name alias. Something like

export class Organisation {
  @AutoGenerateAttribute({
    strategy: AUTO_GENERATE_ATTRIBUTE_STRATEGY.UUID4,
  })
  id: string;

  @Attribute({
    alias: "Order_Number"
  })
  orderNumber: number;

  @AutoGenerateAttribute({
    strategy: AUTO_GENERATE_ATTRIBUTE_STRATEGY.EPOCH,
    autoUpdate: true, // this will make this attribute and any indexes referencing it auto update for any write operation
  })
  updatedAt: number;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant