Skip to main content

mz_deploy/
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//! Safe, testable deployments for Materialize.
11//!
12//! `mz-deploy` compiles a directory of `.sql` files into a deployment plan,
13//! diffs it against the live environment, and executes blue/green schema
14//! migrations via Materialize's zero-downtime deployment primitives.
15//!
16//! ## Architecture
17//!
18//! The crate is organized into four major layers:
19//!
20//! - **[`cli`]** — Command-line interface: argument parsing, subcommand dispatch,
21//!   and user-facing error formatting.
22//! - **[`client`]** — Database client layer: connection management, introspection
23//!   queries, DDL provisioning, and deployment operations against a live
24//!   Materialize region.
25//! - **`project`** — Project compiler: loads `.sql` files from disk, validates
26//!   and type-checks them, resolves dependencies, and produces a deployment graph.
27//! - **`types`** — Data-contract system: the `types.lock` file that pins
28//!   column schemas for external dependencies and the mirrored internal type
29//!   cache used by downstream consumers.
30//!
31//! ## Supporting Modules
32//!
33//! - **[`log`]** — Verbose logging and the [`verbose!`] macro.
34#![deny(clippy::print_stdout)]
35#![deny(clippy::print_stderr)]
36#![warn(unreachable_pub)]
37#![warn(unused_qualifications)]
38
39pub mod cli;
40pub mod client;
41pub mod config;
42pub(crate) mod diagnostics;
43pub(crate) mod docker_runtime;
44pub(crate) mod fs;
45pub mod log;
46pub mod lsp;
47pub(crate) mod project;
48pub(crate) mod secret_resolver;
49pub(crate) mod types;