mz_expr/scalar/func/impls/
regproc.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
10use mz_expr_derive::sqlfunc;
11use mz_repr::adt::system::{Oid, RegClass, RegProc, RegType};
12
13#[sqlfunc(
14    sqlname = "regclasstooid",
15    preserves_uniqueness = true,
16    inverse = to_unary!(super::CastOidToRegClass)
17)]
18fn cast_reg_class_to_oid(a: RegClass) -> Oid {
19    Oid(a.0)
20}
21
22#[sqlfunc(
23    sqlname = "regproctooid",
24    preserves_uniqueness = true,
25    inverse = to_unary!(super::CastOidToRegProc)
26)]
27fn cast_reg_proc_to_oid(a: RegProc) -> Oid {
28    Oid(a.0)
29}
30
31#[sqlfunc(
32    sqlname = "regtypetooid",
33    preserves_uniqueness = true,
34    inverse = to_unary!(super::CastOidToRegType)
35)]
36fn cast_reg_type_to_oid(a: RegType) -> Oid {
37    Oid(a.0)
38}