dyedgreen / deno-sqlite

Deno SQLite module
https://deno.land/x/sqlite
MIT License
409 stars 36 forks source link

Need for SQLite date and time functions #29

Closed ricgagliardi closed 4 years ago

ricgagliardi commented 4 years ago

I'm making good progress on a deno/sqlite project, but I need the sqlite date and time functions for me to proceed. For example the following query

select datetime('now', 'localtime') as "start_time"

should return the current timestamp, but it returns a value of null. See this page for details.

I need that before I can continue with my project, but I also found the date and time constants for defaults don't work, eg

create table foo (as_of text default current_date)

or

insert into foo (as_of) values (current_date)

Other than dates, deno-sqlite is working great! Thanks for creating it.

dyedgreen commented 4 years ago

Thanks for opening the issue @ricgagliardi!

Yes, currently the date/ time functions don’t work, due to the way the WASM interfaces with the JS part of the application. I’ll look into possibilities for going around this 😊