pub struct StatementEntity {
pub id: String,
pub statement_type: String,
pub tables: HashSet<String>,
pub columns: HashSet<String>,
pub has_where: bool,
pub has_limit: bool,
pub has_order_by: bool,
pub estimated_rows: u64,
pub join_count: u32,
pub subquery_count: u32,
}Expand description
SQL statement entity for policy evaluation (SQL Code Mode).
Mirrors the Statement entity in SQL_CEDAR_SCHEMA —
see cedar_validation.rs for the schema definition.
Fields§
§id: StringUnique ID for this statement validation.
statement_type: StringStatement type: “SELECT”, “INSERT”, “UPDATE”, “DELETE”, “DDL”, “OTHER”.
tables: HashSet<String>Tables referenced by the statement.
columns: HashSet<String>Columns referenced by the statement. * for wildcards.
has_where: boolWhether the statement has a WHERE clause.
has_limit: boolWhether the statement has a LIMIT clause.
has_order_by: boolWhether the statement has an ORDER BY clause.
estimated_rows: u64Estimated rows affected.
join_count: u32Number of JOIN clauses.
subquery_count: u32Number of nested subqueries.
Implementations§
Source§impl StatementEntity
impl StatementEntity
Sourcepub fn from_sql_info(info: &SqlStatementInfo) -> Self
pub fn from_sql_info(info: &SqlStatementInfo) -> Self
Build from SqlStatementInfo.
Trait Implementations§
Source§impl Clone for StatementEntity
impl Clone for StatementEntity
Source§fn clone(&self) -> StatementEntity
fn clone(&self) -> StatementEntity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StatementEntity
impl RefUnwindSafe for StatementEntity
impl Send for StatementEntity
impl Sync for StatementEntity
impl Unpin for StatementEntity
impl UnsafeUnpin for StatementEntity
impl UnwindSafe for StatementEntity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.