Skip to content

Remove sqlx dependency? #125

@cdevienne

Description

@cdevienne

The only reason sqlx is still a dependency is to be able to use sqlx features on the underlying connection.
I wonder if we could achieve that by optionally injecting the db connection in qb instead of having qb create it, and provide an interface for

For someone wanting to use sqlx features, the engine initialization would look like:

    db, err := sqlx.Connect("postgres", "user=foo dbname=bar sslmode=disable")
    engine, err := qb.NewEngine("postgres", db)

Since we never use Queryx in qb, the only remaining problem would be transaction handling.
We currently have to use db.Beginx() to keep sqlx compat.

I don't see a clean way to handle this for now, but I would prefer such dependencies to be optional.

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