Skip to main content

fraiseql_wire/util/oid/
mod.rs

1//! Postgres Object Identifier (OID) constants
2//!
3//! OIDs identify data types in the Postgres wire protocol.
4
5/// Postgres type OID
6pub type OID = u32;
7
8/// JSON type OID
9pub const JSON_OID: OID = 114;
10
11/// JSONB type OID
12pub const JSONB_OID: OID = 3802;
13
14/// Check if an OID represents a JSON type
15#[inline]
16#[must_use]
17pub const fn is_json_oid(oid: OID) -> bool {
18    oid == JSON_OID || oid == JSONB_OID
19}
20
21#[cfg(test)]
22mod tests;