-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #208 from doug-martin/v9.7.0
v9.7.0
- Loading branch information
Showing
81 changed files
with
74,910 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package sqlserver | ||
|
||
import ( | ||
"github.com/doug-martin/goqu/v9" | ||
"github.com/doug-martin/goqu/v9/exp" | ||
"github.com/doug-martin/goqu/v9/sqlgen" | ||
) | ||
|
||
func DialectOptions() *goqu.SQLDialectOptions { | ||
opts := goqu.DefaultDialectOptions() | ||
|
||
opts.UseLiteralIsBools = false | ||
|
||
opts.SupportsReturn = false | ||
opts.SupportsOrderByOnUpdate = false | ||
opts.SupportsLimitOnUpdate = false | ||
opts.SupportsLimitOnDelete = false | ||
opts.SupportsOrderByOnDelete = true | ||
opts.SupportsConflictUpdateWhere = false | ||
opts.SupportsInsertIgnoreSyntax = false | ||
opts.SupportsConflictTarget = false | ||
opts.SupportsWithCTE = false | ||
opts.SupportsWithCTERecursive = false | ||
opts.SupportsDistinctOn = false | ||
opts.SupportsWindowFunction = false | ||
|
||
opts.PlaceHolderFragment = []byte("@p") | ||
opts.LimitFragment = []byte(" TOP ") | ||
opts.IncludePlaceholderNum = true | ||
opts.DefaultValuesFragment = []byte("") | ||
opts.True = []byte("1") | ||
opts.False = []byte("0") | ||
opts.TimeFormat = "2006-01-02 15:04:05" | ||
opts.BooleanOperatorLookup = map[exp.BooleanOperation][]byte{ | ||
exp.EqOp: []byte("="), | ||
exp.NeqOp: []byte("!="), | ||
exp.GtOp: []byte(">"), | ||
exp.GteOp: []byte(">="), | ||
exp.LtOp: []byte("<"), | ||
exp.LteOp: []byte("<="), | ||
exp.InOp: []byte("IN"), | ||
exp.NotInOp: []byte("NOT IN"), | ||
exp.IsOp: []byte("="), | ||
exp.IsNotOp: []byte("IS NOT"), | ||
exp.LikeOp: []byte("LIKE"), | ||
exp.NotLikeOp: []byte("NOT LIKE"), | ||
exp.ILikeOp: []byte("LIKE"), | ||
exp.NotILikeOp: []byte("NOT LIKE"), | ||
exp.RegexpLikeOp: []byte("REGEXP BINARY"), | ||
exp.RegexpNotLikeOp: []byte("NOT REGEXP BINARY"), | ||
exp.RegexpILikeOp: []byte("REGEXP"), | ||
exp.RegexpNotILikeOp: []byte("NOT REGEXP"), | ||
} | ||
|
||
opts.FetchFragment = []byte(" FETCH FIRST ") | ||
|
||
opts.SelectSQLOrder = []sqlgen.SQLFragmentType{ | ||
sqlgen.CommonTableSQLFragment, | ||
sqlgen.SelectWithLimitSQLFragment, | ||
sqlgen.FromSQLFragment, | ||
sqlgen.JoinSQLFragment, | ||
sqlgen.WhereSQLFragment, | ||
sqlgen.GroupBySQLFragment, | ||
sqlgen.HavingSQLFragment, | ||
sqlgen.WindowSQLFragment, | ||
sqlgen.CompoundsSQLFragment, | ||
sqlgen.OrderWithOffsetFetchSQLFragment, | ||
sqlgen.ForSQLFragment, | ||
} | ||
|
||
opts.EscapedRunes = map[rune][]byte{ | ||
'\'': []byte("\\'"), | ||
'"': []byte("\\\""), | ||
'\\': []byte("\\\\"), | ||
'\n': []byte("\\n"), | ||
'\r': []byte("\\r"), | ||
0: []byte("\\x00"), | ||
0x1a: []byte("\\x1a"), | ||
} | ||
|
||
opts.ConflictFragment = []byte("") | ||
opts.ConflictDoUpdateFragment = []byte("") | ||
opts.ConflictDoNothingFragment = []byte("") | ||
|
||
return opts | ||
} | ||
|
||
func init() { | ||
goqu.RegisterDialect("sqlserver", DialectOptions()) | ||
} |
Oops, something went wrong.