Skip to content

Commit

Permalink
param intoString SeaQL/sea-orm#1439
Browse files Browse the repository at this point in the history
  • Loading branch information
darkmmon committed Jul 12, 2023
1 parent bda6690 commit 361d03d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion SeaORM/docs/0.12.x-CHANGELOG_temp.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>` https://github.com/SeaQL/sea-orm/pull/1439
* Implements `IntoMockRow` for any `BTreeMap` that is indexed by string `impl IntoMockRow for BTreeMap<T, Value> where T: Into<String>`
* Converts any string value into `ConnectOptions` - `impl From<T> for ConnectOptions where T: Into<String>`
Expand All @@ -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<Item = Value>, T: Into<String>` to takes any string SQL
* Changed the parameter of method `ConnectOptions::set_schema_search_path(T) where T: Into<String>` 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
Expand Down
4 changes: 2 additions & 2 deletions SeaORM/docs/02-install-and-config/02-connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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?;
```
Expand Down
4 changes: 2 additions & 2 deletions SeaORM/docs/03-migration/03-running-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
6 changes: 3 additions & 3 deletions SeaORM/docs/05-basic-crud/08-raw-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ You can build SQL statements using `sea-query` and query / execute it directly o
let query_res: Option<QueryResult> = db
.query_one(Statement::from_string(
DatabaseBackend::MySql,
"SELECT * FROM `cake`;".to_owned(),
"SELECT * FROM `cake`;",
))
.await?;
let query_res = query_res.unwrap();
Expand All @@ -97,7 +97,7 @@ let id: i32 = query_res.try_get("", "id")?;
let query_res_vec: Vec<QueryResult> = db
.query_all(Statement::from_string(
DatabaseBackend::MySql,
"SELECT * FROM `cake`;".to_owned(),
"SELECT * FROM `cake`;",
))
.await?;
```
Expand All @@ -108,7 +108,7 @@ let query_res_vec: Vec<QueryResult> = 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);
Expand Down
4 changes: 2 additions & 2 deletions SeaORM/docs/09-schema-statement/02-create-enum.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ assert_eq!(
.collect::<Vec<_>>(),
[Statement::from_string(
db_postgres,
r#"CREATE TYPE "tea" AS ENUM ('EverydayTea', 'BreakfastTea')"#.to_owned()
r#"CREATE TYPE "tea" AS ENUM ('EverydayTea', 'BreakfastTea')"#
),]
);

assert_eq!(
db_postgres.build(&schema.create_enum_from_active_enum::<Tea>()),
Statement::from_string(
db_postgres,
r#"CREATE TYPE "tea" AS ENUM ('EverydayTea', 'BreakfastTea')"#.to_owned()
r#"CREATE TYPE "tea" AS ENUM ('EverydayTea', 'BreakfastTea')"#
)
);

Expand Down

0 comments on commit 361d03d

Please sign in to comment.