holistics / holistics/dbml

Encourage not to use serial in newer PostgreSQL versions

Open
#229 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.7k
Forks
233
Avg merge
1d 23h
Merged PRs (30d)
4

Description

Hello,

Since PostgreSQL 10, usage of `serial` is [not recommended]. So, I guess it's better to suggest the usage of `GENERATED BY DEFAULT AS IDENTITY`. First reason PostgreSQL's approach is not how things are done in SQL standard. With this change, things are done similarly to DB2 and Oracle. The following snippet is where this support can be implemented.

https://github.com/holistics/dbml/blob/5a5513e0bdf7104e12b4e8e98bf88d99aca7c493/packages/dbml-core/src/parse/postgresql/Commands/Create_table/Create_table_normal.pegjs#L140

[not recommended]: https://wiki.postgresql.org/wiki/Don't_Do_This#Don't_use_serial

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.