feat: upgrade to Rust 1.86 and edition 2024
Upgrades rust toolchain from 1.84 to 1.86, switches to Rust edition 2024, and updates dependencies including SQLx to 0.8.6.
This commit is contained in:
parent
ea89fab0e8
commit
298d3b28a7
464
Cargo.lock
generated
464
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@ members = [".", "georm-macros"]
|
|||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2024"
|
||||||
authors = ["Lucien Cartier-Tilet <lucien@phundrak.com>"]
|
authors = ["Lucien Cartier-Tilet <lucien@phundrak.com>"]
|
||||||
homepage = "https://github.com/Phundrak/georm"
|
homepage = "https://github.com/Phundrak/georm"
|
||||||
repository = "https://github.com/Phundrak/georm"
|
repository = "https://github.com/Phundrak/georm"
|
||||||
@ -26,7 +26,7 @@ version.workspace = true
|
|||||||
georm-macros = { version = "=0.1.1", path = "georm-macros" }
|
georm-macros = { version = "=0.1.1", path = "georm-macros" }
|
||||||
|
|
||||||
[workspace.dependencies.sqlx]
|
[workspace.dependencies.sqlx]
|
||||||
version = "0.8.3"
|
version = "0.8.6"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["postgres", "runtime-tokio", "macros", "migrate"]
|
features = ["postgres", "runtime-tokio", "macros", "migrate"]
|
||||||
|
|
||||||
|
26
README.md
26
README.md
@ -52,7 +52,7 @@ Add Georm and SQLx to your `Cargo.toml`:
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "postgres", "macros"] }
|
sqlx = { version = "0.8.6", features = ["runtime-tokio-rustls", "postgres", "macros"] }
|
||||||
georm = "0.1"
|
georm = "0.1"
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ CREATE TABLE posts (
|
|||||||
```rust
|
```rust
|
||||||
use georm::Georm;
|
use georm::Georm;
|
||||||
|
|
||||||
#[derive(sqlx::FromRow, Georm)]
|
#[derive(Georm)]
|
||||||
#[georm(table = "authors")]
|
#[georm(table = "authors")]
|
||||||
pub struct Author {
|
pub struct Author {
|
||||||
#[georm(id)]
|
#[georm(id)]
|
||||||
@ -91,7 +91,7 @@ pub struct Author {
|
|||||||
pub email: String,
|
pub email: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(sqlx::FromRow, Georm)]
|
#[derive(Georm)]
|
||||||
#[georm(table = "posts")]
|
#[georm(table = "posts")]
|
||||||
pub struct Post {
|
pub struct Post {
|
||||||
#[georm(id)]
|
#[georm(id)]
|
||||||
@ -153,7 +153,7 @@ async fn example(pool: &PgPool) -> sqlx::Result<()> {
|
|||||||
For fields with database defaults or auto-generated values, use the `defaultable` attribute:
|
For fields with database defaults or auto-generated values, use the `defaultable` attribute:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#[derive(sqlx::FromRow, Georm)]
|
#[derive(Georm)]
|
||||||
#[georm(table = "posts")]
|
#[georm(table = "posts")]
|
||||||
pub struct Post {
|
pub struct Post {
|
||||||
#[georm(id, defaultable)]
|
#[georm(id, defaultable)]
|
||||||
@ -192,7 +192,7 @@ Georm supports comprehensive relationship modeling with two approaches: field-le
|
|||||||
Use the `relation` attribute on foreign key fields to generate lookup methods:
|
Use the `relation` attribute on foreign key fields to generate lookup methods:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#[derive(sqlx::FromRow, Georm)]
|
#[derive(Georm)]
|
||||||
#[georm(table = "posts")]
|
#[georm(table = "posts")]
|
||||||
pub struct Post {
|
pub struct Post {
|
||||||
#[georm(id)]
|
#[georm(id)]
|
||||||
@ -214,7 +214,7 @@ pub struct Post {
|
|||||||
For nullable relationships:
|
For nullable relationships:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#[derive(sqlx::FromRow, Georm)]
|
#[derive(Georm)]
|
||||||
#[georm(table = "posts")]
|
#[georm(table = "posts")]
|
||||||
pub struct Post {
|
pub struct Post {
|
||||||
#[georm(id)]
|
#[georm(id)]
|
||||||
@ -239,7 +239,7 @@ Define relationships at the struct level to query related entities that referenc
|
|||||||
##### One-to-One Relationships
|
##### One-to-One Relationships
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#[derive(sqlx::FromRow, Georm)]
|
#[derive(Georm)]
|
||||||
#[georm(
|
#[georm(
|
||||||
table = "users",
|
table = "users",
|
||||||
one_to_one = [{
|
one_to_one = [{
|
||||||
@ -261,7 +261,7 @@ pub struct User {
|
|||||||
##### One-to-Many Relationships
|
##### One-to-Many Relationships
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#[derive(sqlx::FromRow, Georm)]
|
#[derive(Georm)]
|
||||||
#[georm(
|
#[georm(
|
||||||
table = "authors",
|
table = "authors",
|
||||||
one_to_many = [{
|
one_to_many = [{
|
||||||
@ -311,7 +311,7 @@ CREATE TABLE book_genres (
|
|||||||
```
|
```
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#[derive(sqlx::FromRow, Georm)]
|
#[derive(Georm)]
|
||||||
#[georm(
|
#[georm(
|
||||||
table = "books",
|
table = "books",
|
||||||
many_to_many = [{
|
many_to_many = [{
|
||||||
@ -332,7 +332,7 @@ pub struct Book {
|
|||||||
pub title: String,
|
pub title: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(sqlx::FromRow, Georm)]
|
#[derive(Georm)]
|
||||||
#[georm(
|
#[georm(
|
||||||
table = "genres",
|
table = "genres",
|
||||||
many_to_many = [{
|
many_to_many = [{
|
||||||
@ -377,7 +377,7 @@ pub struct Genre {
|
|||||||
Here's a comprehensive example showing multiple relationship types:
|
Here's a comprehensive example showing multiple relationship types:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#[derive(sqlx::FromRow, Georm)]
|
#[derive(Georm)]
|
||||||
#[georm(
|
#[georm(
|
||||||
table = "posts",
|
table = "posts",
|
||||||
one_to_many = [{
|
one_to_many = [{
|
||||||
@ -526,7 +526,7 @@ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) f
|
|||||||
|
|
||||||
#### Prerequisites
|
#### Prerequisites
|
||||||
|
|
||||||
- **Rust 1.81+**: Georm uses modern Rust features and follows the MSRV specified in `rust-toolchain.toml`
|
- **Rust 1.86+**: Georm uses modern Rust features and follows the MSRV specified in `rust-toolchain.toml`
|
||||||
- **PostgreSQL 12+**: Required for running tests and development
|
- **PostgreSQL 12+**: Required for running tests and development
|
||||||
- **Git**: For version control
|
- **Git**: For version control
|
||||||
- **Jujutsu**: For version control (alternative to Git)
|
- **Jujutsu**: For version control (alternative to Git)
|
||||||
@ -641,7 +641,7 @@ direnv allow
|
|||||||
```
|
```
|
||||||
|
|
||||||
The devenv configuration provides:
|
The devenv configuration provides:
|
||||||
- Exact Rust version (1.81) with required components
|
- Exact Rust version (1.86) with required components
|
||||||
- All development tools (just, cargo-deny, sqlx-cli, bacon)
|
- All development tools (just, cargo-deny, sqlx-cli, bacon)
|
||||||
- LSP support (rust-analyzer)
|
- LSP support (rust-analyzer)
|
||||||
- SQL tooling (sqls for SQL language server)
|
- SQL tooling (sqls for SQL language server)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Do not increase during a minor/patch release cycle
|
# Do not increase during a minor/patch release cycle
|
||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.81"
|
channel = "1.86"
|
||||||
profile = "minimal"
|
profile = "minimal"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user