Skip to main content

mz_aws_glue_schema_registry/
lib.rs

1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10#![warn(missing_debug_implementations)]
11
12//! An API client for the [AWS Glue Schema Registry][gsr].
13//!
14//! This crate is the Glue analogue of [`mz-ccsr`], the Confluent Schema
15//! Registry client. It is intentionally narrow: only the surface needed by
16//! the current Materialize integration is implemented.
17//!
18//! Currently implemented:
19//!
20//! * [`Client::get_registry`] — used by `GlueSchemaRegistryConnection::validate`
21//!   to verify a registry exists at `CREATE CONNECTION` time.
22//! * [`Client::get_schema_version_by_id`] — source decode: fetch a writer
23//!   schema by the UUID embedded in each record's Glue wire-format header.
24//! * [`Client::get_schema_version_latest_by_name`] — DDL planning: pin a
25//!   reader schema to the registry's current "latest" version.
26//!
27//! Future work will add:
28//!
29//! * `register_schema_version`, `get_schema_version_by_definition`,
30//!   `get_compatibility`, `update_compatibility` — sink encode.
31//!
32//! ## Example usage
33//!
34//! ```no_run
35//! # async {
36//! use mz_aws_glue_schema_registry::{Client, ClientConfig};
37//! use aws_types::SdkConfig;
38//!
39//! let sdk_config: SdkConfig = unimplemented!("from AwsConnection::load_sdk_config");
40//! let client = ClientConfig::new(sdk_config).build();
41//! let registry = client.get_registry("my-registry").await?;
42//! # let _ = registry;
43//! # Ok::<_, mz_aws_glue_schema_registry::GetRegistryError>(())
44//! # };
45//! ```
46//!
47//! [gsr]: https://docs.aws.amazon.com/glue/latest/dg/schema-registry.html
48//! [`mz-ccsr`]: https://docs.rs/mz-ccsr
49
50mod client;
51mod config;
52
53pub use client::{
54    Client, GetRegistryError, GetSchemaVersionError, Registry, RegistryLifecycleStatus,
55    SchemaVersion, SchemaVersionLifecycleStatus,
56};
57pub use config::ClientConfig;