Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow hstore in query! macro #3488

Closed
ibotty opened this issue Sep 5, 2024 · 1 comment · Fixed by #3514
Closed

allow hstore in query! macro #3488

ibotty opened this issue Sep 5, 2024 · 1 comment · Fixed by #3514
Labels
db:postgres Related to PostgreSQL E-easy enhancement New feature or request good first issue Good for newcomers macros

Comments

@ibotty
Copy link

ibotty commented Sep 5, 2024

With mytable as CREATE TABLE mytable(f HSTORE) the following query! invocation fails with
error: unsupported type hstore for param #1.

let query = query!(
    "INSERT INTO mytable(f) VALUE ($1);",
    PgHstore::new()
);

I assume that's because https://github.com/launchbadge/sqlx/blob/main/sqlx-postgres/src/type_checking.rs#L10-L213 does not contain PgHstore.

@ibotty ibotty added the enhancement New feature or request label Sep 5, 2024
@ibotty ibotty changed the title allow hstore is query! macro allow hstore in query! macro Sep 5, 2024
@abonander abonander added db:postgres Related to PostgreSQL macros good first issue Good for newcomers E-easy labels Sep 20, 2024
@abonander
Copy link
Collaborator

abonander commented Sep 20, 2024

This should be pretty easy if someone wants to try their hand at it.

At its simplest, yes, it would just involve adding it to that list. Also Vec<PgHstore> | &[PgHstore] to support HSTORE[].

Actually testing that it works with the macros would be nice to have as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db:postgres Related to PostgreSQL E-easy enhancement New feature or request good first issue Good for newcomers macros
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants