Documentation ¶
Index ¶
- type Generator
- func (g *Generator) MSSQL(path string, options ...Option) error
- func (g *Generator) MySQL(path string, options ...Option) error
- func (g *Generator) PlantUML(path string, insertTop, insertBottom string) error
- func (g *Generator) Postgres(path string, options ...Option) error
- func (g *Generator) SQLite(path string, options ...Option) error
- func (g *Generator) Serializer(path string) error
- func (g *Generator) Test(path string) error
- func (g *Generator) TransactionCache(path string) error
- type Option
- func OptionCustomPlural(singular, plural string) Option
- func OptionNameFormat(format string) Option
- func OptionPostCreateSQL(sql string) Option
- func OptionPostDropSQL(sql string) Option
- func OptionPreCreateSQL(sql string) Option
- func OptionPreDropSQL(sql string) Option
- func OptionReplaceName(from string, to string) Option
- func OptionUniqueNamePrefix(prefix string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func Generate ¶
func Generate(source []byte, sourceFolder string, path string, options ...Option) (*Generator, error)
Generate accepts only the option OptionCustomPlural() so far.
func (*Generator) Serializer ¶
func (*Generator) TransactionCache ¶
type Option ¶ added in v0.17.0
type Option interface {
UpdateConfig(config) config
}
func OptionCustomPlural ¶ added in v0.19.3
OptionCustomPlural sets the plural nome for a custom word. For Example OptionCustomPlural("data", "datas") Will produce
func OptionNameFormat ¶ added in v0.19.1
OptionNameFormat sets how names are created from multiple elements. Valid values are:
as-id, as_id, AS_ID, asId, AsId, asID, AsID, asid, ASID
default is as_id which for example produces user_group_id as sql name.
func OptionPostCreateSQL ¶ added in v0.17.0
func OptionPostDropSQL ¶ added in v0.17.0
func OptionPreCreateSQL ¶ added in v0.17.0
func OptionPreDropSQL ¶ added in v0.17.0
func OptionReplaceName ¶ added in v0.19.2
func OptionUniqueNamePrefix ¶ added in v0.19.0
OptionUniqueNamePrefix sets the prefix that is used when table/column names colide with keywords for example user will be renamd to db_user. The default prefix is "db_". The prefix is only used for SQL the client code uses the unprefixed name.
Click to show internal directories.
Click to hide internal directories.