Got it, I will just resort to commenting out the rollback code when I want the data to be visible in my SQL editor. Not elegant but it works.
On Thursday, May 28, 2020 at 6:01:16 PM UTC+3, Jeremy Evans wrote: > > On Thursday, May 28, 2020 at 7:46:21 AM UTC-7, Aryk Grosz wrote: >> >> Many times in test cases, I use "byebug" and stop code execution. I want >> to be able to run sql queries on my sql editor to see what data it's >> returning. >> >> However I have things set up to roll back my queries like this: >> >> Database.connection.transaction(rollback: :always) do >> super(&block) >> end >> >> How can I push data to the database so that it is queryable mid test? >> > > You would have to ensure that you are using the same connection that the > transaction used. If you are using a separate program to run the queries, > that's basically impossible. You will have to switch back to > non-transactional testing in this case. > > Thanks, > Jeremy > -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/a7d80883-203b-416e-8b13-55bec9c5cad1%40googlegroups.com.
