Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 1.8% on proxy.golang.org
Top 0.3% dependent packages on proxy.golang.org
Top 0.3% dependent repos on proxy.golang.org
Top 3.8% forks on proxy.golang.org

proxy.golang.org : github.com/DATA-DOG/go-txdb

Package txdb is a single transaction based database/sql/driver implementation. When the connection is opened, it starts a transaction and all operations performed on the returned database/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 a transaction and execute fast. And you do not have to interface your database/sql.DB reference in your code, txdb is like a standard database/sql/driver.Driver. This driver supports any database/sql/driver.Driver connection to be opened. You can register txdb for different 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. Example, assuming you have a mysql database called txdb_test and a table users with a username: Every time you will run this application, it will remain in the same state as before.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/%21d%21a%21t%21a-%21d%21o%21g/go-txdb
Keywords: go, golang, integration-testing, sql, sql-driver, tdd, testing
License: BSD-3-Clause
Latest release: 6 months ago
First release: over 6 years ago
Namespace: github.com/DATA-DOG
Dependent packages: 168
Dependent repositories: 471
Stars: 624 on GitHub
Forks: 47 on GitHub
Total Commits: 40
Committers: 14
Average commits per author: 2.857
Development Distribution Score (DDS): 0.45
More commit stats: commits.ecosyste.ms
See more repository details: repos.ecosyste.ms
Funding links: https://github.com/sponsors/l3pp4rd, https://github.com/sponsors/flimzy, https://github.com/sponsors/Yiling-J
Last synced: about 24 hours ago

    Loading...
    Readme
    Loading...