diesel
r2d2
Our great sponsors
diesel | r2d2 | |
---|---|---|
72 | 1 | |
10,501 | 1,278 | |
1.9% | - | |
9.0 | 1.3 | |
9 days ago | 14 days ago | |
Rust | Rust | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
diesel
-
Backend API recommendations
for psql i feel like there's a wealth of things to choose from, like diesel perhaps https://crates.io/crates/diesel
-
Diesel 2.1
Essentially you would need to implement Backend + Connection (+ the whole bunch of helper traits) for this type. That's ~1kloc for all of that. The PR that introduced this feature has more details on the exact implementation that's generated.
-
New Rustacean Looking For Guidance
diesel
-
What ORM do you use?
some things are barely expressible in the type system. For example, window functions are unavailable (the issue is six years old). You can use raw SQL, but then it has the same problems sqlx has
-
Trait object with generic funtion: don't understand how to do it
Have you considered using a library such as sqlx or Diesel? They’ll handle this for you and supports multiple backends
-
Diesel 2.0.4
This is a patch release that contains several bugfixes. Notably it contains a workaround for a name resolution bug in rust-analyzer that affected diesel's DSL. With this rust-analyzer should be able to provide type hints and completions in many more cases than before, although there are still issues with specific constructs including queries containing .filter()/.inner_join() and .left_join() expressions. These are still not recognized correctly by rust-analyzer.
-
How to handle unknown types?
I can provide an example how to handle these kind of setup with diesel: https://github.com/diesel-rs/diesel/blob/master/diesel_dynamic_schema/tests/dynamic_values.rs
-
Why use Rust on the back end?
Please reach out on the diesel discussion forum[1] about the lacking dev experience. I'm happy to discuss these issues and potential solutions there.
-
How to create a web app in Rust with Rocket and Diesel
As is customary for most web frameworks, Rocket allows you to use object-relational mappers (ORMs) as a data access layer for your application. Rocket is ORM agnostic, which means you can use any Rust ORM of your choice to access your database in your Rocket application. In this article, we’ll use Diesel ORM as our ORM of choice as it’s one of the most popular Rust ORMs. At the time of writing, Diesel ORM supports PostgreSQL, MySQL, and SQLite databases.
-
Hey Rustaceans! Got a question? Ask here (10/2023)!
The Diesel getting started guide is explicitly written for using PostgreSQL as your database system. It is using some parts of SQL that are not supported by SQLite. You can follow the equivalent SQLite code by looking at this diesel example. In the concrete case that error is caused by the fact that only quite new SQLite versions support returning clauses. These support is behind an off-by-default feature flag and requires using an up to date SQLite version.
r2d2
-
How to create a connection pool for MongoDB in Rust?
When you look at r2d2 (https://crates.io/crates/r2d2), it says:
What are some alternatives?
sea-orm - 🐚 An async & dynamic ORM for Rust
sqlx - 🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, SQLite, and MSSQL.
rustorm - an orm for rust
rbatis - Rust Compile Time ORM robustness,async, pure Rust Dynamic SQL
redis-rs - Redis library for rust
rusqlite-model - Model trait and derive implementation for rusqlite
deuterium-orm - Fully typed SQL query builder for Rust [deprecated]
rust-postgres - Native PostgreSQL driver for the Rust programming language
tikv - Distributed transactional key-value database, originally created to complement TiDB
quaint - SQL Query AST and Visitor for Rust
prisma-client-rust - Type-safe database access for Rust
rust-mysql-simple - Mysql client library implemented in rust.