Documentation ¶
Index ¶
- Constants
- type SqlBuilder
- type SqlBuilderOption
- func WithCommentGenerate() SqlBuilderOption
- func WithDialect(dialect sql_templates.SqlDialect) SqlBuilderOption
- func WithMysql() SqlBuilderOption
- func WithPluralTableName() SqlBuilderOption
- func WithPostgresql() SqlBuilderOption
- func WithSqlLowercase() SqlBuilderOption
- func WithSqlTag(sqlTag string) SqlBuilderOption
- func WithSqlUppercase() SqlBuilderOption
- func WithSqlite() SqlBuilderOption
- func WithSqlserver() SqlBuilderOption
Constants ¶
View Source
const (
// SqlTagDefault ...
SqlTagDefault = "sql"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SqlBuilder ¶
type SqlBuilder struct {
// contains filtered or unexported fields
}
SqlBuilder ...
func (SqlBuilder) GetTableName ¶
func (s SqlBuilder) GetTableName(t interface{}) (string, string)
GetTableName read from TableNameFn or parse table name from model as snake_case return object name and table name
func (*SqlBuilder) MappingTables ¶
func (s *SqlBuilder) MappingTables(m map[string]string)
MappingTables ...
func (SqlBuilder) RemoveTable ¶
func (s SqlBuilder) RemoveTable(tb interface{}) string
RemoveTable ...
type SqlBuilderOption ¶
type SqlBuilderOption interface {
// contains filtered or unexported methods
}
SqlBuilderOption ...
func WithCommentGenerate ¶
func WithCommentGenerate() SqlBuilderOption
WithCommentGenerate default is off
func WithDialect ¶
func WithDialect(dialect sql_templates.SqlDialect) SqlBuilderOption
WithDialect ...
func WithPluralTableName ¶
func WithPluralTableName() SqlBuilderOption
WithPluralTableName Table name in plural convention - ending with `s`
Click to show internal directories.
Click to hide internal directories.