Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.28.x into master #629

Merged
merged 26 commits into from
Apr 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
450c973
sea-query-rusqlite 0.2.0
billy1624 Dec 15, 2022
909fee1
Postgres `GEN_RANDOM_UUID` #568
tyt2y3 Dec 29, 2022
4a7c903
0.28.1
tyt2y3 Dec 29, 2022
b1f4611
Convert various UUID defined in `uuid::fmt` module into `sea_query::V…
billy1624 Dec 20, 2022
06f85b0
Merge pull request #550 from beckend/cow
ikrivosheev Dec 15, 2022
6bd66b7
0.28.2
billy1624 Jan 4, 2023
aacc3af
0.28.2
billy1624 Jan 4, 2023
26e0382
CI
billy1624 Jan 4, 2023
70d5605
Get values from UpdateStatement
billy1624 Jan 10, 2023
765d603
Merge pull request #578 from SeaQL/get-values-from-update-statement
ikrivosheev Jan 12, 2023
e030255
Update CHANGELOG.md
ikrivosheev Jan 12, 2023
e107fde
Supporting types and implementations for replacing SeaORM's `ColumnTy…
billy1624 Jan 18, 2023
39920ba
Changelog
tyt2y3 Jan 18, 2023
92118b7
Tweaks
tyt2y3 Jan 18, 2023
03d2a1d
0.28.3
tyt2y3 Jan 18, 2023
035007c
Fix: comma separator for dropping multiple types in Postgres.
PreetamSing Mar 19, 2023
87ea3aa
Add: doc-test for dropping multiple types in Postgres.
PreetamSing Mar 19, 2023
73511a7
Formatted documentation code.
PreetamSing Mar 19, 2023
032348e
fix: enable required `syn` features
billy1624 Mar 20, 2023
eea846e
Update CHANGELOG.md
ikrivosheev Mar 20, 2023
54fb5f2
Revert "Update CHANGELOG.md"
ikrivosheev Mar 20, 2023
a2682fb
Revert "fix: enable required `syn` features"
ikrivosheev Mar 20, 2023
965ec06
Refactoring: using fold method instead of loop.
PreetamSing Mar 21, 2023
7366588
Merge pull request #623 from PreetamSing/0.28.x
ikrivosheev Apr 7, 2023
e3e5e3e
Update CHANGELOG.md
ikrivosheev Apr 7, 2023
4623ceb
Merge branch 'master' into 0.28.x_into_master
ikrivosheev Apr 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
* Fix quoted string bug while inserting array of strings to Postgres https://github.com/SeaQL/sea-query/pull/576
* `ALTER TABLE` now panic if has multiple column for Sqlite https://github.com/SeaQL/sea-query/pull/595

## 0.28.4 - Pending

### Bug fixes

* Added comma if multiple names are passed to `TypeDropStatement` https://github.com/SeaQL/sea-query/pull/623

## 0.28.3 - 2023-01-18

### Enhancements
Expand All @@ -68,10 +74,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Bug fixes

* Fixed Postgres `GEN_RANDOM_UUID` https://github.com/SeaQL/sea-query/issues/568
- `PgFunction::GetRandomUUID` -> `PgFunction::GenRandomUUID`
- `PgFunc::get_random_uuid` -> `PgFunc::gen_random_uuid`

* Fixes Postgres `GEN_RANDOM_UUID` https://github.com/SeaQL/sea-query/issues/568

## 0.28.0 - 2022-12-09

### New Features
Expand Down
8 changes: 6 additions & 2 deletions src/backend/postgres/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ impl TypeBuilder for PostgresQueryBuilder {
write!(sql, "IF EXISTS ").unwrap();
}

for name in drop.names.iter() {
drop.names.iter().fold(true, |first, name| {
if !first {
write!(sql, ", ").unwrap();
}
self.prepare_type_ref(name, sql);
}
false
});

if let Some(option) = &drop.option {
write!(sql, " ").unwrap();
Expand Down
33 changes: 33 additions & 0 deletions src/extension/postgres/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,39 @@ impl TypeDropStatement {
self
}

/// Drop multiple types
///
/// ```
/// use sea_query::{extension::postgres::Type, *};
///
/// #[derive(Iden)]
/// enum KycStatus {
/// #[iden = "kyc_status"]
/// Type,
/// Pending,
/// Approved,
/// }
///
/// #[derive(Iden)]
/// enum FontFamily {
/// #[iden = "font_family"]
/// Type,
/// Aerial,
/// Forte,
/// }
///
/// assert_eq!(
/// Type::drop()
/// .if_exists()
/// .names([
/// SeaRc::new(KycStatus::Type) as DynIden,
/// SeaRc::new(FontFamily::Type) as DynIden,
/// ])
/// .cascade()
/// .to_string(PostgresQueryBuilder),
/// r#"DROP TYPE IF EXISTS "kyc_status", "font_family" CASCADE"#
/// );
/// ```
pub fn names<T, I>(&mut self, names: I) -> &mut Self
where
T: IntoTypeRef,
Expand Down