mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-06 01:10:26 +08:00
24 lines
401 B
Go
24 lines
401 B
Go
package sqlstmt
|
|
|
|
import "strings"
|
|
|
|
type IdentifierValue struct {
|
|
Value string
|
|
QuoteChar *QuoteChar
|
|
}
|
|
|
|
func NewIdentifierValue(value string) *IdentifierValue {
|
|
value = strings.TrimPrefix(value, ".")
|
|
qc := GetQuoteChar(value)
|
|
if qc == NONE {
|
|
return &IdentifierValue{
|
|
Value: value,
|
|
QuoteChar: qc,
|
|
}
|
|
}
|
|
return &IdentifierValue{
|
|
Value: qc.Unwrap(value),
|
|
QuoteChar: qc,
|
|
}
|
|
}
|