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

Bigint support #1976

Closed
Ajinkya1496 opened this issue Sep 18, 2019 · 4 comments
Closed

Bigint support #1976

Ajinkya1496 opened this issue Sep 18, 2019 · 4 comments

Comments

@Ajinkya1496
Copy link

Ajinkya1496 commented Sep 18, 2019

I am using postgres 10 version, typeorm version 6.1.3 and pg version 7.11.0

I am facing issue with the bigint datatype. My entity looks like this.

@Entity({
  name:'users'
})
export class Users {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  name: string;

  @Column()
  team_id: number;
}

Now when I convert team_id datatype to bigint it gives me error saying
Data type "BigInt" in "Users.team_id" is not supported by "postgres" database
Postgres supports bigint and now javascript also supports bigint datatype.

How do I use bigint here in the entity. Current behaviour is that it converts bigint to string and wherever in the database I am using team_id, it goes as string only.

Is there possible solution or alterations that I can do to fix this.

@vitaly-t
Copy link
Contributor

This is the standard behavior, for all 64-bit integers to be presented as strings. See this explanation.

@Bessonov
Copy link

See brianc/node-pg-types#78

@vitaly-t
Copy link
Contributor

vitaly-t commented Oct 5, 2019

@brianc This should probably be closed as a duplicate of #78.

@brianc
Copy link
Owner

brianc commented Nov 20, 2019

Closing as dupe of brianc/node-pg-types#78

@brianc brianc closed this as completed Nov 20, 2019
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

4 participants