Skip to content

Commit

Permalink
add TagSplit
Browse files Browse the repository at this point in the history
  • Loading branch information
hengwei-test committed Apr 29, 2024
1 parent bdcca67 commit ca69c9c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,18 @@ func SplitSQLStatements(r io.Reader, prefix string) []string {

return stmts
}

var SplitXORM = &TagSplit{
Prefix: "xorm",
Split: TagSplitForXORM,
}

var SplitDB = &TagSplit{
Prefix: "db",
Split: TagSplitForDb,
}

type TagSplit struct {
Prefix string
Split func(s string, fieldName string) []string
}
4 changes: 4 additions & 0 deletions gobatis.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ type Nullable = core.Nullable
type Error = core.Error
type SqlError = core.SqlError

var SplitXORM = core.SplitXORM
var SplitDB = core.SplitDB
type TagSplit = core.TagSplit

const (
OdbcPrefix = "odbc_with_"

Expand Down

0 comments on commit ca69c9c

Please sign in to comment.