Skip to content

[FEATURE]: bigint mode in SQLite integer column #1980

@hyunbinseo

Description

@hyunbinseo

Describe what you want

  • SQLite's maximum integer value is 9223372036854775807
  • JavaScript's maximum safe integer is 9007199254740991
9223372036854775807 // SQLite's largest possible integer
9007199254740991 // JavaScript Number.MAX_SAFE_INTEGER

Allow SQLite integer columns to be inferred as JavaScript BigInt.

integer('id', { mode: 'number' })
integer('id', { mode: 'bigint' }) // support this

PostgreSQL and MySQL support this feature in the bigint column.

// will be inferred as `number`
bigint: bigint('bigint', { mode: 'number' })

// will be inferred as `bigint`
bigint: bigint('bigint', { mode: 'bigint' })

This will be useful for Autoincrement columns that can become large.

Related issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions