Welcome Guest, Not a member yet? Register   Sign In
Testing: Database refresh and migrations

And it was merged in. Just a couple of thoughts since I didn't get to respond here prior to seeing it on GitHub.

SQLite in-memory databases make a huge performance difference, and I believe the handler is compatible in almost all cases with CI core database functionality - even foreign keys if you have a new enough version. Granted - if you need MySQL or Postgres -specific queries, you're boned. Smile

I've also seen it done where you wrap everything within each test in a transaction and rollback the transaction at the end of the test. That does speed things up, but I've ran into issues testing things in the database within the tests itself since the transaction was never finalized. So, not something I love but it can have it's uses.

Messages In This Thread
RE: Testing: Database refresh and migrations - by kilishan - 07-06-2020, 08:15 PM

Theme © iAndrew 2016 - Forum software by © MyBB