Top 1.6% dependent packages on proxy.golang.org
Top 2.0% dependent repos on proxy.golang.org
Top 8.8% forks on proxy.golang.org
proxy.golang.org : github.com/go-mysql/errors
Package errors provides functions and variables for handling common MySQL errors. Common errors are: connection-related, duplicate key, and read-only. These should be explicitly handled to allow retrying when possible (connection and read-only errors) and returning a better error to the caller (duplicate key). Handling these errors directly is not trivial. It requires low-level knowledge and experience with sql/database, github.com/go-sql-driver/mysql, and MySQL. See the implementation of Lost, for example. More importantly: these are implementation details which should not be leaked to the caller. The caller usually only needs to know if the connection was lost or MySQL is read-only (so it wait and retry), or if there was a duplicate key error (which may be an error to the user or something the caller expects and handles). This packages makes handling these errors easy. See https://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html for a complete list of MySQL server errors. The vast majority are rarely encountered in typical, well-behaved systems. Error and CanRetry are the most important functions in this package. They are used like: The example above tries N-many times to save an item into a database. It handles MySQL errors explicitly. On ErrDupeKey it does not retry, it returns HTTP 409 (status conflict). Else if the error is transient, it waits 1 second and retries. All other errors cause an HTTP 500 (internal server error) return.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/go-mysql/errors
Keywords:
error-handling
, mysql
License: GPL-3.0
Latest release: almost 7 years ago
First release: almost 7 years ago
Namespace: github.com/go-mysql
Dependent packages: 12
Dependent repositories: 7
Stars: 5 on GitHub
Forks: 4 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: about 1 month ago
github.com/tango992/perang-kode v0.1.3
Disusun sebagai milestone FTGO P14 versions - Latest release: over 1 year ago - 0 stars on GitHub
github.com/Tango992/perang-kode v0.1.3
Disusun sebagai milestone FTGO P14 versions - Latest release: over 1 year ago - 0 stars on GitHub
github.com/square/finch v0.0.0-20230816173142-e72f5b0b346c
MySQL Benchmarking: Declarative, Distributed, and Amazing1 version - Latest release: almost 2 years ago - 9 stars on GitHub
github.com/mohammaderm/todoMicroService/todoService v0.0.0-20221121120643-3ec38caa5a09
1 version - Latest release: over 2 years ago - 1 dependent repositories - 0 stars on GitHubgithub.com/mohammaderm/todoservice v0.0.2 removed
2 versions - Latest release: over 2 years agogithub.com/mohammaderm/todoService v0.0.2
2 versions - Latest release: over 2 years agogithub.com/RBucket-Org/RB-Utils v0.0.0-20220526082320-ac058c769ff9
All the utility code for RBucket1 version - Latest release: almost 3 years ago - 0 stars on GitHub
github.com/sunny-b/gomigrate v0.0.1
Execute your database migrations as code. A tool for executing database migrations in Golang.1 version - Latest release: over 3 years ago - 2 stars on GitHub
github.com/cenkalti/dalga/v4 v4.0.1
⏰ MySQL backed Job Scheduler with a HTTP interface2 versions - Latest release: about 4 years ago - 241 stars on GitHub
github.com/cenkalti/dalga/v3 v3.1.3
⏰ MySQL backed Job Scheduler with a HTTP interface23 versions - Latest release: about 4 years ago - 241 stars on GitHub
Check this option to include packages that no longer depend on this package in their latest version but previously did.