Closed olablt closed 1 year ago
Unfortunately there is no native C API function in DuckDB to append a decimal. But you could try using Float64 if that fits you precision needs.
val := duckdb.Decimal{Value: big.NewInt(123), Width: 3, Scale: 2}
err = appender.AppendRow(
nil, // ID is auto-incremented
time, // time
val.Float64(), // price
)
Unfortunately there is no native C API function in DuckDB to append a decimal. But you could try using Float64 if that fits you precision needs.
I wonder, how appender even got created in first place. I get error earlier, when constructing appender:
database/sql/driver: could not create appender: unsupported data type: DECIMAL: column index: 2
exit status 1
I am new in golang with databases. Trying to use appender to append to table with auto incremented ID and decimal data. Currently I am storing my data in decimal.Decimal format and in this example converting these to duckdb.Decimal.
error:
program: