bob/bob.go

36 lines
781 B
Go
Raw Normal View History

2021-06-24 07:43:28 +00:00
package bob
import "github.com/lann/builder"
type BobBuilderType builder.Builder
type BobBuilder interface {
ToSql() (string, []interface{}, error)
}
func (b BobBuilderType) CreateTable(table string) CreateBuilder {
return CreateBuilder(b).Name(table)
}
2021-06-25 17:04:41 +00:00
func (b BobBuilderType) HasTable(table string) HasBuilder {
return HasBuilder(b).HasTable(table)
}
func (b BobBuilderType) HasColumn(column string) HasBuilder {
return HasBuilder(b).HasColumn(column)
}
2021-06-24 07:43:28 +00:00
var BobStmtBuilder = BobBuilderType(builder.EmptyBuilder)
func CreateTable(table string) CreateBuilder {
return BobStmtBuilder.CreateTable(table)
}
2021-06-25 17:04:41 +00:00
func HasTable(table string) HasBuilder {
return BobStmtBuilder.HasTable(table)
}
func HasColumn(col string) HasBuilder {
return BobStmtBuilder.HasColumn(col)
}