buggins / ddbc

DDBC is DB Connector for D language (similar to JDBC)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sqlitedriver should handle NOW as a datetime format

SingingBush opened this issue · comments

using SQLite it should be possible to insert NOW as a datetime value and have the code do:

immutable SysTime now = Clock.currTime();
return DateTime(now.year, now.month, now.day, now.hour, now.minute, now.second);

Am going to undo some of these changes. Whilst UPDATE user SET created=DATETIME('NOW') WHERE id=1; is valid, UPDATE user SET created=NOW WHERE id=1; is not. Besides when writing the SQL we can still use the better UPDATE user SET created=CURRENT_TIMESTAMP WHERE id=1;