From 361d03df7f59e8471fca7382a0bd481aa14c9484 Mon Sep 17 00:00:00 2001 From: Yiu Tin Cheung Ivan Date: Wed, 12 Jul 2023 15:43:56 +0800 Subject: [PATCH] param intoString SeaQL/sea-orm#1439 --- SeaORM/docs/0.12.x-CHANGELOG_temp.md | 2 +- SeaORM/docs/02-install-and-config/02-connection.md | 4 ++-- SeaORM/docs/03-migration/03-running-migration.md | 4 ++-- SeaORM/docs/05-basic-crud/08-raw-sql.md | 6 +++--- SeaORM/docs/09-schema-statement/02-create-enum.md | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/SeaORM/docs/0.12.x-CHANGELOG_temp.md b/SeaORM/docs/0.12.x-CHANGELOG_temp.md index 54cbd36fc9..a2ddce7106 100644 --- a/SeaORM/docs/0.12.x-CHANGELOG_temp.md +++ b/SeaORM/docs/0.12.x-CHANGELOG_temp.md @@ -276,7 +276,6 @@ assert_eq!(migration.name(), "m20220118_000002_create_fruit_table"); assert_eq!(migration.status(), MigrationStatus::Pending); ``` * The `postgres-array` feature will be enabled when `sqlx-postgres` backend is selected https://github.com/SeaQL/sea-orm/pull/1565 - ================================ All Changes above was being Documented ================================ * Replace `String` parameters in API with `Into` https://github.com/SeaQL/sea-orm/pull/1439 * Implements `IntoMockRow` for any `BTreeMap` that is indexed by string `impl IntoMockRow for BTreeMap where T: Into` * Converts any string value into `ConnectOptions` - `impl From for ConnectOptions where T: Into` @@ -286,6 +285,7 @@ assert_eq!(migration.status(), MigrationStatus::Pending); * Changed the parameter of method `Transaction::from_sql_and_values(DbBackend, T, I) where I: IntoIterator, T: Into` to takes any string SQL * Changed the parameter of method `ConnectOptions::set_schema_search_path(T) where T: Into` to takes any string * Changed the parameter of method `ColumnTrait::like()`, `ColumnTrait::not_like()`, `ColumnTrait::starts_with()`, `ColumnTrait::ends_with()` and `ColumnTrait::contains()` to takes any string + ================================ All Changes above was being Documented ================================ * Re-export `sea_query::{DynIden, RcOrArc, SeaRc}` in `sea_orm::entity::prelude` module https://github.com/SeaQL/sea-orm/pull/1661 * Added `DatabaseConnection::ping` https://github.com/SeaQL/sea-orm/pull/1627 ```rust diff --git a/SeaORM/docs/02-install-and-config/02-connection.md b/SeaORM/docs/02-install-and-config/02-connection.md index e7c573bbe3..d6a5ce3063 100644 --- a/SeaORM/docs/02-install-and-config/02-connection.md +++ b/SeaORM/docs/02-install-and-config/02-connection.md @@ -21,7 +21,7 @@ Multiple queries will execute in parallel as you `await` on them. To configure the connection, use the [`ConnectOptions`](https://docs.rs/sea-orm/*/sea_orm/struct.ConnectOptions.html) interface: ```rust -let mut opt = ConnectOptions::new("protocol://username:password@host/database".to_owned()); +let mut opt = ConnectOptions::new("protocol://username:password@host/database"); opt.max_connections(100) .min_connections(5) .connect_timeout(Duration::from_secs(8)) @@ -30,7 +30,7 @@ opt.max_connections(100) .max_lifetime(Duration::from_secs(8)) .sqlx_logging(true) .sqlx_logging_level(log::LevelFilter::Info) - .set_schema_search_path("my_schema".into()); // Setting default PostgreSQL schema + .set_schema_search_path("my_schema"); // Setting default PostgreSQL schema let db = Database::connect(opt).await?; ``` diff --git a/SeaORM/docs/03-migration/03-running-migration.md b/SeaORM/docs/03-migration/03-running-migration.md index 6d38b2cce2..ff094f78ec 100644 --- a/SeaORM/docs/03-migration/03-running-migration.md +++ b/SeaORM/docs/03-migration/03-running-migration.md @@ -84,8 +84,8 @@ For CLI, you can specify the target schema with `-s` / `--database_schema` optio You can also run the migration on the target schema programmatically: ```rust -let connect_options = ConnectOptions::new("postgres://root:root@localhost/database".into()) - .set_schema_search_path("my_schema".into()) // Override the default schema +let connect_options = ConnectOptions::new("postgres://root:root@localhost/database") + .set_schema_search_path("my_schema") // Override the default schema .to_owned(); let db = Database::connect(connect_options).await? diff --git a/SeaORM/docs/05-basic-crud/08-raw-sql.md b/SeaORM/docs/05-basic-crud/08-raw-sql.md index d07fa8c096..4663267d3d 100644 --- a/SeaORM/docs/05-basic-crud/08-raw-sql.md +++ b/SeaORM/docs/05-basic-crud/08-raw-sql.md @@ -88,7 +88,7 @@ You can build SQL statements using `sea-query` and query / execute it directly o let query_res: Option = db .query_one(Statement::from_string( DatabaseBackend::MySql, - "SELECT * FROM `cake`;".to_owned(), + "SELECT * FROM `cake`;", )) .await?; let query_res = query_res.unwrap(); @@ -97,7 +97,7 @@ let id: i32 = query_res.try_get("", "id")?; let query_res_vec: Vec = db .query_all(Statement::from_string( DatabaseBackend::MySql, - "SELECT * FROM `cake`;".to_owned(), + "SELECT * FROM `cake`;", )) .await?; ``` @@ -108,7 +108,7 @@ let query_res_vec: Vec = db let exec_res: ExecResult = db .execute(Statement::from_string( DatabaseBackend::MySql, - "DROP DATABASE IF EXISTS `sea`;".to_owned(), + "DROP DATABASE IF EXISTS `sea`;", )) .await?; assert_eq!(exec_res.rows_affected(), 1); diff --git a/SeaORM/docs/09-schema-statement/02-create-enum.md b/SeaORM/docs/09-schema-statement/02-create-enum.md index a97ce8b94d..7d036251f6 100644 --- a/SeaORM/docs/09-schema-statement/02-create-enum.md +++ b/SeaORM/docs/09-schema-statement/02-create-enum.md @@ -113,7 +113,7 @@ assert_eq!( .collect::>(), [Statement::from_string( db_postgres, - r#"CREATE TYPE "tea" AS ENUM ('EverydayTea', 'BreakfastTea')"#.to_owned() + r#"CREATE TYPE "tea" AS ENUM ('EverydayTea', 'BreakfastTea')"# ),] ); @@ -121,7 +121,7 @@ assert_eq!( db_postgres.build(&schema.create_enum_from_active_enum::()), Statement::from_string( db_postgres, - r#"CREATE TYPE "tea" AS ENUM ('EverydayTea', 'BreakfastTea')"#.to_owned() + r#"CREATE TYPE "tea" AS ENUM ('EverydayTea', 'BreakfastTea')"# ) );