feat: mark generated and identity columns across writers and DBML
- bun: scanonly+generated for GENERATED columns; scanonly+identity for ALWAYS identity (PK gets identity only) - gorm: <-:false+generated / identity, same primary key rule - dbml: write GENERATED/IDENTITY column notes and read them back into the model - pgsql: emit generation/identity clauses in migration create-table and add-column, no DEFAULT - readmes updated
This commit is contained in:
@@ -203,6 +203,14 @@ The writer automatically generates relationship fields:
|
||||
- Relationship field names use 3-letter prefixes
|
||||
- Includes proper `gorm` tags with `foreignKey` and `references`
|
||||
|
||||
## Read-only Columns
|
||||
|
||||
| Column | Tags |
|
||||
|---|---|
|
||||
| `GENERATED ... STORED` | `<-:false;generated` |
|
||||
| `GENERATED ALWAYS AS IDENTITY`, not PK | `<-:false;identity` |
|
||||
| `GENERATED ALWAYS AS IDENTITY`, PK | `identity` only |
|
||||
|
||||
## Notes
|
||||
|
||||
- Model names are prefixed with "Model" (e.g., `ModelUser`)
|
||||
|
||||
Reference in New Issue
Block a user