Skip to content

Add strict mode - Treating warnings as errors #40

Closed
@xaprb

Description

@xaprb

Go doesn't offer a way to see if the statement produced warnings (as far as I know). I thought about some way to access it but it doesn't seem possible through standard database/sql.

Could we have a setting that treats warnings as errors? This would be something I'd enable in development to help avoid writing code that may cause problems. The driver would need to check for warnings after every statement. This data is transmitted in the protocol; it doesn't require a SHOW WARNINGS statement. If there are warnings, a SHOW WARNINGS LIMIT 1 would get the first one, and the driver could return something like "statement caused $N warnings: $first_warning".

Thoughts?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions