mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-30 11:26:35 +08:00
feat: i18n
This commit is contained in:
@@ -11,6 +11,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const Quoter = "`"
|
||||
|
||||
type MysqlDialect struct {
|
||||
dbi.DefaultDialect
|
||||
|
||||
@@ -188,8 +190,16 @@ func (md *MysqlDialect) genColumnBasicSql(column dbi.Column) string {
|
||||
return columnSql
|
||||
}
|
||||
|
||||
func (md *MysqlDialect) GetIdentifierQuoteString() string {
|
||||
return "`"
|
||||
func (dx *MysqlDialect) QuoteIdentifier(name string) string {
|
||||
end := strings.IndexRune(name, 0)
|
||||
if end > -1 {
|
||||
name = name[:end]
|
||||
}
|
||||
return Quoter + strings.Replace(name, Quoter, Quoter+Quoter, -1) + Quoter
|
||||
}
|
||||
|
||||
func (dx *MysqlDialect) RemoveQuote(name string) string {
|
||||
return strings.ReplaceAll(name, Quoter, "")
|
||||
}
|
||||
|
||||
func (md *MysqlDialect) QuoteLiteral(literal string) string {
|
||||
|
||||
Reference in New Issue
Block a user