* fix typos

* CHANGELOG

---------

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
This commit is contained in:
Alvaro Parker 2024-10-04 05:42:52 -03:00 committed by GitHub
parent ed77b64d88
commit bfd21e92e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 46 additions and 42 deletions

View File

@ -20,6 +20,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
* Upgrade `sea-schema` to `0.16.0-rc` https://github.com/SeaQL/sea-orm/pull/2305 * Upgrade `sea-schema` to `0.16.0-rc` https://github.com/SeaQL/sea-orm/pull/2305
* Upgrade `ouroboros` to `0.18` https://github.com/SeaQL/sea-orm/pull/2353 * Upgrade `ouroboros` to `0.18` https://github.com/SeaQL/sea-orm/pull/2353
### House keeping
* Fix typos https://github.com/SeaQL/sea-orm/pull/2360
## 1.0.1 - 2024-08-26 ## 1.0.1 - 2024-08-26
### New Features ### New Features

View File

@ -72,7 +72,7 @@ If you have built an app using SeaORM and want to showcase it, feel free to open
#### Url Shortener #### Url Shortener
- [Dinoly](https://github.com/ippsav/Dinoly) | An url shortener using Axum web framework and SeaORM | DB: Postgres - [Dinoly](https://github.com/ippsav/Dinoly) | An url shortener using Axum web framework and SeaORM | DB: Postgres
- [SlashURL](https://github.com/henriquekirchheck/slashurl) | A url shortener using Rust designed to be implemented anywere | DB: PostgreSQL - [SlashURL](https://github.com/henriquekirchheck/slashurl) | A url shortener using Rust designed to be implemented anywhere | DB: PostgreSQL
- [url_shortener](https://github.com/michidk/url_shortener) | A simple self-hosted URL shortener written in Rust | DB: MySQL, Postgres, SQLite - [url_shortener](https://github.com/michidk/url_shortener) | A simple self-hosted URL shortener written in Rust | DB: MySQL, Postgres, SQLite
#### Desktop / CLI Apps #### Desktop / CLI Apps

View File

@ -139,7 +139,7 @@ async fn create_post(
let data = FlashData { let data = FlashData {
kind: "success".to_owned(), kind: "success".to_owned(),
message: "Post succcessfully added".to_owned(), message: "Post successfully added".to_owned(),
}; };
Ok(post_response(&mut cookies, data)) Ok(post_response(&mut cookies, data))
@ -179,7 +179,7 @@ async fn update_post(
let data = FlashData { let data = FlashData {
kind: "success".to_owned(), kind: "success".to_owned(),
message: "Post succcessfully updated".to_owned(), message: "Post successfully updated".to_owned(),
}; };
Ok(post_response(&mut cookies, data)) Ok(post_response(&mut cookies, data))
@ -196,7 +196,7 @@ async fn delete_post(
let data = FlashData { let data = FlashData {
kind: "success".to_owned(), kind: "success".to_owned(),
message: "Post succcessfully deleted".to_owned(), message: "Post successfully deleted".to_owned(),
}; };
Ok(post_response(&mut cookies, data)) Ok(post_response(&mut cookies, data))

View File

@ -18,7 +18,7 @@ find all fruits: SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fr
Model { id: 1, name: "Blueberry", cake_id: Some(1) } Model { id: 1, name: "Blueberry", cake_id: Some(1) }
Model { id: 2, name: "Rasberry", cake_id: Some(1) } Model { id: 2, name: "Raspberry", cake_id: Some(1) }
Model { id: 3, name: "Strawberry", cake_id: Some(2) } Model { id: 3, name: "Strawberry", cake_id: Some(2) }
@ -48,7 +48,7 @@ find models belong to: SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FR
Model { id: 1, name: "Blueberry", cake_id: Some(1) } Model { id: 1, name: "Blueberry", cake_id: Some(1) }
Model { id: 2, name: "Rasberry", cake_id: Some(1) } Model { id: 2, name: "Raspberry", cake_id: Some(1) }
===== ===== ===== =====
@ -58,7 +58,7 @@ SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit`
SELECT `cake`.`id`, `cake`.`name` FROM `cake` WHERE `cake`.`id` IN (1, 1, 2, NULL, NULL, NULL, NULL, NULL, NULL) SELECT `cake`.`id`, `cake`.`name` FROM `cake` WHERE `cake`.`id` IN (1, 1, 2, NULL, NULL, NULL, NULL, NULL, NULL)
(Model { id: 1, name: "Blueberry", cake_id: Some(1) }, Some(Model { id: 1, name: "New York Cheese" })) (Model { id: 1, name: "Blueberry", cake_id: Some(1) }, Some(Model { id: 1, name: "New York Cheese" }))
(Model { id: 2, name: "Rasberry", cake_id: Some(1) }, Some(Model { id: 1, name: "New York Cheese" })) (Model { id: 2, name: "Raspberry", cake_id: Some(1) }, Some(Model { id: 1, name: "New York Cheese" }))
(Model { id: 3, name: "Strawberry", cake_id: Some(2) }, Some(Model { id: 2, name: "Chocolate Forest" })) (Model { id: 3, name: "Strawberry", cake_id: Some(2) }, Some(Model { id: 2, name: "Chocolate Forest" }))
(Model { id: 4, name: "Apple", cake_id: None }, None) (Model { id: 4, name: "Apple", cake_id: None }, None)
(Model { id: 5, name: "Banana", cake_id: None }, None) (Model { id: 5, name: "Banana", cake_id: None }, None)
@ -73,7 +73,7 @@ with loader:
SELECT `cake`.`id`, `cake`.`name` FROM `cake` SELECT `cake`.`id`, `cake`.`name` FROM `cake`
SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` WHERE `fruit`.`cake_id` IN (1, 2) SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` WHERE `fruit`.`cake_id` IN (1, 2)
(Model { id: 1, name: "New York Cheese" }, [Model { id: 1, name: "Blueberry", cake_id: Some(1) }, Model { id: 2, name: "Rasberry", cake_id: Some(1) }]) (Model { id: 1, name: "New York Cheese" }, [Model { id: 1, name: "Blueberry", cake_id: Some(1) }, Model { id: 2, name: "Raspberry", cake_id: Some(1) }])
(Model { id: 2, name: "Chocolate Forest" }, [Model { id: 3, name: "Strawberry", cake_id: Some(2) }]) (Model { id: 2, name: "Chocolate Forest" }, [Model { id: 3, name: "Strawberry", cake_id: Some(2) }])
@ -122,7 +122,7 @@ SELECT `cake`.`id`, `cake`.`name` FROM `cake` LIMIT 3 OFFSET 3
find all fruits paginated: find all fruits paginated:
SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 0 SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 0
Model { id: 1, name: "Blueberry", cake_id: Some(1) } Model { id: 1, name: "Blueberry", cake_id: Some(1) }
Model { id: 2, name: "Rasberry", cake_id: Some(1) } Model { id: 2, name: "Raspberry", cake_id: Some(1) }
Model { id: 3, name: "Strawberry", cake_id: Some(2) } Model { id: 3, name: "Strawberry", cake_id: Some(2) }
SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 3 SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 3
Model { id: 4, name: "Apple", cake_id: None } Model { id: 4, name: "Apple", cake_id: None }
@ -137,7 +137,7 @@ SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFS
find all fruits with stream: find all fruits with stream:
SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 0 SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 0
Model { id: 1, name: "Blueberry", cake_id: Some(1) } Model { id: 1, name: "Blueberry", cake_id: Some(1) }
Model { id: 2, name: "Rasberry", cake_id: Some(1) } Model { id: 2, name: "Raspberry", cake_id: Some(1) }
Model { id: 3, name: "Strawberry", cake_id: Some(2) } Model { id: 3, name: "Strawberry", cake_id: Some(2) }
SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 3 SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 3
Model { id: 4, name: "Apple", cake_id: None } Model { id: 4, name: "Apple", cake_id: None }
@ -152,7 +152,7 @@ SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFS
find all fruits in json with stream: find all fruits in json with stream:
SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 0 SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 0
Object {"cake_id": Number(1), "id": Number(1), "name": String("Blueberry")} Object {"cake_id": Number(1), "id": Number(1), "name": String("Blueberry")}
Object {"cake_id": Number(1), "id": Number(2), "name": String("Rasberry")} Object {"cake_id": Number(1), "id": Number(2), "name": String("Raspberry")}
Object {"cake_id": Number(2), "id": Number(3), "name": String("Strawberry")} Object {"cake_id": Number(2), "id": Number(3), "name": String("Strawberry")}
SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 3 SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 3
Object {"cake_id": Null, "id": Number(4), "name": String("Apple")} Object {"cake_id": Null, "id": Number(4), "name": String("Apple")}
@ -168,7 +168,7 @@ SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFS
fruits first page: fruits first page:
SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 0 SELECT `fruit`.`id`, `fruit`.`name`, `fruit`.`cake_id` FROM `fruit` LIMIT 3 OFFSET 0
Model { id: 1, name: "Blueberry", cake_id: Some(1) } Model { id: 1, name: "Blueberry", cake_id: Some(1) }
Model { id: 2, name: "Rasberry", cake_id: Some(1) } Model { id: 2, name: "Raspberry", cake_id: Some(1) }
Model { id: 3, name: "Strawberry", cake_id: Some(2) } Model { id: 3, name: "Strawberry", cake_id: Some(2) }
===== ===== ===== =====

View File

@ -22,7 +22,7 @@ CREATE TABLE `fruit` (
INSERT INTO `fruit` (`id`, `name`, `cake_id`) VALUES INSERT INTO `fruit` (`id`, `name`, `cake_id`) VALUES
(1, 'Blueberry', 1), (1, 'Blueberry', 1),
(2, 'Rasberry', 1), (2, 'Raspberry', 1),
(3, 'Strawberry', 2); (3, 'Strawberry', 2);
INSERT INTO `fruit` (`name`, `cake_id`) VALUES INSERT INTO `fruit` (`name`, `cake_id`) VALUES

View File

@ -1,5 +1,5 @@
{ {
"name": "frontent", "name": "frontend",
"private": true, "private": true,
"version": "0.0.0", "version": "0.0.0",
"type": "module", "type": "module",

View File

@ -21,12 +21,12 @@ pub struct Error {
impl OpenApiResponderInner for Error { impl OpenApiResponderInner for Error {
fn responses(_generator: &mut OpenApiGenerator) -> Result<Responses, OpenApiError> { fn responses(_generator: &mut OpenApiGenerator) -> Result<Responses, OpenApiError> {
use rocket_okapi::okapi::openapi3::{RefOr, Response as OpenApiReponse}; use rocket_okapi::okapi::openapi3::{RefOr, Response as OpenApiResponse};
let mut responses = Map::new(); let mut responses = Map::new();
responses.insert( responses.insert(
"400".to_string(), "400".to_string(),
RefOr::Object(OpenApiReponse { RefOr::Object(OpenApiResponse {
description: "\ description: "\
# [400 Bad Request](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400)\n\ # [400 Bad Request](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400)\n\
The request given is wrongly formatted or data asked could not be fulfilled. \ The request given is wrongly formatted or data asked could not be fulfilled. \
@ -37,7 +37,7 @@ impl OpenApiResponderInner for Error {
); );
responses.insert( responses.insert(
"404".to_string(), "404".to_string(),
RefOr::Object(OpenApiReponse { RefOr::Object(OpenApiResponse {
description: "\ description: "\
# [404 Not Found](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404)\n\ # [404 Not Found](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404)\n\
This response is given when you request a page that does not exists.\ This response is given when you request a page that does not exists.\
@ -48,7 +48,7 @@ impl OpenApiResponderInner for Error {
); );
responses.insert( responses.insert(
"422".to_string(), "422".to_string(),
RefOr::Object(OpenApiReponse { RefOr::Object(OpenApiResponse {
description: "\ description: "\
# [422 Unprocessable Entity](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422)\n\ # [422 Unprocessable Entity](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422)\n\
This response is given when you request body is not correctly formatted. \ This response is given when you request body is not correctly formatted. \
@ -58,7 +58,7 @@ impl OpenApiResponderInner for Error {
); );
responses.insert( responses.insert(
"500".to_string(), "500".to_string(),
RefOr::Object(OpenApiReponse { RefOr::Object(OpenApiResponse {
description: "\ description: "\
# [500 Internal Server Error](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500)\n\ # [500 Internal Server Error](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500)\n\
This response is given when something wend wrong on the server. \ This response is given when something wend wrong on the server. \

View File

@ -8,7 +8,7 @@
|:--:| |:--:|
| The Bakery schema | | The Bakery schema |
## Specifiy a database url ## Specify a database url
``` ```
export DATABASE_URL=mysql://sea:sea@localhost/bakery export DATABASE_URL=mysql://sea:sea@localhost/bakery

View File

@ -183,7 +183,7 @@ mod tests {
// Test spaced words distinct from non-spaced // Test spaced words distinct from non-spaced
assert_eq!(camel_case_with_escaped_non_uax31("foo bar"), "Foo0x20bar"); assert_eq!(camel_case_with_escaped_non_uax31("foo bar"), "Foo0x20bar");
// Test undescored words distinct from non-spaced and spaced // Test underscored words distinct from non-spaced and spaced
assert_eq!(camel_case_with_escaped_non_uax31("foo_bar"), "Foo0x5Fbar"); assert_eq!(camel_case_with_escaped_non_uax31("foo_bar"), "Foo0x5Fbar");
// Test leading numeric characters // Test leading numeric characters

View File

@ -180,7 +180,7 @@ pub struct Initializer<D: Database>(Option<&'static str>, PhantomData<fn() -> D>
/// status `InternalServerError`. A [`Sentinel`] guards this condition, and so /// status `InternalServerError`. A [`Sentinel`] guards this condition, and so
/// this type of failure is unlikely to occur. A `None` error is returned. /// this type of failure is unlikely to occur. A `None` error is returned.
/// * If a connection is not available within `connect_timeout` seconds or /// * If a connection is not available within `connect_timeout` seconds or
/// another error occurs, the gaurd _fails_ with status `ServiceUnavailable` /// another error occurs, the guard _fails_ with status `ServiceUnavailable`
/// and the error is returned in `Some`. /// and the error is returned in `Some`.
pub struct Connection<'a, D: Database>(&'a <D::Pool as Pool>::Connection); pub struct Connection<'a, D: Database>(&'a <D::Pool as Pool>::Connection);

View File

@ -5,10 +5,10 @@ use std::fmt;
/// guard. /// guard.
#[derive(Debug)] #[derive(Debug)]
pub enum Error<A, B = A> { pub enum Error<A, B = A> {
/// An error that occured during database/pool initialization. /// An error that occurred during database/pool initialization.
Init(A), Init(A),
/// An error that ocurred while retrieving a connection from the pool. /// An error that occurred while retrieving a connection from the pool.
Get(B), Get(B),
/// A [`Figment`](crate::figment::Figment) configuration error. /// A [`Figment`](crate::figment::Figment) configuration error.

View File

@ -480,7 +480,7 @@ mod tests {
}, },
Model { Model {
id: 2, id: 2,
name: "Rasberry".into(), name: "Raspberry".into(),
cake_id: Some(1), cake_id: Some(1),
}, },
]; ];
@ -531,7 +531,7 @@ mod tests {
}, },
Model { Model {
id: 2, id: 2,
name: "Rasberry".into(), name: "Raspberry".into(),
cake_id: Some(1), cake_id: Some(1),
}, },
]; ];
@ -590,11 +590,11 @@ mod tests {
( (
cake::Model { cake::Model {
id: 2, id: 2,
name: "Rasberry Cheese Cake".into(), name: "Raspberry Cheese Cake".into(),
}, },
Some(fruit::Model { Some(fruit::Model {
id: 10, id: 10,
name: "Rasberry".into(), name: "Raspberry".into(),
cake_id: Some(1), cake_id: Some(1),
}), }),
), ),
@ -642,11 +642,11 @@ mod tests {
( (
cake::Model { cake::Model {
id: 2, id: 2,
name: "Rasberry Cheese Cake".into(), name: "Raspberry Cheese Cake".into(),
}, },
Some(fruit::Model { Some(fruit::Model {
id: 10, id: 10,
name: "Rasberry".into(), name: "Raspberry".into(),
cake_id: Some(1), cake_id: Some(1),
}), }),
), ),
@ -819,11 +819,11 @@ mod tests {
( (
cake::Model { cake::Model {
id: 2, id: 2,
name: "Rasberry Cheese Cake".into(), name: "Raspberry Cheese Cake".into(),
}, },
Some(vendor::Model { Some(vendor::Model {
id: 10, id: 10,
name: "Rasberry".into(), name: "Raspberry".into(),
}), }),
), ),
]; ];
@ -871,11 +871,11 @@ mod tests {
( (
cake::Model { cake::Model {
id: 2, id: 2,
name: "Rasberry Cheese Cake".into(), name: "Raspberry Cheese Cake".into(),
}, },
Some(vendor::Model { Some(vendor::Model {
id: 10, id: 10,
name: "Rasberry".into(), name: "Raspberry".into(),
}), }),
), ),
( (
@ -1041,7 +1041,7 @@ mod tests {
.append_query_results([[ .append_query_results([[
Model { Model {
id: 22, id: 22,
name: "Rasberry".into(), name: "Raspberry".into(),
cake_id: Some(1), cake_id: Some(1),
}, },
Model { Model {
@ -1067,7 +1067,7 @@ mod tests {
}, },
Model { Model {
id: 22, id: 22,
name: "Rasberry".into(), name: "Raspberry".into(),
cake_id: Some(1), cake_id: Some(1),
}, },
] ]
@ -1100,7 +1100,7 @@ mod tests {
let models = [ let models = [
Model { Model {
id: 22, id: 22,
name: "Rasberry".into(), name: "Raspberry".into(),
cake_id: Some(1), cake_id: Some(1),
}, },
Model { Model {
@ -1153,7 +1153,7 @@ mod tests {
.append_query_results([[ .append_query_results([[
Model { Model {
id: 27, id: 27,
name: "Rasberry".into(), name: "Raspberry".into(),
cake_id: Some(1), cake_id: Some(1),
}, },
Model { Model {
@ -1180,7 +1180,7 @@ mod tests {
}, },
Model { Model {
id: 27, id: 27,
name: "Rasberry".into(), name: "Raspberry".into(),
cake_id: Some(1), cake_id: Some(1),
}, },
] ]
@ -1214,7 +1214,7 @@ mod tests {
let models = [ let models = [
Model { Model {
id: 27, id: 27,
name: "Rasberry".into(), name: "Raspberry".into(),
cake_id: Some(1), cake_id: Some(1),
}, },
Model { Model {

View File

@ -329,7 +329,7 @@ mod tests {
}, },
fruit::Model { fruit::Model {
id: 2, id: 2,
name: "Rasberry".into(), name: "Raspberry".into(),
cake_id: Some(1), cake_id: Some(1),
}, },
]; ];

View File

@ -17,7 +17,7 @@ impl TestContext {
dotenv::from_filename(".env").ok(); dotenv::from_filename(".env").ok();
let base_url = let base_url =
std::env::var("DATABASE_URL").expect("Enviroment variable 'DATABASE_URL' not set"); std::env::var("DATABASE_URL").expect("Environment variable 'DATABASE_URL' not set");
let db: DatabaseConnection = setup::setup(&base_url, test_name).await; let db: DatabaseConnection = setup::setup(&base_url, test_name).await;
Self { Self {