Skip to content

Commit

Permalink
refactor: make Pgstac a trait (#551)
Browse files Browse the repository at this point in the history
We were using it like a trait anyways, and I think this will make
downstream usage much easier. cc @bitner
  • Loading branch information
gadomski authored Dec 4, 2024
1 parent 3f5bb3b commit 3f94183
Show file tree
Hide file tree
Showing 9 changed files with 769 additions and 819 deletions.
3 changes: 1 addition & 2 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@
unused_import_braces,
unused_lifetimes,
unused_qualifications,
unused_results,
warnings
unused_results
)]

mod asset;
Expand Down
8 changes: 8 additions & 0 deletions crates/pgstac/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Added

- `Pgstac` trait ([#551](https://github.com/stac-utils/stac-rs/pull/551))

### Changed

- Return JSON, not STAC ([#550](https://github.com/stac-utils/stac-rs/pull/550))

### Removed

- `Client` ([#551](https://github.com/stac-utils/stac-rs/pull/551))

## [0.2.2] - 2024-11-12

Bump dependencies.
Expand Down
5 changes: 2 additions & 3 deletions crates/pgstac/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ rust-version.workspace = true
tls = ["dep:rustls", "dep:tokio-postgres-rustls", "dep:webpki-roots"]

[dependencies]
geojson.workspace = true
rustls = { workspace = true, features = ["ring", "std"], optional = true }
serde.workspace = true
serde_json.workspace = true
stac.workspace = true
stac-api.workspace = true
thiserror.workspace = true
tokio-postgres = { workspace = true, features = ["with-serde_json-1"] }
tokio-postgres-rustls = { workspace = true, optional = true }
tracing.workspace = true
webpki-roots = { workspace = true, optional = true }

[dev-dependencies]
geojson.workspace = true
stac.workspace = true
pgstac-test = { path = "pgstac-test" }
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
tokio-test.workspace = true
Expand Down
3 changes: 1 addition & 2 deletions crates/pgstac/pgstac-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ fn impl_pgstac_test(ast: ItemFn) -> TokenStream {
connection.await.unwrap()
});
let transaction = client.transaction().await.unwrap();
let client = Client::new(&transaction);
#ast
#ident(&client).await;
#ident(&transaction).await;
transaction.rollback().await.unwrap();
}
};
Expand Down
Loading

0 comments on commit 3f94183

Please sign in to comment.