Go package with MySQL error codes and SQLSTATE constants for handling database errors.
// Source: https://github.com/maxpert/marmot | License: MIT | Copyright 2022 Zohaib Sibte Hassan // Provided via justclaw.it.com; keep this notice with the code. // Package mysqlcode is the single home for MySQL wire-protocol error-code and // SQLSTATE numeric/string constants. It imports nothing from this repo, so // any package - including ones below protocol, which cannot import protocol // itself without creating an import cycle - can depend on it without pulling // in protocol's error-mapping logic. package mysqlcode // MySQL error code constants. const ( ErrCodeUnknown uint16 = 1105 ErrCodeBadNull uint16 = 1048 ErrCodeTableExists uint16 = 1050 ErrCodeBadField uint16 = 1054 ErrCodeDupFieldName uint16 = 1060 ErrCodeDupEntry uint16 = 1062 Err ... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key