Skip to content

Custom Valuer interface breaks inter-operability with packages that implement driver.Valuer #4

@NicholasAsimov

Description

@NicholasAsimov

Hi! I'm experiencing a problem with the package where because of the custom Valuer interface, the types that do implement driver.Valuer are not recognized.

For context, I'm using github.com/google/uuid type and since it does implement driver.Valuer interface I expected it to automatically convert to string, so doing something like this would just work:

func myFunc(ctx context.Context, id uuid.UUID) error {
	q := pgq.Update("table").Where(pgq.Eq{"id": id})
}

Is there a reason to not use driver.Valuer interface? It's semantically the same since driver.Valuer is Value() (driver.Value, error) where driver.Value is just an alias to any.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions