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

Suggestion: Add jsonb support #41

Open
jacob-pro opened this issue Dec 26, 2021 · 3 comments
Open

Suggestion: Add jsonb support #41

jacob-pro opened this issue Dec 26, 2021 · 3 comments

Comments

@jacob-pro
Copy link

jacob-pro commented Dec 26, 2021

Thanks for this great crate!

Currently this generates:

#[derive(Queryable, Debug, Identifiable)]
#[primary_key(key)]
pub struct Setting {
    pub key: String,
    pub value: Jsonb,
}

for:

table! {
    settings (key) {
        key -> Varchar,
        value -> Jsonb,
    }
}

which doesn't compile because Jsonb isn't imported.

It would be great if it instead generated the correct serde type

#[derive(Queryable, Debug, Identifiable)]
#[primary_key(key)]
pub struct Setting {
    pub key: String,
    pub value: serde_json::Value,
}
@abbychau
Copy link
Owner

added. will be released in the next version. (>= 0.3.8)

@abbychau
Copy link
Owner

@jacob-pro 0.3.9 released . it should contains the above feat.

@jacob-pro
Copy link
Author

thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants