Skip to content

Auto Generated SYSGUID or UUID for HANA database #8218

Closed as not planned
Closed as not planned

Description

@biancamattosn

Feature Description

Could we have Auto Generated SYSGUID or UUID for HANA database?

The Problem

I would like to have annotation to generate sysguid for hana.

When add this annotation to an entity:

@PrimaryGeneratedColumn("uuid")
id: string;

or

@PrimaryColumn()
@Generated("uuid")
uuid: string;

I cant make it to generate a uuid automatically. Only if add manually in the migration script.
I saw in this code this feature is not available

The Solution

When adding that annotation for HANA database it should generate the field in the migration script like this:

"id" nvarchar(90) DEFAULT SYSUUID

Considered Alternatives

Relevant Database Driver(s)

DB Type Relevant
aurora-data-api no
aurora-data-api-pg no
better-sqlite3 no
cockroachdb no
cordova no
expo no
mongodb no
mysql no
nativescript no
oracle no
postgres no
react-native no
sap yes
sqlite no
sqlite-abstract no
sqljs no
sqlserver no

Activity

  1. alumni commented on Nov 19, 2023

    @alumni
    Collaborator

    Only SYSUUID can be used, NEWUID can not (forgot which one was faster).

    Column definition:

    ALTER TABLE "post" ADD ("guid" VARBINARY(16) GENERATED ALWAYS AS SYSUUID)

    Loading from DB:

    SELECT GENERATED_ALWAYS_AS FROM SYS.TABLE_COLUMNS WHERE TABLE_NAME = 'post' AND COLUMN_NAME = 'guid' -- 'SYSUUID'

    I might create a PR if I see more activity in the repo.

  2. github-actions commented on Sep 18, 2025

    @github-actions

    TypeORM has returned to active development after recently transitioning to new leadership (see related announcement).

    As part of the new team's efforts to prioritise work on the project moving forward, it is necessary to clean up the backlog of stale issues.

    🧹 This issue is being automatically closed because it has had no activity in the last 6 months.
    If you believe this issue is still relevant, feel free to comment below and the maintainers may reopen it. Thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions