Closed holmofy closed 10 months ago
Why wouldn't you use raw queries for those?
You're not trying to ORM map an object when you do count(*) - you just need to map it to a number.
For exists, I think fetch_optional does the behavior you're describing. Or are you referring to SQL keyword EXISTS somehow?
--
You've opened a number of issues that are effectively Q&A tickets. I encourage you to think through how to solve problems yourself. If you've already done that, your write ups do not indicate that. If you need additional help, there are general Rust discords, and a sqlx one. I'm happy to answer questions time permitting, but I'll close future issues without comment if, for bug reports, they don't have repro steps, or for feature requests, aren't clearly well thought out, with alternatives considered, prior art discussion, trade off discussion, etc.
I'm new to rust and just started learning rust in the last few weeks. I found ormlite, an ORM library based on sqlx. I think ormlite is the best library I've found this week. Therefore, I hope it can provide more and better APIs so that more people can use and improve this library. I'm very sorry if these issues I raised have caused trouble to you. I will not open any issues in the future.
The current select query only supports querying all columns, which is very monotonous.
It would be perfect if this library could provide
count
andexists
APIs. count query and exists query are also very common query scenarios, it will be very convenient to build where clause through SelectQueryBuilder.