NOW() function in kysely
For instance, this statement is valid on Postgres:
INSERT INTO films VALUES ('UA502', 'Bananas', 105, NOW());
I was wondering if there was anyways to achieve the same thing in kysely. Thank you 😄8 Replies
Solution
Ahhh got it! Thank you 🙂
Hi @wirekang, the statement seems to work but I'm getting these error messages. Do you have any ideas getting around that?

You are using intelliJ right?
Yep! Webstorm
Do you think it's an intellij issue?
Intellij-based IDE has a feature that automatically detect SQL string in source codes.
now() is not an valid sql string so intellij shows the error
I see, that makes sense. I'll do a bit of digging. Thanks for your help! 🙏
Yep, it seems that Intellij assumes everything inside a
sql
tag should be a complete SQL statement. now()
is not a complete statement. There's probably some config that'll allow arbitrary expression instead of statements. If not, disable/ignore the whole thing.