1#[cfg(not(all(target_family = "wasm", target_os = "unknown")))]
19extern crate libsqlite3_sys as ffi;
20
21#[cfg(all(target_family = "wasm", target_os = "unknown"))]
22use sqlite_wasm_rs as ffi;
23
24use super::SqliteConnection;
25
26#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateIndex<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f, "CreateIndex",
"index", &self.index, "table", &self.table, "database",
&self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateIndex<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateIndex<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateIndex<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.index == other.index && self.table == other.table &&
self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateIndex<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
28#[non_exhaustive]
29pub struct CreateIndex<'a> {
30 pub index: Option<&'a str>,
32 pub table: Option<&'a str>,
34 pub database: Option<&'a str>,
36 pub accessor: Option<&'a str>,
38}
39
40#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateTable<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "CreateTable",
"table", &self.table, "database", &self.database, "accessor",
&&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateTable<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateTable<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.table == other.table && self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateTable<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
42#[non_exhaustive]
43pub struct CreateTable<'a> {
44 pub table: Option<&'a str>,
46 pub database: Option<&'a str>,
48 pub accessor: Option<&'a str>,
50}
51
52#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateTempIndex<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f,
"CreateTempIndex", "index", &self.index, "table", &self.table,
"database", &self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateTempIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateTempIndex<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateTempIndex<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateTempIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateTempIndex<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.index == other.index && self.table == other.table &&
self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateTempIndex<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
54#[non_exhaustive]
55pub struct CreateTempIndex<'a> {
56 pub index: Option<&'a str>,
58 pub table: Option<&'a str>,
60 pub database: Option<&'a str>,
62 pub accessor: Option<&'a str>,
64}
65
66#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateTempTable<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f,
"CreateTempTable", "table", &self.table, "database",
&self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateTempTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateTempTable<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateTempTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateTempTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateTempTable<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.table == other.table && self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateTempTable<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
68#[non_exhaustive]
69pub struct CreateTempTable<'a> {
70 pub table: Option<&'a str>,
72 pub database: Option<&'a str>,
74 pub accessor: Option<&'a str>,
76}
77
78#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateTempTrigger<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f,
"CreateTempTrigger", "trigger", &self.trigger, "table",
&self.table, "database", &self.database, "accessor",
&&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateTempTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateTempTrigger<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateTempTrigger<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateTempTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateTempTrigger<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.trigger == other.trigger && self.table == other.table &&
self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateTempTrigger<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
80#[non_exhaustive]
81pub struct CreateTempTrigger<'a> {
82 pub trigger: Option<&'a str>,
84 pub table: Option<&'a str>,
86 pub database: Option<&'a str>,
88 pub accessor: Option<&'a str>,
90}
91
92#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateTempView<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f,
"CreateTempView", "view", &self.view, "database", &self.database,
"accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateTempView<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateTempView<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateTempView<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateTempView<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateTempView<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.view == other.view && self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateTempView<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
94#[non_exhaustive]
95pub struct CreateTempView<'a> {
96 pub view: Option<&'a str>,
98 pub database: Option<&'a str>,
100 pub accessor: Option<&'a str>,
102}
103
104#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateTrigger<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f, "CreateTrigger",
"trigger", &self.trigger, "table", &self.table, "database",
&self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateTrigger<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateTrigger<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateTrigger<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.trigger == other.trigger && self.table == other.table &&
self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateTrigger<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
106#[non_exhaustive]
107pub struct CreateTrigger<'a> {
108 pub trigger: Option<&'a str>,
110 pub table: Option<&'a str>,
112 pub database: Option<&'a str>,
114 pub accessor: Option<&'a str>,
116}
117
118#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateView<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "CreateView",
"view", &self.view, "database", &self.database, "accessor",
&&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateView<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateView<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateView<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateView<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateView<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.view == other.view && self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateView<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
120#[non_exhaustive]
121pub struct CreateView<'a> {
122 pub view: Option<&'a str>,
124 pub database: Option<&'a str>,
126 pub accessor: Option<&'a str>,
128}
129
130#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Delete<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "Delete",
"table", &self.table, "database", &self.database, "accessor",
&&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Delete<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Delete<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Delete<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Delete<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Delete<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.table == other.table && self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Delete<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
132#[non_exhaustive]
133pub struct Delete<'a> {
134 pub table: Option<&'a str>,
136 pub database: Option<&'a str>,
138 pub accessor: Option<&'a str>,
140}
141
142#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropIndex<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f, "DropIndex",
"index", &self.index, "table", &self.table, "database",
&self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropIndex<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropIndex<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropIndex<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.index == other.index && self.table == other.table &&
self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropIndex<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
144#[non_exhaustive]
145pub struct DropIndex<'a> {
146 pub index: Option<&'a str>,
148 pub table: Option<&'a str>,
150 pub database: Option<&'a str>,
152 pub accessor: Option<&'a str>,
154}
155
156#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropTable<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "DropTable",
"table", &self.table, "database", &self.database, "accessor",
&&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropTable<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropTable<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.table == other.table && self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropTable<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
158#[non_exhaustive]
159pub struct DropTable<'a> {
160 pub table: Option<&'a str>,
162 pub database: Option<&'a str>,
164 pub accessor: Option<&'a str>,
166}
167
168#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropTempIndex<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f, "DropTempIndex",
"index", &self.index, "table", &self.table, "database",
&self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropTempIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropTempIndex<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropTempIndex<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropTempIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropTempIndex<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.index == other.index && self.table == other.table &&
self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropTempIndex<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
170#[non_exhaustive]
171pub struct DropTempIndex<'a> {
172 pub index: Option<&'a str>,
174 pub table: Option<&'a str>,
176 pub database: Option<&'a str>,
178 pub accessor: Option<&'a str>,
180}
181
182#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropTempTable<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "DropTempTable",
"table", &self.table, "database", &self.database, "accessor",
&&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropTempTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropTempTable<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropTempTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropTempTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropTempTable<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.table == other.table && self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropTempTable<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
184#[non_exhaustive]
185pub struct DropTempTable<'a> {
186 pub table: Option<&'a str>,
188 pub database: Option<&'a str>,
190 pub accessor: Option<&'a str>,
192}
193
194#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropTempTrigger<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f,
"DropTempTrigger", "trigger", &self.trigger, "table", &self.table,
"database", &self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropTempTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropTempTrigger<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropTempTrigger<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropTempTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropTempTrigger<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.trigger == other.trigger && self.table == other.table &&
self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropTempTrigger<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
196#[non_exhaustive]
197pub struct DropTempTrigger<'a> {
198 pub trigger: Option<&'a str>,
200 pub table: Option<&'a str>,
202 pub database: Option<&'a str>,
204 pub accessor: Option<&'a str>,
206}
207
208#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropTempView<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "DropTempView",
"view", &self.view, "database", &self.database, "accessor",
&&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropTempView<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropTempView<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropTempView<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropTempView<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropTempView<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.view == other.view && self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropTempView<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
210#[non_exhaustive]
211pub struct DropTempView<'a> {
212 pub view: Option<&'a str>,
214 pub database: Option<&'a str>,
216 pub accessor: Option<&'a str>,
218}
219
220#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropTrigger<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f, "DropTrigger",
"trigger", &self.trigger, "table", &self.table, "database",
&self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropTrigger<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropTrigger<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropTrigger<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.trigger == other.trigger && self.table == other.table &&
self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropTrigger<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
222#[non_exhaustive]
223pub struct DropTrigger<'a> {
224 pub trigger: Option<&'a str>,
226 pub table: Option<&'a str>,
228 pub database: Option<&'a str>,
230 pub accessor: Option<&'a str>,
232}
233
234#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropView<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "DropView",
"view", &self.view, "database", &self.database, "accessor",
&&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropView<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropView<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropView<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropView<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropView<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.view == other.view && self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropView<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
236#[non_exhaustive]
237pub struct DropView<'a> {
238 pub view: Option<&'a str>,
240 pub database: Option<&'a str>,
242 pub accessor: Option<&'a str>,
244}
245
246#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Insert<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "Insert",
"table", &self.table, "database", &self.database, "accessor",
&&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Insert<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Insert<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Insert<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Insert<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Insert<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.table == other.table && self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Insert<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
248#[non_exhaustive]
249pub struct Insert<'a> {
250 pub table: Option<&'a str>,
252 pub database: Option<&'a str>,
254 pub accessor: Option<&'a str>,
256}
257
258#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Pragma<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f, "Pragma",
"name", &self.name, "argument", &self.argument, "database",
&self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Pragma<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Pragma<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Pragma<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Pragma<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Pragma<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.name == other.name && self.argument == other.argument &&
self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Pragma<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
260#[non_exhaustive]
261pub struct Pragma<'a> {
262 pub name: Option<&'a str>,
264 pub argument: Option<&'a str>,
266 pub database: Option<&'a str>,
268 pub accessor: Option<&'a str>,
270}
271
272#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Read<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f, "Read", "table",
&self.table, "column", &self.column, "database", &self.database,
"accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Read<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Read<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Read<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Read<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Read<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.table == other.table && self.column == other.column &&
self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Read<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
274#[non_exhaustive]
275pub struct Read<'a> {
276 pub table: Option<&'a str>,
278 pub column: Option<&'a str>,
280 pub database: Option<&'a str>,
282 pub accessor: Option<&'a str>,
284}
285
286#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Select<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Select",
"accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Select<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Select<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Select<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Select<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Select<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool { self.accessor == other.accessor }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Select<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
288#[non_exhaustive]
289pub struct Select<'a> {
290 pub accessor: Option<&'a str>,
292}
293
294#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Transaction<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Transaction",
"operation", &self.operation, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Transaction<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Transaction<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Transaction<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Transaction<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Transaction<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.operation == other.operation && self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Transaction<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
296#[non_exhaustive]
297pub struct Transaction<'a> {
298 pub operation: Option<&'a str>,
300 pub accessor: Option<&'a str>,
302}
303
304#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Update<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f, "Update",
"table", &self.table, "column", &self.column, "database",
&self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Update<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Update<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Update<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Update<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Update<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.table == other.table && self.column == other.column &&
self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Update<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
306#[non_exhaustive]
307pub struct Update<'a> {
308 pub table: Option<&'a str>,
310 pub column: Option<&'a str>,
312 pub database: Option<&'a str>,
314 pub accessor: Option<&'a str>,
316}
317
318#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Attach<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Attach",
"filename", &self.filename, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Attach<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Attach<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Attach<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Attach<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Attach<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.filename == other.filename && self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Attach<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
320#[non_exhaustive]
321pub struct Attach<'a> {
322 pub filename: Option<&'a str>,
324 pub accessor: Option<&'a str>,
326}
327
328#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Detach<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Detach",
"database", &self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Detach<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Detach<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Detach<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Detach<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Detach<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.database == other.database && self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Detach<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
330#[non_exhaustive]
331pub struct Detach<'a> {
332 pub database: Option<&'a str>,
334 pub accessor: Option<&'a str>,
336}
337
338#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for AlterTable<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "AlterTable",
"database", &self.database, "table", &self.table, "accessor",
&&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for AlterTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for AlterTable<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for AlterTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for AlterTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for AlterTable<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.database == other.database && self.table == other.table &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for AlterTable<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
340#[non_exhaustive]
341pub struct AlterTable<'a> {
342 pub database: Option<&'a str>,
344 pub table: Option<&'a str>,
346 pub accessor: Option<&'a str>,
348}
349
350#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Reindex<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "Reindex",
"index", &self.index, "database", &self.database, "accessor",
&&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Reindex<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Reindex<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Reindex<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Reindex<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Reindex<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.index == other.index && self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Reindex<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
352#[non_exhaustive]
353pub struct Reindex<'a> {
354 pub index: Option<&'a str>,
356 pub database: Option<&'a str>,
358 pub accessor: Option<&'a str>,
360}
361
362#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Analyze<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "Analyze",
"table", &self.table, "database", &self.database, "accessor",
&&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Analyze<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Analyze<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Analyze<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Analyze<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Analyze<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.table == other.table && self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Analyze<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
364#[non_exhaustive]
365pub struct Analyze<'a> {
366 pub table: Option<&'a str>,
368 pub database: Option<&'a str>,
370 pub accessor: Option<&'a str>,
372}
373
374#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateVTable<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f, "CreateVTable",
"table", &self.table, "module", &self.module, "database",
&self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateVTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateVTable<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateVTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateVTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateVTable<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.table == other.table && self.module == other.module &&
self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateVTable<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
376#[non_exhaustive]
377pub struct CreateVTable<'a> {
378 pub table: Option<&'a str>,
380 pub module: Option<&'a str>,
382 pub database: Option<&'a str>,
384 pub accessor: Option<&'a str>,
386}
387
388#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropVTable<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f, "DropVTable",
"table", &self.table, "module", &self.module, "database",
&self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropVTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropVTable<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropVTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropVTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropVTable<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.table == other.table && self.module == other.module &&
self.database == other.database &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropVTable<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
390#[non_exhaustive]
391pub struct DropVTable<'a> {
392 pub table: Option<&'a str>,
394 pub module: Option<&'a str>,
396 pub database: Option<&'a str>,
398 pub accessor: Option<&'a str>,
400}
401
402#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Function<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Function",
"function", &self.function, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Function<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Function<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Function<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Function<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Function<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.function == other.function && self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Function<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
404#[non_exhaustive]
405pub struct Function<'a> {
406 pub function: Option<&'a str>,
408 pub accessor: Option<&'a str>,
410}
411
412#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Savepoint<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "Savepoint",
"operation", &self.operation, "name", &self.name, "accessor",
&&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Savepoint<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Savepoint<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Savepoint<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Savepoint<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Savepoint<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.operation == other.operation && self.name == other.name &&
self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Savepoint<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
414#[non_exhaustive]
415pub struct Savepoint<'a> {
416 pub operation: Option<&'a str>,
418 pub name: Option<&'a str>,
420 pub accessor: Option<&'a str>,
422}
423
424#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Recursive<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Recursive",
"accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Recursive<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Recursive<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Recursive<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Recursive<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Recursive<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool { self.accessor == other.accessor }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Recursive<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
426#[non_exhaustive]
427pub struct Recursive<'a> {
428 pub accessor: Option<&'a str>,
430}
431
432#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Unknown<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field5_finish(f, "Unknown",
"code", &self.code, "arg1", &self.arg1, "arg2", &self.arg2,
"database", &self.database, "accessor", &&self.accessor)
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Unknown<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Unknown<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<i32>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Unknown<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Unknown<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Unknown<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.code == other.code && self.arg1 == other.arg1 &&
self.arg2 == other.arg2 && self.database == other.database
&& self.accessor == other.accessor
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Unknown<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<i32>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
}
}Eq)]
436#[non_exhaustive]
437pub struct Unknown<'a> {
438 pub code: i32,
440 pub arg1: Option<&'a str>,
442 pub arg2: Option<&'a str>,
444 pub database: Option<&'a str>,
446 pub accessor: Option<&'a str>,
448}
449
450#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for AuthorizerContext<'a> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
Self::CreateIndex(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"CreateIndex", &__self_0),
Self::CreateTable(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"CreateTable", &__self_0),
Self::CreateTempIndex(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"CreateTempIndex", &__self_0),
Self::CreateTempTable(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"CreateTempTable", &__self_0),
Self::CreateTempTrigger(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"CreateTempTrigger", &__self_0),
Self::CreateTempView(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"CreateTempView", &__self_0),
Self::CreateTrigger(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"CreateTrigger", &__self_0),
Self::CreateView(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"CreateView", &__self_0),
Self::Delete(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Delete",
&__self_0),
Self::DropIndex(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"DropIndex", &__self_0),
Self::DropTable(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"DropTable", &__self_0),
Self::DropTempIndex(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"DropTempIndex", &__self_0),
Self::DropTempTable(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"DropTempTable", &__self_0),
Self::DropTempTrigger(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"DropTempTrigger", &__self_0),
Self::DropTempView(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"DropTempView", &__self_0),
Self::DropTrigger(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"DropTrigger", &__self_0),
Self::DropView(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"DropView", &__self_0),
Self::Insert(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Insert",
&__self_0),
Self::Pragma(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Pragma",
&__self_0),
Self::Read(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Read",
&__self_0),
Self::Select(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Select",
&__self_0),
Self::Transaction(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"Transaction", &__self_0),
Self::Update(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Update",
&__self_0),
Self::Attach(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Attach",
&__self_0),
Self::Detach(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Detach",
&__self_0),
Self::AlterTable(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"AlterTable", &__self_0),
Self::Reindex(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"Reindex", &__self_0),
Self::Analyze(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"Analyze", &__self_0),
Self::CreateVTable(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"CreateVTable", &__self_0),
Self::DropVTable(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"DropVTable", &__self_0),
Self::Function(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"Function", &__self_0),
Self::Savepoint(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"Savepoint", &__self_0),
Self::Recursive(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"Recursive", &__self_0),
Self::Unknown(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"Unknown", &__self_0),
}
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for AuthorizerContext<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for AuthorizerContext<'a> {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<CreateIndex<'a>>;
let _: ::core::clone::AssertParamIsClone<CreateTable<'a>>;
let _: ::core::clone::AssertParamIsClone<CreateTempIndex<'a>>;
let _: ::core::clone::AssertParamIsClone<CreateTempTable<'a>>;
let _: ::core::clone::AssertParamIsClone<CreateTempTrigger<'a>>;
let _: ::core::clone::AssertParamIsClone<CreateTempView<'a>>;
let _: ::core::clone::AssertParamIsClone<CreateTrigger<'a>>;
let _: ::core::clone::AssertParamIsClone<CreateView<'a>>;
let _: ::core::clone::AssertParamIsClone<Delete<'a>>;
let _: ::core::clone::AssertParamIsClone<DropIndex<'a>>;
let _: ::core::clone::AssertParamIsClone<DropTable<'a>>;
let _: ::core::clone::AssertParamIsClone<DropTempIndex<'a>>;
let _: ::core::clone::AssertParamIsClone<DropTempTable<'a>>;
let _: ::core::clone::AssertParamIsClone<DropTempTrigger<'a>>;
let _: ::core::clone::AssertParamIsClone<DropTempView<'a>>;
let _: ::core::clone::AssertParamIsClone<DropTrigger<'a>>;
let _: ::core::clone::AssertParamIsClone<DropView<'a>>;
let _: ::core::clone::AssertParamIsClone<Insert<'a>>;
let _: ::core::clone::AssertParamIsClone<Pragma<'a>>;
let _: ::core::clone::AssertParamIsClone<Read<'a>>;
let _: ::core::clone::AssertParamIsClone<Select<'a>>;
let _: ::core::clone::AssertParamIsClone<Transaction<'a>>;
let _: ::core::clone::AssertParamIsClone<Update<'a>>;
let _: ::core::clone::AssertParamIsClone<Attach<'a>>;
let _: ::core::clone::AssertParamIsClone<Detach<'a>>;
let _: ::core::clone::AssertParamIsClone<AlterTable<'a>>;
let _: ::core::clone::AssertParamIsClone<Reindex<'a>>;
let _: ::core::clone::AssertParamIsClone<Analyze<'a>>;
let _: ::core::clone::AssertParamIsClone<CreateVTable<'a>>;
let _: ::core::clone::AssertParamIsClone<DropVTable<'a>>;
let _: ::core::clone::AssertParamIsClone<Function<'a>>;
let _: ::core::clone::AssertParamIsClone<Savepoint<'a>>;
let _: ::core::clone::AssertParamIsClone<Recursive<'a>>;
let _: ::core::clone::AssertParamIsClone<Unknown<'a>>;
*self
}
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for AuthorizerContext<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for AuthorizerContext<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for AuthorizerContext<'a> {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other) &&
match (self, other) {
(Self::CreateIndex(__self_0), Self::CreateIndex(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::CreateTable(__self_0), Self::CreateTable(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::CreateTempIndex(__self_0),
Self::CreateTempIndex(__arg1_0)) => __self_0 == __arg1_0,
(Self::CreateTempTable(__self_0),
Self::CreateTempTable(__arg1_0)) => __self_0 == __arg1_0,
(Self::CreateTempTrigger(__self_0),
Self::CreateTempTrigger(__arg1_0)) => __self_0 == __arg1_0,
(Self::CreateTempView(__self_0),
Self::CreateTempView(__arg1_0)) => __self_0 == __arg1_0,
(Self::CreateTrigger(__self_0), Self::CreateTrigger(__arg1_0))
=> __self_0 == __arg1_0,
(Self::CreateView(__self_0), Self::CreateView(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Delete(__self_0), Self::Delete(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::DropIndex(__self_0), Self::DropIndex(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::DropTable(__self_0), Self::DropTable(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::DropTempIndex(__self_0), Self::DropTempIndex(__arg1_0))
=> __self_0 == __arg1_0,
(Self::DropTempTable(__self_0), Self::DropTempTable(__arg1_0))
=> __self_0 == __arg1_0,
(Self::DropTempTrigger(__self_0),
Self::DropTempTrigger(__arg1_0)) => __self_0 == __arg1_0,
(Self::DropTempView(__self_0), Self::DropTempView(__arg1_0))
=> __self_0 == __arg1_0,
(Self::DropTrigger(__self_0), Self::DropTrigger(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::DropView(__self_0), Self::DropView(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Insert(__self_0), Self::Insert(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Pragma(__self_0), Self::Pragma(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Read(__self_0), Self::Read(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Select(__self_0), Self::Select(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Transaction(__self_0), Self::Transaction(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Update(__self_0), Self::Update(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Attach(__self_0), Self::Attach(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Detach(__self_0), Self::Detach(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::AlterTable(__self_0), Self::AlterTable(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Reindex(__self_0), Self::Reindex(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Analyze(__self_0), Self::Analyze(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::CreateVTable(__self_0), Self::CreateVTable(__arg1_0))
=> __self_0 == __arg1_0,
(Self::DropVTable(__self_0), Self::DropVTable(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Function(__self_0), Self::Function(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Savepoint(__self_0), Self::Savepoint(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Recursive(__self_0), Self::Recursive(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Unknown(__self_0), Self::Unknown(__arg1_0)) =>
__self_0 == __arg1_0,
_ => unsafe { ::core::intrinsics::unreachable() }
}
}
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for AuthorizerContext<'a> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<CreateIndex<'a>>;
let _: ::core::cmp::AssertParamIsEq<CreateTable<'a>>;
let _: ::core::cmp::AssertParamIsEq<CreateTempIndex<'a>>;
let _: ::core::cmp::AssertParamIsEq<CreateTempTable<'a>>;
let _: ::core::cmp::AssertParamIsEq<CreateTempTrigger<'a>>;
let _: ::core::cmp::AssertParamIsEq<CreateTempView<'a>>;
let _: ::core::cmp::AssertParamIsEq<CreateTrigger<'a>>;
let _: ::core::cmp::AssertParamIsEq<CreateView<'a>>;
let _: ::core::cmp::AssertParamIsEq<Delete<'a>>;
let _: ::core::cmp::AssertParamIsEq<DropIndex<'a>>;
let _: ::core::cmp::AssertParamIsEq<DropTable<'a>>;
let _: ::core::cmp::AssertParamIsEq<DropTempIndex<'a>>;
let _: ::core::cmp::AssertParamIsEq<DropTempTable<'a>>;
let _: ::core::cmp::AssertParamIsEq<DropTempTrigger<'a>>;
let _: ::core::cmp::AssertParamIsEq<DropTempView<'a>>;
let _: ::core::cmp::AssertParamIsEq<DropTrigger<'a>>;
let _: ::core::cmp::AssertParamIsEq<DropView<'a>>;
let _: ::core::cmp::AssertParamIsEq<Insert<'a>>;
let _: ::core::cmp::AssertParamIsEq<Pragma<'a>>;
let _: ::core::cmp::AssertParamIsEq<Read<'a>>;
let _: ::core::cmp::AssertParamIsEq<Select<'a>>;
let _: ::core::cmp::AssertParamIsEq<Transaction<'a>>;
let _: ::core::cmp::AssertParamIsEq<Update<'a>>;
let _: ::core::cmp::AssertParamIsEq<Attach<'a>>;
let _: ::core::cmp::AssertParamIsEq<Detach<'a>>;
let _: ::core::cmp::AssertParamIsEq<AlterTable<'a>>;
let _: ::core::cmp::AssertParamIsEq<Reindex<'a>>;
let _: ::core::cmp::AssertParamIsEq<Analyze<'a>>;
let _: ::core::cmp::AssertParamIsEq<CreateVTable<'a>>;
let _: ::core::cmp::AssertParamIsEq<DropVTable<'a>>;
let _: ::core::cmp::AssertParamIsEq<Function<'a>>;
let _: ::core::cmp::AssertParamIsEq<Savepoint<'a>>;
let _: ::core::cmp::AssertParamIsEq<Recursive<'a>>;
let _: ::core::cmp::AssertParamIsEq<Unknown<'a>>;
}
}Eq)]
459#[non_exhaustive]
460pub enum AuthorizerContext<'a> {
461 CreateIndex(CreateIndex<'a>),
463 CreateTable(CreateTable<'a>),
465 CreateTempIndex(CreateTempIndex<'a>),
467 CreateTempTable(CreateTempTable<'a>),
469 CreateTempTrigger(CreateTempTrigger<'a>),
471 CreateTempView(CreateTempView<'a>),
473 CreateTrigger(CreateTrigger<'a>),
475 CreateView(CreateView<'a>),
477 Delete(Delete<'a>),
479 DropIndex(DropIndex<'a>),
481 DropTable(DropTable<'a>),
483 DropTempIndex(DropTempIndex<'a>),
485 DropTempTable(DropTempTable<'a>),
487 DropTempTrigger(DropTempTrigger<'a>),
489 DropTempView(DropTempView<'a>),
491 DropTrigger(DropTrigger<'a>),
493 DropView(DropView<'a>),
495 Insert(Insert<'a>),
497 Pragma(Pragma<'a>),
499 Read(Read<'a>),
501 Select(Select<'a>),
503 Transaction(Transaction<'a>),
505 Update(Update<'a>),
507 Attach(Attach<'a>),
509 Detach(Detach<'a>),
511 AlterTable(AlterTable<'a>),
513 Reindex(Reindex<'a>),
515 Analyze(Analyze<'a>),
517 CreateVTable(CreateVTable<'a>),
519 DropVTable(DropVTable<'a>),
521 Function(Function<'a>),
523 Savepoint(Savepoint<'a>),
525 Recursive(Recursive<'a>),
527 Unknown(Unknown<'a>),
529}
530
531impl<'a> AuthorizerContext<'a> {
532 pub fn is_schema_modifying(&self) -> bool {
553 #[allow(non_exhaustive_omitted_patterns)] match self {
Self::CreateIndex(_) | Self::CreateTable(_) | Self::CreateTempIndex(_) |
Self::CreateTempTable(_) | Self::CreateTempTrigger(_) |
Self::CreateTempView(_) | Self::CreateTrigger(_) | Self::CreateView(_)
| Self::CreateVTable(_) | Self::DropIndex(_) | Self::DropTable(_) |
Self::DropTempIndex(_) | Self::DropTempTable(_) |
Self::DropTempTrigger(_) | Self::DropTempView(_) |
Self::DropTrigger(_) | Self::DropView(_) | Self::DropVTable(_) |
Self::AlterTable(_) => true,
_ => false,
}matches!(
554 self,
555 Self::CreateIndex(_)
556 | Self::CreateTable(_)
557 | Self::CreateTempIndex(_)
558 | Self::CreateTempTable(_)
559 | Self::CreateTempTrigger(_)
560 | Self::CreateTempView(_)
561 | Self::CreateTrigger(_)
562 | Self::CreateView(_)
563 | Self::CreateVTable(_)
564 | Self::DropIndex(_)
565 | Self::DropTable(_)
566 | Self::DropTempIndex(_)
567 | Self::DropTempTable(_)
568 | Self::DropTempTrigger(_)
569 | Self::DropTempView(_)
570 | Self::DropTrigger(_)
571 | Self::DropView(_)
572 | Self::DropVTable(_)
573 | Self::AlterTable(_)
574 )
575 }
576
577 pub(crate) fn from_ffi(
584 code: i32,
585 arg1: Option<&'a str>,
586 arg2: Option<&'a str>,
587 database: Option<&'a str>,
588 accessor: Option<&'a str>,
589 ) -> Self {
590 match code {
591 ffi::SQLITE_CREATE_INDEX => Self::CreateIndex(CreateIndex {
592 index: arg1,
593 table: arg2,
594 database,
595 accessor,
596 }),
597 ffi::SQLITE_CREATE_TABLE => Self::CreateTable(CreateTable {
598 table: arg1,
599 database,
600 accessor,
601 }),
602 ffi::SQLITE_CREATE_TEMP_INDEX => Self::CreateTempIndex(CreateTempIndex {
603 index: arg1,
604 table: arg2,
605 database,
606 accessor,
607 }),
608 ffi::SQLITE_CREATE_TEMP_TABLE => Self::CreateTempTable(CreateTempTable {
609 table: arg1,
610 database,
611 accessor,
612 }),
613 ffi::SQLITE_CREATE_TEMP_TRIGGER => Self::CreateTempTrigger(CreateTempTrigger {
614 trigger: arg1,
615 table: arg2,
616 database,
617 accessor,
618 }),
619 ffi::SQLITE_CREATE_TEMP_VIEW => Self::CreateTempView(CreateTempView {
620 view: arg1,
621 database,
622 accessor,
623 }),
624 ffi::SQLITE_CREATE_TRIGGER => Self::CreateTrigger(CreateTrigger {
625 trigger: arg1,
626 table: arg2,
627 database,
628 accessor,
629 }),
630 ffi::SQLITE_CREATE_VIEW => Self::CreateView(CreateView {
631 view: arg1,
632 database,
633 accessor,
634 }),
635 ffi::SQLITE_DELETE => Self::Delete(Delete {
636 table: arg1,
637 database,
638 accessor,
639 }),
640 ffi::SQLITE_DROP_INDEX => Self::DropIndex(DropIndex {
641 index: arg1,
642 table: arg2,
643 database,
644 accessor,
645 }),
646 ffi::SQLITE_DROP_TABLE => Self::DropTable(DropTable {
647 table: arg1,
648 database,
649 accessor,
650 }),
651 ffi::SQLITE_DROP_TEMP_INDEX => Self::DropTempIndex(DropTempIndex {
652 index: arg1,
653 table: arg2,
654 database,
655 accessor,
656 }),
657 ffi::SQLITE_DROP_TEMP_TABLE => Self::DropTempTable(DropTempTable {
658 table: arg1,
659 database,
660 accessor,
661 }),
662 ffi::SQLITE_DROP_TEMP_TRIGGER => Self::DropTempTrigger(DropTempTrigger {
663 trigger: arg1,
664 table: arg2,
665 database,
666 accessor,
667 }),
668 ffi::SQLITE_DROP_TEMP_VIEW => Self::DropTempView(DropTempView {
669 view: arg1,
670 database,
671 accessor,
672 }),
673 ffi::SQLITE_DROP_TRIGGER => Self::DropTrigger(DropTrigger {
674 trigger: arg1,
675 table: arg2,
676 database,
677 accessor,
678 }),
679 ffi::SQLITE_DROP_VIEW => Self::DropView(DropView {
680 view: arg1,
681 database,
682 accessor,
683 }),
684 ffi::SQLITE_INSERT => Self::Insert(Insert {
685 table: arg1,
686 database,
687 accessor,
688 }),
689 ffi::SQLITE_PRAGMA => Self::Pragma(Pragma {
690 name: arg1,
691 argument: arg2,
692 database,
693 accessor,
694 }),
695 ffi::SQLITE_READ => Self::Read(Read {
696 table: arg1,
697 column: arg2,
698 database,
699 accessor,
700 }),
701 ffi::SQLITE_SELECT => Self::Select(Select { accessor }),
702 ffi::SQLITE_TRANSACTION => Self::Transaction(Transaction {
703 operation: arg1,
704 accessor,
705 }),
706 ffi::SQLITE_UPDATE => Self::Update(Update {
707 table: arg1,
708 column: arg2,
709 database,
710 accessor,
711 }),
712 ffi::SQLITE_ATTACH => Self::Attach(Attach {
713 filename: arg1,
714 accessor,
715 }),
716 ffi::SQLITE_DETACH => Self::Detach(Detach {
717 database: arg1,
718 accessor,
719 }),
720 ffi::SQLITE_ALTER_TABLE => Self::AlterTable(AlterTable {
721 database: arg1,
722 table: arg2,
723 accessor,
724 }),
725 ffi::SQLITE_REINDEX => Self::Reindex(Reindex {
726 index: arg1,
727 database,
728 accessor,
729 }),
730 ffi::SQLITE_ANALYZE => Self::Analyze(Analyze {
731 table: arg1,
732 database,
733 accessor,
734 }),
735 ffi::SQLITE_CREATE_VTABLE => Self::CreateVTable(CreateVTable {
736 table: arg1,
737 module: arg2,
738 database,
739 accessor,
740 }),
741 ffi::SQLITE_DROP_VTABLE => Self::DropVTable(DropVTable {
742 table: arg1,
743 module: arg2,
744 database,
745 accessor,
746 }),
747 ffi::SQLITE_FUNCTION => Self::Function(Function {
748 function: arg2,
749 accessor,
750 }),
751 ffi::SQLITE_SAVEPOINT => Self::Savepoint(Savepoint {
752 operation: arg1,
753 name: arg2,
754 accessor,
755 }),
756 ffi::SQLITE_RECURSIVE => Self::Recursive(Recursive { accessor }),
757 other => Self::Unknown(Unknown {
758 code: other,
759 arg1,
760 arg2,
761 database,
762 accessor,
763 }),
764 }
765 }
766}
767
768#[derive(#[automatically_derived]
impl ::core::fmt::Debug for AuthorizerDecision {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
AuthorizerDecision::Allow => "Allow",
AuthorizerDecision::Ignore => "Ignore",
AuthorizerDecision::Deny => "Deny",
})
}
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for AuthorizerDecision { }
#[automatically_derived]
impl ::core::clone::Clone for AuthorizerDecision {
#[inline]
fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for AuthorizerDecision { }Copy, #[automatically_derived]
impl ::core::marker::StructuralPartialEq for AuthorizerDecision { }
#[automatically_derived]
impl ::core::cmp::PartialEq for AuthorizerDecision {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other)
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for AuthorizerDecision { }Eq)]
773pub enum AuthorizerDecision {
774 Allow,
776 Ignore,
781 Deny,
785}
786
787impl AuthorizerDecision {
788 pub(crate) fn to_ffi(self) -> i32 {
790 match self {
791 Self::Allow => ffi::SQLITE_OK,
792 Self::Ignore => ffi::SQLITE_IGNORE,
793 Self::Deny => ffi::SQLITE_DENY,
794 }
795 }
796}
797
798impl SqliteConnection {
799 pub fn on_authorize<F>(&mut self, hook: F)
845 where
846 F: FnMut(AuthorizerContext<'_>) -> AuthorizerDecision + Send + 'static,
847 {
848 self.raw_connection.set_authorizer(hook);
853 self.statement_cache.clear();
857 }
858
859 pub fn remove_authorizer(&mut self) {
863 self.raw_connection.remove_authorizer();
864 self.statement_cache.clear();
872 }
873}
874
875#[cfg(all(test, not(miri)))]
877mod tests {
878 use super::*;
879 use crate::connection::Connection;
880 use crate::query_dsl::RunQueryDsl;
881 use std::sync::Arc;
882 use std::sync::atomic::{AtomicU32, Ordering};
883
884 fn connection() -> SqliteConnection {
885 SqliteConnection::establish(":memory:").unwrap()
886 }
887
888 #[diesel_test_helper::test]
889 fn on_authorize_deny_rejects_statement() {
890 let conn = &mut connection();
891 crate::sql_query("CREATE TABLE auth_basic (id INTEGER PRIMARY KEY)")
892 .execute(conn)
893 .unwrap();
894
895 let calls = Arc::new(AtomicU32::new(0));
896 let calls2 = calls.clone();
897
898 conn.on_authorize(move |_ctx| {
899 calls2.fetch_add(1, Ordering::Relaxed);
900 AuthorizerDecision::Deny
901 });
902
903 let denied = crate::sql_query("SELECT id FROM auth_basic").execute(conn);
906 assert!(denied.is_err(), "a denied statement should fail to prepare");
907 assert!(
908 calls.load(Ordering::Relaxed) > 0,
909 "the authorizer callback should have been invoked"
910 );
911
912 conn.remove_authorizer();
914 crate::sql_query("SELECT id FROM auth_basic")
915 .execute(conn)
916 .unwrap();
917 }
918
919 #[diesel_test_helper::test]
920 fn remove_authorizer_re_prepares_cached_statements() {
921 use crate::prelude::*;
922 use crate::sqlite::AuthorizerContext;
923
924 crate::table! {
925 auth_ignore_items (id) {
926 id -> Integer,
927 }
928 }
929
930 let conn = &mut connection();
931 crate::sql_query("CREATE TABLE auth_ignore_items (id INTEGER PRIMARY KEY)")
932 .execute(conn)
933 .unwrap();
934 crate::sql_query("INSERT INTO auth_ignore_items (id) VALUES (42)")
935 .execute(conn)
936 .unwrap();
937
938 conn.on_authorize(|ctx| match ctx {
942 AuthorizerContext::Read(_) => AuthorizerDecision::Ignore,
943 _ => AuthorizerDecision::Allow,
944 });
945 let ignored = auth_ignore_items::table
946 .select(auth_ignore_items::id.nullable())
947 .load::<Option<i32>>(conn)
948 .unwrap();
949 assert_eq!(
950 ignored,
951 vec![None],
952 "Ignore substitutes NULL for the column"
953 );
954
955 conn.remove_authorizer();
959 let restored = auth_ignore_items::table
960 .select(auth_ignore_items::id.nullable())
961 .load::<Option<i32>>(conn)
962 .unwrap();
963 assert_eq!(
964 restored,
965 vec![Some(42)],
966 "after removing the authorizer the real value is returned"
967 );
968 }
969
970 #[diesel_test_helper::test]
971 fn on_authorize_re_prepares_cached_statements() {
972 use crate::prelude::*;
973 use crate::sqlite::AuthorizerContext;
974
975 crate::table! {
976 auth_replace_items (id) {
977 id -> Integer,
978 }
979 }
980
981 let conn = &mut connection();
982 crate::sql_query("CREATE TABLE auth_replace_items (id INTEGER PRIMARY KEY)")
983 .execute(conn)
984 .unwrap();
985 crate::sql_query("INSERT INTO auth_replace_items (id) VALUES (42)")
986 .execute(conn)
987 .unwrap();
988
989 conn.on_authorize(|_ctx| AuthorizerDecision::Allow);
992 let allowed = auth_replace_items::table
993 .select(auth_replace_items::id.nullable())
994 .load::<Option<i32>>(conn)
995 .unwrap();
996 assert_eq!(
997 allowed,
998 vec![Some(42)],
999 "the allow-all authorizer returns the real value"
1000 );
1001
1002 conn.on_authorize(|ctx| match ctx {
1008 AuthorizerContext::Read(_) => AuthorizerDecision::Ignore,
1009 _ => AuthorizerDecision::Allow,
1010 });
1011 let ignored = auth_replace_items::table
1012 .select(auth_replace_items::id.nullable())
1013 .load::<Option<i32>>(conn)
1014 .unwrap();
1015 assert_eq!(
1016 ignored,
1017 vec![None],
1018 "after replacing the authorizer the new decision takes effect"
1019 );
1020 }
1021}