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

MysqlQueryTransformer.prepareHydratedValue does not convert boolean or decimal #129

Open
chadfaurie opened this issue Feb 8, 2022 · 0 comments

Comments

@chadfaurie
Copy link

Package versions and database engine type (please complete the following information):

  • Mysql
  • TypeORM Version: 0.2.41
  • Driver Version: 2.3.5

Describe the bug
The MysqlQueryTransformer.prepareHydratedValue does not convert field of type boolean instead looks for a constructor of Boolean
Also does not convert decimal from string to a number

To Reproduce

@Entity({ name: "transaction" })
export class Transaction {
  @Column("decimal", {
    precision: 20,
    scale: 8,
  })
  public amount!: number;

  @Column("boolean")
  public hidden?: boolean = false;
}

Calling this line with entity as above returns string values for amount as well as a tinyint value for the hidden field

let t = await tranRepo.findOne({});
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