-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
I'm working on a library which works with many different SQL drivers and maps to common errors for things like unique constraints etc.
I'd like to avoid having to import go-sqlite3 as it requires cgo so I was wondering whether you'd be open to adding getters for the error which can be used in a more dynamic environment e.g.
// Error implement sqlite error code.
type Error struct {
Code ErrNo /* The error code returned by SQLite */
ExtendedCode ErrNoExtended /* The extended error code returned by SQLite */
SystemErrno syscall.Errno /* The system errno returned by the OS through SQLite, if applicable */
err string /* The error string returned by sqlite3_errmsg(),
this usually contains more specific details. */
}
func (err Error) GetExtendedCode() int {
return int(err.ExtendedCode)
}
That way libraries that need to support go-sqlite3 can do so without relying on the package by simply using an interface.
Metadata
Metadata
Assignees
Labels
No labels