Skip to content
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

gnorm do not recognize default value from identity #120

Open
deelienardy opened this issue Jun 18, 2019 · 0 comments
Open

gnorm do not recognize default value from identity #120

deelienardy opened this issue Jun 18, 2019 · 0 comments

Comments

@deelienardy
Copy link

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant