Don't test with SQLite when you use Postgres in Production
michael.robellard.com
Don't test with SQLite when you use Postgres in Production
1–10 of 110 posts
Re: Don't test with SQLite when you use Postgres in Production
#2Re: Don't test with SQLite when you use Postgres in Production
#3What about if you're using an ORM, wouldn't that fix the issues mentioned?
Re: Don't test with SQLite when you use Postgres in Production
#4What about if you're using an ORM, wouldn't that fix the issues mentioned?
Re: Don't test with SQLite when you use Postgres in Production
#5What about if you're using an ORM, wouldn't that fix the issues mentioned?
For example this query is invalid with HQL
SELECT p FROM person p INNER JOIN Invitation i ON i.email LIKE p.email
And that is one of MANY gotchas. Hibernate has it advantages though, especially when it comes to developer productivity. But JDBC is needed for some edge cases.
I often use Groovy SQL instead of using JDBC, comes with excellent transaction support and helps simplifying you DB specific code so it makes sense for newcomers too.
Re: Don't test with SQLite when you use Postgres in Production
#6And yes, you can do CTEs in SQLite but that's besides the point.
Re: Don't test with SQLite when you use Postgres in Production
#7Re: Don't test with SQLite when you use Postgres in Production
#8- It's a relatively simple app - You're using an ORM - You aren't using any advanced SQL features - It's only to make local development easier - There's still a full CI test run with your production database
That said, if your test suite is large enough that database performance is an issue during testing then either your app is too complex for the above to apply, or you are probably doing something else wrong.
Re: Don't test with SQLite when you use Postgres in Production
#9What about if you're using an ORM, wouldn't that fix the issues mentioned?
An ORM may allow you to pass through queries or other directives that have DBMS specific behaviours so if you use any features like that the ORM can't protect you at all. Further more the ORM might change the way it talks to the underlying DB depending on what it is, to make use of efficiency enhancing features that one DB has but others may not, again you are not testing like-for-like in this case. The ORM itself may have bugs that are only apparent when exposed to a given DB.
An ORM often protects you from needing to know the specifics of the storage engine underneath, but you still need to test against the same storage engine(s) as you expect to see in production.
Re: Don't test with SQLite when you use Postgres in Production
#10https://gist.github.com/tobiasviehweger/cbfd9a1a55bff0862f9e