Files
mayfly-go/server/internal/db/dbm/sqlparser/sqlstmt/value.go

24 lines
401 B
Go
Raw Normal View History

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,
}
}