#[non_exhaustive]pub enum ObjectType {
Show 15 variants
Table,
Database,
Schema,
Sequence,
Function,
Procedure,
Routine,
Type,
Domain,
ForeignDataWrapper,
ForeignServer,
Language,
LargeObject,
Tablespace,
Parameter,
}Expand description
Database object types for DCL statements
This enum represents the various types of database objects that can be targets of GRANT and REVOKE statements.
§Examples
use reinhardt_query::dcl::ObjectType;
let object_type = ObjectType::Table;
assert_eq!(object_type.as_sql(), "TABLE");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Table
Database tables
Database
Entire databases
Schema
Database schemas (PostgreSQL-specific)
Sequence
Sequence objects (PostgreSQL-specific)
Function
Functions (PostgreSQL-specific)
Procedure
Procedures (PostgreSQL-specific)
Routine
Routines - functions or procedures (PostgreSQL-specific)
Type
User-defined types (PostgreSQL-specific)
Domain
Domain types (PostgreSQL-specific)
ForeignDataWrapper
Foreign data wrappers (PostgreSQL-specific)
ForeignServer
Foreign servers (PostgreSQL-specific)
Language
Procedural languages (PostgreSQL-specific)
LargeObject
Large objects (PostgreSQL-specific)
Tablespace
Tablespaces (PostgreSQL-specific)
Parameter
Configuration parameters (PostgreSQL-specific)
Implementations§
Source§impl ObjectType
impl ObjectType
Sourcepub fn as_sql(&self) -> &'static str
pub fn as_sql(&self) -> &'static str
Returns the SQL keyword for this object type
§Examples
use reinhardt_query::dcl::ObjectType;
assert_eq!(ObjectType::Table.as_sql(), "TABLE");
assert_eq!(ObjectType::Database.as_sql(), "DATABASE");Sourcepub fn is_postgres_only(&self) -> bool
pub fn is_postgres_only(&self) -> bool
Checks if this object type is PostgreSQL-specific
Returns true for object types that are only available in PostgreSQL,
false for object types that are common to both PostgreSQL and MySQL.
§Examples
use reinhardt_query::dcl::ObjectType;
assert!(!ObjectType::Table.is_postgres_only()); // Common
assert!(ObjectType::Schema.is_postgres_only()); // PostgreSQL-specificTrait Implementations§
Source§impl Clone for ObjectType
impl Clone for ObjectType
Source§fn clone(&self) -> ObjectType
fn clone(&self) -> ObjectType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ObjectType
Source§impl Debug for ObjectType
impl Debug for ObjectType
impl Eq for ObjectType
Source§impl Hash for ObjectType
impl Hash for ObjectType
Source§impl PartialEq for ObjectType
impl PartialEq for ObjectType
Source§fn eq(&self, other: &ObjectType) -> bool
fn eq(&self, other: &ObjectType) -> bool
self and other values to be equal, and is used by ==.