pub struct InsecureRawSql(/* private fields */);Expand description
Raw SQL that has not been escaped.
This type is for cases where you genuinely need to include raw SQL that cannot be escaped, such as SQL keywords, operators, or pre-validated static strings.
§Warning
Use this type with extreme caution. It bypasses all escaping protections. Only use it for:
- Static SQL fragments known at compile time
- SQL that has been validated through other means
§Example
use spawn_db::{sql_query, escape::{EscapedIdentifier, InsecureRawSql}};
let schema = EscapedIdentifier::new("my_schema");
let order = InsecureRawSql::new("ORDER BY created_at DESC");
let query = sql_query!(
"SELECT * FROM {}.users {}",
schema,
order
);Implementations§
Trait Implementations§
Source§impl Clone for InsecureRawSql
impl Clone for InsecureRawSql
Source§fn clone(&self) -> InsecureRawSql
fn clone(&self) -> InsecureRawSql
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 moreSource§impl Debug for InsecureRawSql
impl Debug for InsecureRawSql
Source§impl Display for InsecureRawSql
impl Display for InsecureRawSql
Source§impl Hash for InsecureRawSql
impl Hash for InsecureRawSql
Source§impl PartialEq for InsecureRawSql
impl PartialEq for InsecureRawSql
Source§impl SqlSafe for InsecureRawSql
impl SqlSafe for InsecureRawSql
impl Eq for InsecureRawSql
impl StructuralPartialEq for InsecureRawSql
Auto Trait Implementations§
impl Freeze for InsecureRawSql
impl RefUnwindSafe for InsecureRawSql
impl Send for InsecureRawSql
impl Sync for InsecureRawSql
impl Unpin for InsecureRawSql
impl UnsafeUnpin for InsecureRawSql
impl UnwindSafe for InsecureRawSql
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.