Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

minhajul's avatar

MySQL functions are not supported in SQLite!

I am using MySQL as my primary database and SQLite for testing. Some of the MySQL functions like YEAR, MONTH etc is not supported by SQLite. How you guys are dealing with this sort of issue while testing?

0 likes
4 replies
bobbybouwmann's avatar
Level 88

Switch to mysql? Your tests might be a bit slower, but it will be a more real test since your code will run against the same kind of database. There is no way that this is going to work in SQlite any time soon.

1 like
13's avatar

It's not very good idea to use different databases for testing and for production. You can make a MySQL database for testing in a couple minutes, so why struggling with SQLite?

1 like
siangboon's avatar

Agreed. should stick as close as the production environment for testing if possible...

Please or to participate in this conversation.