mirror of
https://github.com/nxshock/mssqlbulkloader.git
synced 2024-11-28 00:21:03 +05:00
Implement money type as numeric field
This commit is contained in:
parent
92f089b828
commit
ab95f49c96
@ -41,7 +41,7 @@ func (ft FieldType) ParseValue(reader Reader, s string) (any, error) {
|
|||||||
return s, nil
|
return s, nil
|
||||||
case Integer:
|
case Integer:
|
||||||
return strconv.ParseInt(s, 10, 64)
|
return strconv.ParseInt(s, 10, 64)
|
||||||
case Float:
|
case Float, Money:
|
||||||
return strconv.ParseFloat(strings.ReplaceAll(s, ",", "."), 64)
|
return strconv.ParseFloat(strings.ReplaceAll(s, ",", "."), 64)
|
||||||
case Date:
|
case Date:
|
||||||
if i, ok := reader.(CustomDateParser); ok {
|
if i, ok := reader.(CustomDateParser); ok {
|
||||||
@ -77,7 +77,7 @@ func (ft FieldType) SqlFieldType() string {
|
|||||||
case Float:
|
case Float:
|
||||||
return "float"
|
return "float"
|
||||||
case Money:
|
case Money:
|
||||||
panic("do not implemented - see https://github.com/denisenkom/go-mssqldb/issues/460") // TODO: https://github.com/denisenkom/go-mssqldb/issues/460
|
return "numeric(15, 2)" // TODO: https://github.com/denisenkom/go-mssqldb/issues/460
|
||||||
case Date:
|
case Date:
|
||||||
return "date"
|
return "date"
|
||||||
case Timestamp:
|
case Timestamp:
|
||||||
|
Loading…
Reference in New Issue
Block a user