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

insert Patch strips the first value #4

Closed
myOmikron opened this issue Oct 11, 2022 · 0 comments
Closed

insert Patch strips the first value #4

myOmikron opened this issue Oct 11, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@myOmikron
Copy link
Member

#[derive(Clone, Debug, Patch)]
#[rorm(model = "User")]
pub(crate) struct UserPatch {
    pub(crate) username: String,
    pub(crate) email: String,
    pub(crate) password: String,
}

let u = UserPatch {
    username: "foo".to_string(),
    email: "admin@omikron.dev".to_string(),
    password: "SuperSecurePassword".to_string(),
};

let _ = insert(&db, &u).await;

The resulting query:

INSERT OR ABORT INTO user (username, email, password) VALUES (?, ?);
@myOmikron myOmikron added the bug Something isn't working label Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants