iceberg_catalog_sql/
lib.rs

1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements.  See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.  The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License.  You may obtain a copy of the License at
8//
9//   http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied.  See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18//! Iceberg sql catalog implementation.
19//!
20//! To build a sql catalog with configurations
21//! # Example
22//!
23//! ```rust, no_run
24//! use std::collections::HashMap;
25//!
26//! use iceberg::CatalogBuilder;
27//! use iceberg_catalog_sql::{
28//!     SQL_CATALOG_PROP_BIND_STYLE, SQL_CATALOG_PROP_URI, SQL_CATALOG_PROP_WAREHOUSE,
29//!     SqlBindStyle, SqlCatalogBuilder,
30//! };
31//!
32//! #[tokio::main]
33//! async fn main() {
34//!     let catalog = SqlCatalogBuilder::default()
35//!         .load(
36//!             "sql",
37//!             HashMap::from_iter([
38//!                 (
39//!                     SQL_CATALOG_PROP_URI.to_string(),
40//!                     "http://localhost:8181".to_string(),
41//!                 ),
42//!                 (
43//!                     SQL_CATALOG_PROP_WAREHOUSE.to_string(),
44//!                     "s3://warehouse".to_string(),
45//!                 ),
46//!                 (
47//!                     SQL_CATALOG_PROP_BIND_STYLE.to_string(),
48//!                     SqlBindStyle::QMark.to_string(),
49//!                 ),
50//!             ]),
51//!         )
52//!         .await
53//!         .unwrap();
54//! }
55//! ```
56
57#![deny(missing_docs)]
58
59mod catalog;
60mod error;
61pub use catalog::*;