question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue type:

[*] question

Database system/driver:

[ ] mysql / mariadb

TypeORM version:

[ ] latest

Steps to reproduce or a small repository showing the problem:

If a define a column with type bigint, then i got this field as string?

for example:


@Entity()
export class Follow {
  @PrimaryGeneratedColumn()
  id: number

  @Column({ type: "bigint" })
  uid: number   


  static async testBigInt(id: number) {
    let f = await getRepository(Follow).findOne({uid: id})
    console.log(typeof f.uid)
  }
}

Follow.testBigint(1)

then, I got string

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
imjamesbcommented, Dec 26, 2020

What about the BigInt type? It has been supported since Node v10, if not longer.

3reactions
pleerockcommented, May 14, 2018

its an expected behaviour. javascript’s numbers can’t fit huge bigint values

Read more comments on GitHub >

github_iconTop Results From Across the Web

int, bigint, smallint, and tinyint (Transact-SQL) - Microsoft Learn
The int data type is the primary integer data type in SQL Server. The bigint data type is intended for use when integer...
Read more >
BigInt - JavaScript - MDN Web Docs
A BigInt value, also sometimes just called a BigInt, is a bigint primitive, created by appending n to the end of an integer...
Read more >
SQL BIGINT Data Type - Dofactory
The BIGINT data type is an integer value from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. BIGINT is SQL Server's largest integer data type. It uses ...
Read more >
BIGINT Data Type - Apache Impala
An 8-byte integer data type used in CREATE TABLE and ALTER TABLE statements. Syntax: In the column definition of a CREATE TABLE statement:...
Read more >
SQL Server INT Data Types: BIGINT, INT, SMALLINT, TINYINT
This tutorial introduces you to the SQL Server integer data types and shows you how to use them effectively to store integer values...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found