use std::ops::{BitOr, BitOrAssign};
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct ParserOptions(i32);
impl ParserOptions {
pub const DEFAULT: Self = Self(0);
pub const TYPE_NAME: Self = Self(1);
pub const PLPGSQL_EXPR: Self = Self(2);
pub const PLPGSQL_ASSIGN1: Self = Self(3);
pub const PLPGSQL_ASSIGN2: Self = Self(4);
pub const PLPGSQL_ASSIGN3: Self = Self(5);
pub const DISABLE_BACKSLASH_QUOTE: Self = Self(16);
pub const DISABLE_STANDARD_CONFORMING_STRINGS: Self = Self(32);
pub const DISABLE_ESCAPE_STRING_WARNING: Self = Self(64);
pub fn bits(self) -> i32 {
self.0
}
}
impl BitOr for ParserOptions {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
impl BitOrAssign for ParserOptions {
fn bitor_assign(&mut self, rhs: Self) {
self.0 |= rhs.0;
}
}
impl From<i32> for ParserOptions {
fn from(bits: i32) -> Self {
Self(bits)
}
}
impl From<u32> for ParserOptions {
fn from(bits: u32) -> Self {
Self(bits as i32)
}
}
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct FingerprintOptions(i32);
impl FingerprintOptions {
pub const DEFAULT: Self = Self(0);
pub const RANGEVAR_IGNORE_ALIASES: Self = Self(1 << 0);
pub const RANGEVAR_INCLUDE_SCHEMA: Self = Self(1 << 1);
pub const RANGEVAR_PG17_COMPAT: Self = Self(Self::RANGEVAR_IGNORE_ALIASES.0 | Self::RANGEVAR_INCLUDE_SCHEMA.0);
pub const FULL_RELNAME: Self = Self(1 << 4);
pub fn bits(self) -> i32 {
self.0
}
}
impl BitOr for FingerprintOptions {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
impl BitOrAssign for FingerprintOptions {
fn bitor_assign(&mut self, rhs: Self) {
self.0 |= rhs.0;
}
}
impl From<i32> for FingerprintOptions {
fn from(bits: i32) -> Self {
Self(bits)
}
}
impl From<u32> for FingerprintOptions {
fn from(bits: u32) -> Self {
Self(bits as i32)
}
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct DeparseOptions {
pub comments: Vec<DeparseComment>,
pub pretty_print: bool,
pub indent_size: i32,
pub max_line_length: i32,
pub trailing_newline: bool,
pub commas_start_of_line: bool,
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct DeparseComment {
pub match_location: i32,
pub newlines_before_comment: i32,
pub newlines_after_comment: i32,
pub text: String,
}