Closed zgalili closed 1 year ago
thanks a lot for reporting it @zgalili
it seems node sdk is not handling the TIMESTAMP data type
for each row a SQLRowDescription is built at this line: https://github.com/codenotary/immudb-node/blob/6c637cdf358d069fc3aa41cfb0a32f0adab4d53b/src/client.ts#L1709
The value can be any of:
message SQLValue {
oneof value {
google.protobuf.NullValue null = 1;
int64 n = 2;
string s = 3;
bool b = 4;
bytes bs = 5;
int64 ts = 6;
}
}
It'd be super if you can figure it out how to include the TIMESTAMP support there, otherwise we'll be solving asap
closing as immudb-node was updated to v2
Hi :)
I have a
TIMESTAMP
field calledcreated_at
in our db. To populate that field I useCAST(@created_at AS TIMESTAMP)
(orNOW()
) in theINSERT
process.When querying in the
immuclient
I can see the data in that field, it looks like that:2022-06-23 09:04:37
(its not surrounded by"
likeVARCHAR
fields)But I can't find a way to get the data in
Node
, When usingSELECT *
orSELECT created_at
the value I get back isundefined
(for other fields I do get the data, all of them areVARCHAR
fields except the id which isINTEGER
)I've tried to use:
select CAST(created_at AS VARCHAR)
and gotSQLQuery error Error: 2 UNKNOWN: syntax error: unexpected CAST
CONVERT(VARCHAR, created_at)
andselect STR(created_at,10)
and gotSQLQuery error Error: 2 UNKNOWN: syntax error: unexpected '(',
What is the correct way to get the
TIMESTAMP
data back from the db?If this question is not considered as an issue and doesn't belong here, sorry! just point me to the correct place to post this please :)
Thanks a lot, Ziv.