bc2pg - use generated identity column for pk instead of serial
- 主要言語
- Python
- スター
- 32
- フォーク
- 7
- 平均マージ
- 12分
- マージ済み PR(30日)
- 14
説明
sqlalchemy creates a sequence for the pk by default. Preferred behaviour for pg 10 and up is to use a generated identity column and implicit sequence.
https://www.postgresql.org/docs/current/ddl-identity-columns.html
https://docs.sqlalchemy.org/en/20/core/defaults.html#identity-ddl
something like this (presuming that translating to `GENERATED BY DEFAULT` is the default, because we are loading data with existing values, it cannot not be `GENERATED ALWAYS`):
```
from sqlalchemy import Identity
...
columns.append(
Column(
column_name,
column_type,
primary_key=True,
Identity(),
comment=column_comments,
)
)
```
Obv, will only work for columns of type integer/bigint.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。