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
Add support for Postgres GENERATED ALWAYS AS IDENTITY #8370
Comments
We're on the same wavelength @drtyh2o - mentioned this the other day in TypeORM's Slack and seems like there is support from the Maintainer to go in this direction: https://typeorm.slack.com/archives/CCTEVJC8G/p1636621370078900 How did you create and manage your tables with an |
allow developers to create a PrimaryGeneratedColumn of identity and choose between `ALWAYS` and `BY DEFAULT`. Closes: typeorm#8370
allow developers to create a PrimaryGeneratedColumn of identity and choose between `ALWAYS` and `BY DEFAULT`. Closes: typeorm#8370
We used Feel free to expand and use this issue (or close it in favor of a new one) should you decide to pursue a contribution. |
allow developers to create a PrimaryGeneratedColumn of identity and choose between `ALWAYS` and `BY DEFAULT`. Closes: typeorm#8370
allow developers to create a Column of identity and choose between `ALWAYS` and `BY DEFAULT`. Closes: typeorm#8370
allow developers to create a Column of identity and choose between `ALWAYS` and `BY DEFAULT`. Closes: typeorm#8370
allow developers to create a Column of identity and choose between `ALWAYS` and `BY DEFAULT`. Closes: typeorm#8370
allow developers to create a Column of identity and choose between `ALWAYS` and `BY DEFAULT`. Closes: #8370
…orm#8371) allow developers to create a Column of identity and choose between `ALWAYS` and `BY DEFAULT`. Closes: typeorm#8370
…orm#8371) allow developers to create a Column of identity and choose between `ALWAYS` and `BY DEFAULT`. Closes: typeorm#8370
Feature Description
The Problem
A recent feature added Postgres support for identity columns
{ generated: 'identity' }
which will generate columns usingGENERATED BY DEFAULT AS IDENTITY
. It would be great to support the option to generate columns usingGENERATED ALWAYS AS IDENTITY
.The Solution
We currently use
{ insert: false }
column option so that Typeorm won't include the identity column in the INSERT statements for some existing tables we have whose identity column was previously created withGENERATED ALWAYS AS IDENTITY
.It would be nice to be able to have Typeorm use
GENERATE ALWAYS AS IDENTITY
orGENERATE BY DEFAULT AS IDENTITY
based on some option. Theinsert
option is not included inTableColumnOptions
so that would not appear to be useful as a solution for conditionally generating the proper migration code.Relevant Database Driver(s)
aurora-data-api
aurora-data-api-pg
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: