Skip to content

Proposal: Define a SQL driver unwrapping method #46

Description

@Julio-Guerra

Hey OpenCesus :-)

I am the lead developer of Sqreen's Go agent, and some users are unfortunately experiencing integration issues when using your driver wrapper ocDriver with our SQL-injection protection.

The problem simply comes from the fact the underlying wrapped driver gets hidden and our SQL dialect detection function no longer gets the underlying driver package path.

Describe the solution you'd like

Simply define a new ocDriver method Unwrap returning the wrapped driver so that we can detect it and unwrap it:

func (d *ocDriver) Unwrap() driver.Driver {
    return d.parent
}

Additional context

As this is a very common issue, I wrote a Go proposal to try to standardize the Unwrapper interface at golang/go#42460

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions