{"repo":"DATA-DOG/go-txdb","free":true,"listed":false,"github":"https://github.com/DATA-DOG/go-txdb","clone":"git clone https://github.com/DATA-DOG/go-txdb.git","description":"Immutable transaction isolated sql driver for golang","language":"Go","stars":751,"topics":["sql-driver","integration-testing","go","golang","tdd","sql","testing"],"license":null,"category":"databases-storage","readme_excerpt":"Single transaction based sql.Driver for GO Package txdb is a single transaction based database sql driver. When the connection is opened, it starts a transaction and all operations performed on this sql.DB will be within that transaction. If concurrent actions are performed, the lock is acquired and connection is always released the statements and rows are not holding the connection. Why is it useful. A very basic use case would be if you want to make functional tests you can prepare a test database and within each test you do not have to reload a database. All tests are isolated within transaction and though, performs fast. And you do not have to interface your sql.DB reference in your code, txdb is like a standard sql.Driver . This driver supports any sql.Driver connection to be opened. You can register txdb for different sql drivers and have it under different driver names. Under the hood whenever a txdb driver is opened, it attempts to open a real connection and starts transaction. When close is called, it rollbacks transaction leaving your prepared test database in the same state as before. Given, you have a mysql database called txdb test and a table users with a username column. You can also use sql.OpenDB (added in Go 1.10) rather than registering a txdb driver instance, if you prefer: Every time you will run this application, it will remain in the same state as before. Testing Usage is mainly intended for testing purposes. Tests require database access, support using","default_branch":null,"files":null,"tree":[],"storefront":"/r/DATA-DOG","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/DATA-DOG/go-txdb/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}