Skip to content

Conversation

farkmi
Copy link

@farkmi farkmi commented Jun 23, 2021

Adds a singularization rule for personas -> persona.

sqlboiler (v4.5.0) otherwise produces code that results in build errors, e.g.

CREATE TABLE personas (
    id uuid NOT NULL,
    name text NOT NULL,
    created_at timestamptz NOT NULL,
    updated_at timestamptz NOT NULL,
    CONSTRAINT personas_pkey PRIMARY KEY (id)
);

results in errors in the generated model, as it does not correctly singularize the struct name:

Personas redeclared in this block (see details)compilerDuplicateDecl
personas.go(176, 6): Personas redeclared in this block
personas.go(25, 6): other declaration of Personas (this error)
type Personas struct {
[...]
func Personas(mods ...qm.QueryMod) personasQuery {

This can be mitigated with an alias configuration for that table, however it seems more reasonable to fix this directly in strmangle, analogous to previous issues, e.g. aarondl/sqlboiler#653

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

Successfully merging this pull request may close these issues.

1 participant