Singularizing plural table names can generate redeclared models, forcing me to use emit_exact_table_names: true
#3835
Labels
emit_exact_table_names: true
#3835
Version
1.28.0
What happened?
One of my table names is a plural of another one of my table names. This causes the auto-generated model to be re-declared.
I'm generating sqlc models for an existing db, using
pg_dump $DATABASE_URL --schema-only > "$OUTPUT_FILE"
, so I don't have control over the schema. I generally likeemit_exact_table_names: false
, but this bug means I can't use it for this project. It would be nice if sqlc could detect the collision and use a plural model name fordjango_celery_beat_periodictasks
.I don't think table struct renaming works because it's based on the generated name, which is the same for both tables. https://docs.sqlc.dev/en/stable/howto/rename.html
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
No response
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: