Skip to content

enum generation issue #11

@DrBlury

Description

@DrBlury

When trying to generate enum structs, it generates something not useful. Take a look:

DBML:

enum limit_type {
    LARGE [note: 'a large customer']
    STANDARD [note: 'a standard customer']
    OTHER [note: 'a other customer']
}

Generated:

package dbo

// LimitType is generated type for enum 'limit_type'
type LimitType int

const (
	_ LimitType = iota
	_           // a large customer
	_           // a standard customer
	// a other customer
)

What exactly is the proper way to do this? Or am I getting something wrong?

I would have expected something like this:

package dbo

// LimitType is generated type for enum 'limit_type'
type LimitType string

const (
	LARGE LimitType = "large" // a large customer
	STANDARD LimitType = "standard" // a standard customer
        OTHER LimitType = "other" // a other customer
)

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions