1#![expect(
16 refining_impl_trait,
17 reason = "Some of the Row::iter() implementations returns ExactSizeIterator. Is this reasonable?"
18)]
19#![feature(trait_alias)]
20#![feature(type_alias_impl_trait)]
21#![feature(test)]
22#![feature(trusted_len)]
23#![feature(allocator_api)]
24#![feature(coroutines)]
25#![feature(map_try_insert)]
26#![feature(error_generic_member_access)]
27#![feature(let_chains)]
28#![feature(portable_simd)]
29#![feature(array_chunks)]
30#![feature(inline_const_pat)]
31#![allow(incomplete_features)]
32#![feature(iterator_try_collect)]
33#![feature(iter_order_by)]
34#![feature(binary_heap_into_iter_sorted)]
35#![feature(impl_trait_in_assoc_type)]
36#![feature(negative_impls)]
37#![feature(register_tool)]
38#![feature(btree_cursors)]
39#![feature(assert_matches)]
40#![feature(anonymous_lifetime_in_impl_trait)]
41#![register_tool(rw)]
42
43#[cfg_attr(not(test), allow(unused_extern_crates))]
44extern crate self as risingwave_common;
45
46#[macro_use]
49extern crate risingwave_error;
50pub use risingwave_error::common::{
51 bail_no_function, bail_not_implemented, no_function, not_implemented,
52};
53pub use risingwave_error::macros::*;
54
55#[macro_use]
56pub mod jemalloc;
57#[macro_use]
58pub mod error;
59#[macro_use]
60pub mod array;
61#[macro_use]
62pub mod util;
63pub mod acl;
64pub mod bitmap;
65pub mod cache;
66pub mod cast;
67pub mod catalog;
68pub mod config;
69pub mod constants;
70pub mod field_generator;
71pub mod hash;
72pub mod log;
73pub mod memory;
74pub use risingwave_common_metrics::{
75 monitor, register_guarded_gauge_vec_with_registry,
76 register_guarded_histogram_vec_with_registry, register_guarded_int_counter_vec_with_registry,
77 register_guarded_int_gauge_vec_with_registry, register_guarded_uint_gauge_vec_with_registry,
78};
79pub use {
80 risingwave_common_metrics as metrics, risingwave_common_secret as secret,
81 risingwave_license as license,
82};
83pub mod lru;
84pub mod operator;
85pub mod opts;
86pub mod range;
87pub mod row;
88pub mod sequence;
89pub mod session_config;
90pub mod system_param;
91pub mod telemetry;
92pub mod test_utils;
93pub mod transaction;
94pub mod types;
95pub mod vnode_mapping;
96
97pub mod test_prelude {
98 pub use super::array::{DataChunkTestExt, StreamChunkTestExt};
99 pub use super::catalog::test_utils::ColumnDescTestExt;
100}
101
102pub const RW_VERSION: &str = env!("CARGO_PKG_VERSION");
103
104pub const UNKNOWN_GIT_SHA: &str = "unknown";
106
107pub const PG_VERSION: &str = "13.14.0";
110pub const SERVER_VERSION_NUM: i32 = 130014;
112pub const SERVER_ENCODING: &str = "UTF8";
114pub const STANDARD_CONFORMING_STRINGS: &str = "on";
116
117#[macro_export]
118macro_rules! git_sha {
119 ($env:literal) => {
120 match option_env!($env) {
121 Some(v) if !v.is_empty() => v,
122 _ => $crate::UNKNOWN_GIT_SHA,
123 }
124 };
125}
126
127pub const GIT_SHA: &str = git_sha!("GIT_SHA");
131
132pub fn current_cluster_version() -> String {
133 format!(
134 "PostgreSQL {}-RisingWave-{} ({})",
135 PG_VERSION, RW_VERSION, GIT_SHA
136 )
137}
138
139#[macro_export]
144macro_rules! panic_if_debug {
145 ($($arg:tt)*) => {
146 if cfg!(debug_assertions) {
147 panic!($($arg)*)
148 } else {
149 tracing::warn!($($arg)*)
150 }
151 };
152}