Repository navigation
Add Expression::exprNow() support for all DB platforms - #1311
Conversation
|
I have looked into this - there is no functional test - please add one into I would like to have both the SQL query/string and the result (matching format) asserted for every database. Preferably with at least 6/microseconds precision. The format should be unified for all DB vendors and parsable using regular DBAL |
| ]); | ||
| } | ||
|
|
||
| public function testExprNow(): void |
There was a problem hiding this comment.
In SelectTest there should be no Model/DBAL (typecasting) usage.
Test here somethings like "SELECT $e->exprNow()". You can you $this->debug = true; for debugging the sent queries.
Once you get results/formats you want, assert the sent query, see JSON testing for example, you will have to expect different strings for some engines.
Once you have this raw querying working, only then bother with Model/DBAL, otherwise you will have too many layers to debug at once.
|
Looks like DBAL itself is quite broken with DATETIME and microseconds. Some engines partly support that, migrator mostly don't support and ... well, it's mostly DBAL which strips |
|
The DBAL limitation is tracked in #1313. Easy to fix in DBAL, but quite hard to fix in atk4/data. I have not enough time to support DBAL workarounds for everything... This PR is hovewer perfect itself and once the tests are green I will merge it. Thank you for all the great ideas ❤, I basically only reviewed them ;-) |
bd713fe to
6251004
Compare
6251004 to
0c5f900
Compare
0c5f900 to
f72e66f
Compare
f72e66f to
67189d5
Compare
67189d5 to
c2c0de4
Compare
|
Thank you, great contibution! |
|
@DarkSide666 one question, what is your exact usecase? |
|
I've hit it in one small internal app my colleague is developing and I was reviewing. Thank you for your help! We both spent a lot of time on this :) |
No description provided.