vertica/vertica-sql-go

Implement error struct

prochac opened this issue ยท 3 comments

Other sql drivers returns struct implementing error interface.
Ex.
https://pkg.go.dev/github.com/lib/pq#Error
https://pkg.go.dev/github.com/go-sql-driver/mysql#MySQLError
https://pkg.go.dev/github.com/jackc/pgconn#PgError
https://pkg.go.dev/github.com/denisenkom/go-mssqldb#Error
https://pkg.go.dev/github.com/snowflakedb/gosnowflake#SnowflakeError

Vertica returns pure string Error: [42V01] Relation "my_table" does not exist
The only possible way how to get the error code is parse the string, which is suboptimal.
And Unfortunately it is not possible if errors wrapping is used.