appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Bug]: Sql server OffsetDateTime not supported?

Open pbjorklund opened this issue 3 years ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

Connected Azure SQL server db.

Tried to run a simple select * from users; query.

Got

Java 8 date/time type java.time.OffsetDateTime not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: java.util.ArrayList[0]->java.util.LinkedHashMap["CreatedAt"]->microsoft.sql.DateTimeOffset["offsetDateTime"]) { "requestParams":{...} }

Steps To Reproduce

  1. Create sql server db table with column of datatype datetimeoffset
  2. Try to query data in appsmith

Environment

Production

Version

Self-Hosted

pbjorklund avatar Feb 02 '22 11:02 pbjorklund

Any updates?

pbjorklund avatar Oct 13 '22 10:10 pbjorklund

@pbjorklund thank you for following up, agree that this should just work. Will check with the team and update you here

rohan-arthur avatar Oct 17 '22 12:10 rohan-arthur

Workaround

@pbjorklund This is definitely an issue. The team will look into this and will get back with a permanent solution. To unblock you, can you please try the following query and let us know if this serves the purpose for now?

SELECT 
    CONVERT(varchar(255), your_offset_datetime_column, 127) ts
FROM your_table

subrata71 avatar Oct 17 '22 17:10 subrata71

This is not straightforward to achieve. It will take special handling of the OffsetDateTime to let it be parsed through Jackson. A possible solution could be found in this SO post.

subrata71 avatar Oct 18 '22 07:10 subrata71

Total users of Ms sql in last months : 499 Assuming 10% of users are affected by this, total count : 50

Stats

Stat Values
Reach 50
Effort (months) 0.75

vaibh1297 avatar Dec 19 '22 13:12 vaibh1297

Workaround

@pbjorklund This is definitely an issue. The team will look into this and will get back with a permanent solution. To unblock you, can you please try the following query and let us know if this serves the purpose for now?

SELECT 
    CONVERT(varchar(255), your_offset_datetime_column, 127) ts
FROM your_table

This workaround works for me, thanks

notflip avatar Jan 12 '23 09:01 notflip

Sure, workaround does enable querying.

But means select * will not work for any table in our db since all tables contains offsets.

Will check back in another year or so 👌

pbjorklund avatar Apr 13 '24 06:04 pbjorklund