Skip to content

gnorm do not recognize default value from identity #120

@deelienardy

Description

@deelienardy

DB: Postgres v11.3 ubuntu

i try using gnorm for generate custom query builder for my project but when i try separating PK which has default value or not (such as custom PK by app or default using UUID), error happens.

It happens when i create table, like:

CREATE TABLE "test" ("id" BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY NOT NULL)

gnorm preview showing PK no default value

+------+--------+------+--------+---------+--------------+-------+----------+--------+-------------+----------+------------+---------+
| Name | DBName | Type | DBType | IsArray | IsPrimaryKey | IsFK  | HasFKRef | Length | UserDefined | Nullable | HasDefault | Comment |
+------+--------+------+--------+---------+--------------+-------+----------+--------+-------------+----------+------------+---------+
| id   | id     | int  | bigint | false   | true         | false | false    |      0 | false       | false    | false      |         |
+------+--------+------+--------+---------+--------------+-------+----------+--------+-------------+----------+------------+---------+

but on psql showing PK has default value

+--------+--------+-----------+----------+------------------------------+
| Column |  Type  | Collation | Nullable | Default                      |
|--------|--------|-----------|----------|------------------------------|
| id     | bigint |           | not null | generated always as identity |
+--------+--------+-----------+----------+------------------------------+

is this error from my config or gnorm do not recognize generated always as identity ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions