cmoog / vscode-sql-notebook

Open SQL files as VSCode Notebooks.
https://marketplace.visualstudio.com/items?itemName=cmoog.sqlnotebook
MIT License
120 stars 16 forks source link

Date values presented as timestamps #58

Closed lorefnon closed 8 months ago

lorefnon commented 1 year ago

Thank you for creating this extension - this is very useful.

One oddity I discovered was that it presents date values as timestamps.

image

In the database (postgres) the column is a date type column so it is confusing that a time component is also being shown here.

Here is the same query result presented in another db interface (beekeeper)

image

There is also some timezone conversion happening due to which the date does not match (my server is in US where as I am running the notebook in India).

cmoog commented 1 year ago

Thanks for this report. I suspect there is a way to discern timestamp vs. date in the types returned by each respective database driver, but it may be tricky because JS only has one native Date type. Either way, we'll need to address this for each underlying driver implementation.

It'll be a bit tedious but nothing difficult. Can likely be fixed by only editing https://github.com/cmoog/vscode-sql-notebook/blob/master/src/driver.ts. If someone wants to pick this up I'll make sure to review quickly and provide feedback / merge when ready.