Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

singularization rule for personas #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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. volatiletech/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.

None yet

1 participant