Skip to content

Commit

Permalink
Merge branch 'master' into last-insert-id
Browse files Browse the repository at this point in the history
  • Loading branch information
tyt2y3 authored Oct 12, 2021
2 parents 92795a0 + edc2e65 commit 3fd33ab
Show file tree
Hide file tree
Showing 25 changed files with 45 additions and 16 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
path: [async-std, tokio, actix_example, actix4_example, rocket_example]
path: [basic, actix_example, actix4_example, rocket_example]
steps:
- uses: actions/checkout@v2

Expand All @@ -187,6 +187,28 @@ jobs:
args: >
--manifest-path examples/${{ matrix.path }}/Cargo.toml
issues:
name: Issues
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
path: [86]
steps:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- uses: actions-rs/cargo@v1
with:
command: build
args: >
--manifest-path issues/${{ matrix.path }}/Cargo.toml
sqlite:
name: SQLite
runs-on: ubuntu-20.04
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 0.2.6 - 2021-10-09

- [[#224]] [sea-orm-cli] Date & Time column type mapping
- Escape rust keywords with `r#` raw identifier

[#224]: https://github.com/SeaQL/sea-orm/pull/224

## 0.2.5 - 2021-10-06

- [[#227]] Resolve "Inserting actual none value of Option<Date> results in panic"
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = [".", "sea-orm-macros", "sea-orm-codegen"]

[package]
name = "sea-orm"
version = "0.2.5"
version = "0.2.6"
authors = ["Chris Tsang <[email protected]>"]
edition = "2018"
description = "🐚 An async & dynamic ORM for Rust"
Expand All @@ -29,7 +29,7 @@ futures = { version = "^0.3" }
futures-util = { version = "^0.3" }
log = { version = "^0.4", optional = true }
rust_decimal = { version = "^1", optional = true }
sea-orm-macros = { version = "^0.2.5", path = "sea-orm-macros", optional = true }
sea-orm-macros = { version = "^0.2.6", path = "sea-orm-macros", optional = true }
sea-query = { version = "^0.17.1", features = ["thread-safe"] }
sea-strum = { version = "^0.21", features = ["derive", "sea-orm"] }
serde = { version = "^1.0", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
SeaORM is a relational ORM to help you build light weight and concurrent web services in Rust.

[![Getting Started](https://img.shields.io/badge/Getting%20Started-brightgreen)](https://www.sea-ql.org/SeaORM/docs/index)
[![Usage Example](https://img.shields.io/badge/Usage%20Example-yellow)](https://github.com/SeaQL/sea-orm/tree/master/examples/async-std)
[![Usage Example](https://img.shields.io/badge/Usage%20Example-yellow)](https://github.com/SeaQL/sea-orm/tree/master/examples/basic)
[![Actix Example](https://img.shields.io/badge/Actix%20Example-blue)](https://github.com/SeaQL/sea-orm/tree/master/examples/actix_example)
[![Rocket Example](https://img.shields.io/badge/Rocket%20Example-orange)](https://github.com/SeaQL/sea-orm/tree/master/examples/rocket_example)
[![Discord](https://img.shields.io/discord/873880840487206962?label=Discord)](https://discord.com/invite/uCPdDXzbdv)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions sea-orm-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[package]
name = "sea-orm-cli"
version = "0.2.5"
version = "0.2.6"
authors = [ "Billy Chan <[email protected]>" ]
edition = "2018"
description = "Command line utility for SeaORM"
Expand All @@ -21,7 +21,7 @@ path = "src/main.rs"
clap = { version = "^2.33.3" }
dotenv = { version = "^0.15" }
async-std = { version = "^1.9", features = [ "attributes" ] }
sea-orm-codegen = { version = "^0.2.5", path = "../sea-orm-codegen" }
sea-orm-codegen = { version = "^0.2.6", path = "../sea-orm-codegen" }
sea-schema = { version = "^0.2.9", default-features = false, features = [
"debug-print",
"sqlx-mysql",
Expand Down
2 changes: 1 addition & 1 deletion sea-orm-codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sea-orm-codegen"
version = "0.2.5"
version = "0.2.6"
authors = ["Billy Chan <[email protected]>"]
edition = "2018"
description = "Code Generator for SeaORM"
Expand Down
2 changes: 1 addition & 1 deletion sea-orm-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sea-orm-macros"
version = "0.2.5"
version = "0.2.6"
authors = [ "Billy Chan <[email protected]>" ]
edition = "2018"
description = "Derive macros for SeaORM"
Expand Down
12 changes: 6 additions & 6 deletions src/entity/active_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,23 +239,23 @@ where
matches!(self.state, ActiveValueState::Unset)
}

pub fn take(&mut self) -> V {
pub fn take(&mut self) -> Option<V> {
self.state = ActiveValueState::Unset;
self.value.take().unwrap()
self.value.take()
}

pub fn unwrap(self) -> V {
self.value.unwrap()
}

pub fn into_value(self) -> Value {
self.value.unwrap().into()
pub fn into_value(self) -> Option<Value> {
self.value.map(Into::into)
}

pub fn into_wrapped_value(self) -> ActiveValue<Value> {
match self.state {
ActiveValueState::Set => ActiveValue::set(self.into_value()),
ActiveValueState::Unchanged => ActiveValue::unchanged(self.into_value()),
ActiveValueState::Set => ActiveValue::set(self.into_value().unwrap()),
ActiveValueState::Unchanged => ActiveValue::unchanged(self.into_value().unwrap()),
ActiveValueState::Unset => ActiveValue::unset(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
//! SeaORM is a relational ORM to help you build light weight and concurrent web services in Rust.
//!
//! [![Getting Started](https://img.shields.io/badge/Getting%20Started-brightgreen)](https://www.sea-ql.org/SeaORM/docs/index)
//! [![Usage Example](https://img.shields.io/badge/Usage%20Example-yellow)](https://github.com/SeaQL/sea-orm/tree/master/examples/async-std)
//! [![Usage Example](https://img.shields.io/badge/Usage%20Example-yellow)](https://github.com/SeaQL/sea-orm/tree/master/examples/basic)
//! [![Actix Example](https://img.shields.io/badge/Actix%20Example-blue)](https://github.com/SeaQL/sea-orm/tree/master/examples/actix_example)
//! [![Rocket Example](https://img.shields.io/badge/Rocket%20Example-orange)](https://github.com/SeaQL/sea-orm/tree/master/examples/rocket_example)
//! [![Discord](https://img.shields.io/discord/873880840487206962?label=Discord)](https://discord.com/invite/uCPdDXzbdv)
Expand Down
2 changes: 1 addition & 1 deletion src/query/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ where
}
if av_has_val {
columns.push(col);
values.push(av.into_value());
values.push(av.into_value().unwrap());
}
}
self.query.columns(columns);
Expand Down

0 comments on commit 3fd33ab

Please sign in to comment.