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