typed-sql icon indicating copy to clipboard operation
typed-sql copied to clipboard

Is there any way to add sqlx feature?

Open wowiwj opened this issue 4 years ago • 4 comments

The sqlx repo: https://github.com/launchbadge/sqlx For example, use the following methods

let users:Vec<User> = User::query(&conn)
    .filter(|user| user.id.neq(6).and(user.id.gt(3)))
    .order_by(|user| user.name.then(user.id.ascending()))
    .limit(5)
    .get()
    .await?;

wowiwj avatar May 25 '21 14:05 wowiwj

Yeah I think that'd be a great feature. I've done some initial work on this with f7745926a7ba25a97bc50f503012c4cb47a0bd89 which allows this syntax:

let user = User::table().select().fetch_one(&pool).await.unwrap();

More info can be found in the postgres example

matthunz avatar May 25 '21 20:05 matthunz

Wow, that's great. I'm looking forward to it

wowiwj avatar May 26 '21 14:05 wowiwj

Awesome :)

zmilan avatar May 28 '21 18:05 zmilan

Any chance to get a release on crates with the new trait?

jkelleyrtp avatar May 28 '21 20:05 jkelleyrtp