Skip to main content

diesel/sqlite/connection/
authorizer.rs

1//! Types for the SQLite authorizer callback.
2//!
3//! See [`sqlite3_set_authorizer`](https://sqlite.org/c3ref/set_authorizer.html)
4//! and the [action code constants](https://sqlite.org/c3ref/c_alter_table.html).
5//!
6//! The authorizer callback receives an [`AuthorizerContext`]. It is an enum
7//! with one variant per SQLite action code, and every variant carries the
8//! arguments for that action under descriptive field names, so there is no
9//! need to consult a table of what each positional argument means.
10//!
11//! Two fields recur across variants. `database` is the name of the database
12//! (`"main"`, `"temp"`, or an `ATTACH` alias) an object lives in, when SQLite
13//! reports it. `accessor` is the name of the inner-most trigger or view
14//! responsible for the access, or `None` when the access is directly from
15//! top-level SQL. A string argument is `None` when SQLite passes `NULL` or a
16//! value that is not valid UTF-8.
17
18#[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
24/// Authorizing a `CREATE INDEX` statement.
25#[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]
impl<'a> ::core::clone::Clone for CreateIndex<'a> {
    #[inline]
    fn clone(&self) -> CreateIndex<'a> {
        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::cmp::PartialEq for CreateIndex<'a> {
    #[inline]
    fn eq(&self, other: &CreateIndex<'a>) -> 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)]
26#[non_exhaustive]
27pub struct CreateIndex<'a> {
28    /// Name of the index being created.
29    pub index: Option<&'a str>,
30    /// Name of the table the index is created on.
31    pub table: Option<&'a str>,
32    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
33    pub database: Option<&'a str>,
34    /// Inner-most trigger or view responsible for the access, if any.
35    pub accessor: Option<&'a str>,
36}
37
38/// Authorizing a `CREATE TABLE` statement.
39#[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]
impl<'a> ::core::clone::Clone for CreateTable<'a> {
    #[inline]
    fn clone(&self) -> CreateTable<'a> {
        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::cmp::PartialEq for CreateTable<'a> {
    #[inline]
    fn eq(&self, other: &CreateTable<'a>) -> 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)]
40#[non_exhaustive]
41pub struct CreateTable<'a> {
42    /// Name of the table being created.
43    pub table: Option<&'a str>,
44    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
45    pub database: Option<&'a str>,
46    /// Inner-most trigger or view responsible for the access, if any.
47    pub accessor: Option<&'a str>,
48}
49
50/// Authorizing a `CREATE TEMP INDEX` statement.
51#[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]
impl<'a> ::core::clone::Clone for CreateTempIndex<'a> {
    #[inline]
    fn clone(&self) -> CreateTempIndex<'a> {
        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::cmp::PartialEq for CreateTempIndex<'a> {
    #[inline]
    fn eq(&self, other: &CreateTempIndex<'a>) -> 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)]
52#[non_exhaustive]
53pub struct CreateTempIndex<'a> {
54    /// Name of the index being created.
55    pub index: Option<&'a str>,
56    /// Name of the table the index is created on.
57    pub table: Option<&'a str>,
58    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
59    pub database: Option<&'a str>,
60    /// Inner-most trigger or view responsible for the access, if any.
61    pub accessor: Option<&'a str>,
62}
63
64/// Authorizing a `CREATE TEMP TABLE` statement.
65#[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]
impl<'a> ::core::clone::Clone for CreateTempTable<'a> {
    #[inline]
    fn clone(&self) -> CreateTempTable<'a> {
        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::cmp::PartialEq for CreateTempTable<'a> {
    #[inline]
    fn eq(&self, other: &CreateTempTable<'a>) -> 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)]
66#[non_exhaustive]
67pub struct CreateTempTable<'a> {
68    /// Name of the table being created.
69    pub table: Option<&'a str>,
70    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
71    pub database: Option<&'a str>,
72    /// Inner-most trigger or view responsible for the access, if any.
73    pub accessor: Option<&'a str>,
74}
75
76/// Authorizing a `CREATE TEMP TRIGGER` statement.
77#[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]
impl<'a> ::core::clone::Clone for CreateTempTrigger<'a> {
    #[inline]
    fn clone(&self) -> CreateTempTrigger<'a> {
        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::cmp::PartialEq for CreateTempTrigger<'a> {
    #[inline]
    fn eq(&self, other: &CreateTempTrigger<'a>) -> 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)]
78#[non_exhaustive]
79pub struct CreateTempTrigger<'a> {
80    /// Name of the trigger being created.
81    pub trigger: Option<&'a str>,
82    /// Name of the table the trigger is attached to.
83    pub table: Option<&'a str>,
84    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
85    pub database: Option<&'a str>,
86    /// Inner-most trigger or view responsible for the access, if any.
87    pub accessor: Option<&'a str>,
88}
89
90/// Authorizing a `CREATE TEMP VIEW` statement.
91#[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]
impl<'a> ::core::clone::Clone for CreateTempView<'a> {
    #[inline]
    fn clone(&self) -> CreateTempView<'a> {
        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::cmp::PartialEq for CreateTempView<'a> {
    #[inline]
    fn eq(&self, other: &CreateTempView<'a>) -> 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)]
92#[non_exhaustive]
93pub struct CreateTempView<'a> {
94    /// Name of the view being created.
95    pub view: Option<&'a str>,
96    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
97    pub database: Option<&'a str>,
98    /// Inner-most trigger or view responsible for the access, if any.
99    pub accessor: Option<&'a str>,
100}
101
102/// Authorizing a `CREATE TRIGGER` statement.
103#[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]
impl<'a> ::core::clone::Clone for CreateTrigger<'a> {
    #[inline]
    fn clone(&self) -> CreateTrigger<'a> {
        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::cmp::PartialEq for CreateTrigger<'a> {
    #[inline]
    fn eq(&self, other: &CreateTrigger<'a>) -> 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)]
104#[non_exhaustive]
105pub struct CreateTrigger<'a> {
106    /// Name of the trigger being created.
107    pub trigger: Option<&'a str>,
108    /// Name of the table the trigger is attached to.
109    pub table: Option<&'a str>,
110    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
111    pub database: Option<&'a str>,
112    /// Inner-most trigger or view responsible for the access, if any.
113    pub accessor: Option<&'a str>,
114}
115
116/// Authorizing a `CREATE VIEW` statement.
117#[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]
impl<'a> ::core::clone::Clone for CreateView<'a> {
    #[inline]
    fn clone(&self) -> CreateView<'a> {
        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::cmp::PartialEq for CreateView<'a> {
    #[inline]
    fn eq(&self, other: &CreateView<'a>) -> 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)]
118#[non_exhaustive]
119pub struct CreateView<'a> {
120    /// Name of the view being created.
121    pub view: Option<&'a str>,
122    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
123    pub database: Option<&'a str>,
124    /// Inner-most trigger or view responsible for the access, if any.
125    pub accessor: Option<&'a str>,
126}
127
128/// Authorizing a `DELETE` statement.
129#[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]
impl<'a> ::core::clone::Clone for Delete<'a> {
    #[inline]
    fn clone(&self) -> Delete<'a> {
        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::cmp::PartialEq for Delete<'a> {
    #[inline]
    fn eq(&self, other: &Delete<'a>) -> 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)]
130#[non_exhaustive]
131pub struct Delete<'a> {
132    /// Name of the table rows are deleted from.
133    pub table: Option<&'a str>,
134    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
135    pub database: Option<&'a str>,
136    /// Inner-most trigger or view responsible for the access, if any.
137    pub accessor: Option<&'a str>,
138}
139
140/// Authorizing a `DROP INDEX` statement.
141#[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]
impl<'a> ::core::clone::Clone for DropIndex<'a> {
    #[inline]
    fn clone(&self) -> DropIndex<'a> {
        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::cmp::PartialEq for DropIndex<'a> {
    #[inline]
    fn eq(&self, other: &DropIndex<'a>) -> 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)]
142#[non_exhaustive]
143pub struct DropIndex<'a> {
144    /// Name of the index being dropped.
145    pub index: Option<&'a str>,
146    /// Name of the table the index belongs to.
147    pub table: Option<&'a str>,
148    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
149    pub database: Option<&'a str>,
150    /// Inner-most trigger or view responsible for the access, if any.
151    pub accessor: Option<&'a str>,
152}
153
154/// Authorizing a `DROP TABLE` statement.
155#[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]
impl<'a> ::core::clone::Clone for DropTable<'a> {
    #[inline]
    fn clone(&self) -> DropTable<'a> {
        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::cmp::PartialEq for DropTable<'a> {
    #[inline]
    fn eq(&self, other: &DropTable<'a>) -> 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)]
156#[non_exhaustive]
157pub struct DropTable<'a> {
158    /// Name of the table being dropped.
159    pub table: Option<&'a str>,
160    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
161    pub database: Option<&'a str>,
162    /// Inner-most trigger or view responsible for the access, if any.
163    pub accessor: Option<&'a str>,
164}
165
166/// Authorizing a `DROP TEMP INDEX` statement.
167#[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]
impl<'a> ::core::clone::Clone for DropTempIndex<'a> {
    #[inline]
    fn clone(&self) -> DropTempIndex<'a> {
        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::cmp::PartialEq for DropTempIndex<'a> {
    #[inline]
    fn eq(&self, other: &DropTempIndex<'a>) -> 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)]
168#[non_exhaustive]
169pub struct DropTempIndex<'a> {
170    /// Name of the index being dropped.
171    pub index: Option<&'a str>,
172    /// Name of the table the index belongs to.
173    pub table: Option<&'a str>,
174    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
175    pub database: Option<&'a str>,
176    /// Inner-most trigger or view responsible for the access, if any.
177    pub accessor: Option<&'a str>,
178}
179
180/// Authorizing a `DROP TEMP TABLE` statement.
181#[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]
impl<'a> ::core::clone::Clone for DropTempTable<'a> {
    #[inline]
    fn clone(&self) -> DropTempTable<'a> {
        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::cmp::PartialEq for DropTempTable<'a> {
    #[inline]
    fn eq(&self, other: &DropTempTable<'a>) -> 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)]
182#[non_exhaustive]
183pub struct DropTempTable<'a> {
184    /// Name of the table being dropped.
185    pub table: Option<&'a str>,
186    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
187    pub database: Option<&'a str>,
188    /// Inner-most trigger or view responsible for the access, if any.
189    pub accessor: Option<&'a str>,
190}
191
192/// Authorizing a `DROP TEMP TRIGGER` statement.
193#[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]
impl<'a> ::core::clone::Clone for DropTempTrigger<'a> {
    #[inline]
    fn clone(&self) -> DropTempTrigger<'a> {
        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::cmp::PartialEq for DropTempTrigger<'a> {
    #[inline]
    fn eq(&self, other: &DropTempTrigger<'a>) -> 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)]
194#[non_exhaustive]
195pub struct DropTempTrigger<'a> {
196    /// Name of the trigger being dropped.
197    pub trigger: Option<&'a str>,
198    /// Name of the table the trigger is attached to.
199    pub table: Option<&'a str>,
200    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
201    pub database: Option<&'a str>,
202    /// Inner-most trigger or view responsible for the access, if any.
203    pub accessor: Option<&'a str>,
204}
205
206/// Authorizing a `DROP TEMP VIEW` statement.
207#[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]
impl<'a> ::core::clone::Clone for DropTempView<'a> {
    #[inline]
    fn clone(&self) -> DropTempView<'a> {
        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::cmp::PartialEq for DropTempView<'a> {
    #[inline]
    fn eq(&self, other: &DropTempView<'a>) -> 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)]
208#[non_exhaustive]
209pub struct DropTempView<'a> {
210    /// Name of the view being dropped.
211    pub view: Option<&'a str>,
212    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
213    pub database: Option<&'a str>,
214    /// Inner-most trigger or view responsible for the access, if any.
215    pub accessor: Option<&'a str>,
216}
217
218/// Authorizing a `DROP TRIGGER` statement.
219#[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]
impl<'a> ::core::clone::Clone for DropTrigger<'a> {
    #[inline]
    fn clone(&self) -> DropTrigger<'a> {
        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::cmp::PartialEq for DropTrigger<'a> {
    #[inline]
    fn eq(&self, other: &DropTrigger<'a>) -> 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)]
220#[non_exhaustive]
221pub struct DropTrigger<'a> {
222    /// Name of the trigger being dropped.
223    pub trigger: Option<&'a str>,
224    /// Name of the table the trigger is attached to.
225    pub table: Option<&'a str>,
226    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
227    pub database: Option<&'a str>,
228    /// Inner-most trigger or view responsible for the access, if any.
229    pub accessor: Option<&'a str>,
230}
231
232/// Authorizing a `DROP VIEW` statement.
233#[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]
impl<'a> ::core::clone::Clone for DropView<'a> {
    #[inline]
    fn clone(&self) -> DropView<'a> {
        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::cmp::PartialEq for DropView<'a> {
    #[inline]
    fn eq(&self, other: &DropView<'a>) -> 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)]
234#[non_exhaustive]
235pub struct DropView<'a> {
236    /// Name of the view being dropped.
237    pub view: Option<&'a str>,
238    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
239    pub database: Option<&'a str>,
240    /// Inner-most trigger or view responsible for the access, if any.
241    pub accessor: Option<&'a str>,
242}
243
244/// Authorizing an `INSERT` statement.
245#[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]
impl<'a> ::core::clone::Clone for Insert<'a> {
    #[inline]
    fn clone(&self) -> Insert<'a> {
        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::cmp::PartialEq for Insert<'a> {
    #[inline]
    fn eq(&self, other: &Insert<'a>) -> 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)]
246#[non_exhaustive]
247pub struct Insert<'a> {
248    /// Name of the table rows are inserted into.
249    pub table: Option<&'a str>,
250    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
251    pub database: Option<&'a str>,
252    /// Inner-most trigger or view responsible for the access, if any.
253    pub accessor: Option<&'a str>,
254}
255
256/// Authorizing a `PRAGMA` statement.
257#[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]
impl<'a> ::core::clone::Clone for Pragma<'a> {
    #[inline]
    fn clone(&self) -> Pragma<'a> {
        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::cmp::PartialEq for Pragma<'a> {
    #[inline]
    fn eq(&self, other: &Pragma<'a>) -> 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)]
258#[non_exhaustive]
259pub struct Pragma<'a> {
260    /// Name of the pragma.
261    pub name: Option<&'a str>,
262    /// Argument to the pragma, or `None` when it is queried without one.
263    pub argument: Option<&'a str>,
264    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
265    pub database: Option<&'a str>,
266    /// Inner-most trigger or view responsible for the access, if any.
267    pub accessor: Option<&'a str>,
268}
269
270/// Authorizing a column read.
271#[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]
impl<'a> ::core::clone::Clone for Read<'a> {
    #[inline]
    fn clone(&self) -> Read<'a> {
        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::cmp::PartialEq for Read<'a> {
    #[inline]
    fn eq(&self, other: &Read<'a>) -> 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)]
272#[non_exhaustive]
273pub struct Read<'a> {
274    /// Name of the table being read.
275    pub table: Option<&'a str>,
276    /// Name of the column being read.
277    pub column: Option<&'a str>,
278    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
279    pub database: Option<&'a str>,
280    /// Inner-most trigger or view responsible for the access, if any.
281    pub accessor: Option<&'a str>,
282}
283
284/// Authorizing a `SELECT` statement.
285#[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]
impl<'a> ::core::clone::Clone for Select<'a> {
    #[inline]
    fn clone(&self) -> Select<'a> {
        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::cmp::PartialEq for Select<'a> {
    #[inline]
    fn eq(&self, other: &Select<'a>) -> 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)]
286#[non_exhaustive]
287pub struct Select<'a> {
288    /// Inner-most trigger or view responsible for the access, if any.
289    pub accessor: Option<&'a str>,
290}
291
292/// Authorizing a transaction control operation (`BEGIN`, `COMMIT`, `ROLLBACK`).
293#[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]
impl<'a> ::core::clone::Clone for Transaction<'a> {
    #[inline]
    fn clone(&self) -> Transaction<'a> {
        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::cmp::PartialEq for Transaction<'a> {
    #[inline]
    fn eq(&self, other: &Transaction<'a>) -> 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)]
294#[non_exhaustive]
295pub struct Transaction<'a> {
296    /// The operation, for example `"BEGIN"`, `"COMMIT"`, or `"ROLLBACK"`.
297    pub operation: Option<&'a str>,
298    /// Inner-most trigger or view responsible for the access, if any.
299    pub accessor: Option<&'a str>,
300}
301
302/// Authorizing an `UPDATE` statement.
303#[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]
impl<'a> ::core::clone::Clone for Update<'a> {
    #[inline]
    fn clone(&self) -> Update<'a> {
        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::cmp::PartialEq for Update<'a> {
    #[inline]
    fn eq(&self, other: &Update<'a>) -> 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)]
304#[non_exhaustive]
305pub struct Update<'a> {
306    /// Name of the table being updated.
307    pub table: Option<&'a str>,
308    /// Name of the column being updated.
309    pub column: Option<&'a str>,
310    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
311    pub database: Option<&'a str>,
312    /// Inner-most trigger or view responsible for the access, if any.
313    pub accessor: Option<&'a str>,
314}
315
316/// Authorizing an `ATTACH DATABASE` statement.
317#[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]
impl<'a> ::core::clone::Clone for Attach<'a> {
    #[inline]
    fn clone(&self) -> Attach<'a> {
        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::cmp::PartialEq for Attach<'a> {
    #[inline]
    fn eq(&self, other: &Attach<'a>) -> 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)]
318#[non_exhaustive]
319pub struct Attach<'a> {
320    /// Filename of the database being attached.
321    pub filename: Option<&'a str>,
322    /// Inner-most trigger or view responsible for the access, if any.
323    pub accessor: Option<&'a str>,
324}
325
326/// Authorizing a `DETACH DATABASE` statement.
327#[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]
impl<'a> ::core::clone::Clone for Detach<'a> {
    #[inline]
    fn clone(&self) -> Detach<'a> {
        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::cmp::PartialEq for Detach<'a> {
    #[inline]
    fn eq(&self, other: &Detach<'a>) -> 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)]
328#[non_exhaustive]
329pub struct Detach<'a> {
330    /// Name of the database being detached.
331    pub database: Option<&'a str>,
332    /// Inner-most trigger or view responsible for the access, if any.
333    pub accessor: Option<&'a str>,
334}
335
336/// Authorizing an `ALTER TABLE` statement.
337#[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]
impl<'a> ::core::clone::Clone for AlterTable<'a> {
    #[inline]
    fn clone(&self) -> AlterTable<'a> {
        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::cmp::PartialEq for AlterTable<'a> {
    #[inline]
    fn eq(&self, other: &AlterTable<'a>) -> 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)]
338#[non_exhaustive]
339pub struct AlterTable<'a> {
340    /// Database the table lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
341    pub database: Option<&'a str>,
342    /// Name of the table being altered.
343    pub table: Option<&'a str>,
344    /// Inner-most trigger or view responsible for the access, if any.
345    pub accessor: Option<&'a str>,
346}
347
348/// Authorizing a `REINDEX` statement.
349#[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]
impl<'a> ::core::clone::Clone for Reindex<'a> {
    #[inline]
    fn clone(&self) -> Reindex<'a> {
        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::cmp::PartialEq for Reindex<'a> {
    #[inline]
    fn eq(&self, other: &Reindex<'a>) -> 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)]
350#[non_exhaustive]
351pub struct Reindex<'a> {
352    /// Name of the index being rebuilt.
353    pub index: Option<&'a str>,
354    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
355    pub database: Option<&'a str>,
356    /// Inner-most trigger or view responsible for the access, if any.
357    pub accessor: Option<&'a str>,
358}
359
360/// Authorizing an `ANALYZE` statement.
361#[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]
impl<'a> ::core::clone::Clone for Analyze<'a> {
    #[inline]
    fn clone(&self) -> Analyze<'a> {
        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::cmp::PartialEq for Analyze<'a> {
    #[inline]
    fn eq(&self, other: &Analyze<'a>) -> 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)]
362#[non_exhaustive]
363pub struct Analyze<'a> {
364    /// Name of the table being analyzed.
365    pub table: Option<&'a str>,
366    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
367    pub database: Option<&'a str>,
368    /// Inner-most trigger or view responsible for the access, if any.
369    pub accessor: Option<&'a str>,
370}
371
372/// Authorizing a `CREATE VIRTUAL TABLE` statement.
373#[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]
impl<'a> ::core::clone::Clone for CreateVTable<'a> {
    #[inline]
    fn clone(&self) -> CreateVTable<'a> {
        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::cmp::PartialEq for CreateVTable<'a> {
    #[inline]
    fn eq(&self, other: &CreateVTable<'a>) -> 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)]
374#[non_exhaustive]
375pub struct CreateVTable<'a> {
376    /// Name of the virtual table being created.
377    pub table: Option<&'a str>,
378    /// Name of the module implementing the virtual table.
379    pub module: Option<&'a str>,
380    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
381    pub database: Option<&'a str>,
382    /// Inner-most trigger or view responsible for the access, if any.
383    pub accessor: Option<&'a str>,
384}
385
386/// Authorizing a `DROP VIRTUAL TABLE` statement.
387#[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]
impl<'a> ::core::clone::Clone for DropVTable<'a> {
    #[inline]
    fn clone(&self) -> DropVTable<'a> {
        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::cmp::PartialEq for DropVTable<'a> {
    #[inline]
    fn eq(&self, other: &DropVTable<'a>) -> 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)]
388#[non_exhaustive]
389pub struct DropVTable<'a> {
390    /// Name of the virtual table being dropped.
391    pub table: Option<&'a str>,
392    /// Name of the module implementing the virtual table.
393    pub module: Option<&'a str>,
394    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
395    pub database: Option<&'a str>,
396    /// Inner-most trigger or view responsible for the access, if any.
397    pub accessor: Option<&'a str>,
398}
399
400/// Authorizing a SQL function call.
401#[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]
impl<'a> ::core::clone::Clone for Function<'a> {
    #[inline]
    fn clone(&self) -> Function<'a> {
        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::cmp::PartialEq for Function<'a> {
    #[inline]
    fn eq(&self, other: &Function<'a>) -> 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)]
402#[non_exhaustive]
403pub struct Function<'a> {
404    /// Name of the function being called.
405    pub function: Option<&'a str>,
406    /// Inner-most trigger or view responsible for the access, if any.
407    pub accessor: Option<&'a str>,
408}
409
410/// Authorizing a `SAVEPOINT` operation.
411#[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]
impl<'a> ::core::clone::Clone for Savepoint<'a> {
    #[inline]
    fn clone(&self) -> Savepoint<'a> {
        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::cmp::PartialEq for Savepoint<'a> {
    #[inline]
    fn eq(&self, other: &Savepoint<'a>) -> 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)]
412#[non_exhaustive]
413pub struct Savepoint<'a> {
414    /// The operation, for example `"BEGIN"`, `"RELEASE"`, or `"ROLLBACK"`.
415    pub operation: Option<&'a str>,
416    /// Name of the savepoint.
417    pub name: Option<&'a str>,
418    /// Inner-most trigger or view responsible for the access, if any.
419    pub accessor: Option<&'a str>,
420}
421
422/// Authorizing a recursive `SELECT`.
423#[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]
impl<'a> ::core::clone::Clone for Recursive<'a> {
    #[inline]
    fn clone(&self) -> Recursive<'a> {
        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::cmp::PartialEq for Recursive<'a> {
    #[inline]
    fn eq(&self, other: &Recursive<'a>) -> 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)]
424#[non_exhaustive]
425pub struct Recursive<'a> {
426    /// Inner-most trigger or view responsible for the access, if any.
427    pub accessor: Option<&'a str>,
428}
429
430/// An action code SQLite reported that this version of diesel does not model.
431///
432/// The raw arguments are exposed unchanged for forward compatibility.
433#[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]
impl<'a> ::core::clone::Clone for Unknown<'a> {
    #[inline]
    fn clone(&self) -> Unknown<'a> {
        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::cmp::PartialEq for Unknown<'a> {
    #[inline]
    fn eq(&self, other: &Unknown<'a>) -> 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)]
434#[non_exhaustive]
435pub struct Unknown<'a> {
436    /// The raw SQLite action code.
437    pub code: i32,
438    /// The third argument to the authorizer callback, if any.
439    pub arg1: Option<&'a str>,
440    /// The fourth argument to the authorizer callback, if any.
441    pub arg2: Option<&'a str>,
442    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
443    pub database: Option<&'a str>,
444    /// Inner-most trigger or view responsible for the access, if any.
445    pub accessor: Option<&'a str>,
446}
447
448/// Context information passed to the authorizer callback.
449///
450/// One variant per SQLite action code. Each variant carries the arguments for
451/// that action under descriptive field names, so there is no need to consult a
452/// table of what each positional argument means. The callback is invoked
453/// during SQL statement compilation (not during execution).
454///
455/// Added in SQLite 3.0.0 (June 2004).
456#[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 {
            AuthorizerContext::CreateIndex(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateIndex", &__self_0),
            AuthorizerContext::CreateTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateTable", &__self_0),
            AuthorizerContext::CreateTempIndex(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateTempIndex", &__self_0),
            AuthorizerContext::CreateTempTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateTempTable", &__self_0),
            AuthorizerContext::CreateTempTrigger(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateTempTrigger", &__self_0),
            AuthorizerContext::CreateTempView(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateTempView", &__self_0),
            AuthorizerContext::CreateTrigger(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateTrigger", &__self_0),
            AuthorizerContext::CreateView(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateView", &__self_0),
            AuthorizerContext::Delete(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Delete",
                    &__self_0),
            AuthorizerContext::DropIndex(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropIndex", &__self_0),
            AuthorizerContext::DropTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropTable", &__self_0),
            AuthorizerContext::DropTempIndex(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropTempIndex", &__self_0),
            AuthorizerContext::DropTempTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropTempTable", &__self_0),
            AuthorizerContext::DropTempTrigger(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropTempTrigger", &__self_0),
            AuthorizerContext::DropTempView(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropTempView", &__self_0),
            AuthorizerContext::DropTrigger(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropTrigger", &__self_0),
            AuthorizerContext::DropView(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropView", &__self_0),
            AuthorizerContext::Insert(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Insert",
                    &__self_0),
            AuthorizerContext::Pragma(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Pragma",
                    &__self_0),
            AuthorizerContext::Read(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Read",
                    &__self_0),
            AuthorizerContext::Select(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Select",
                    &__self_0),
            AuthorizerContext::Transaction(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Transaction", &__self_0),
            AuthorizerContext::Update(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Update",
                    &__self_0),
            AuthorizerContext::Attach(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Attach",
                    &__self_0),
            AuthorizerContext::Detach(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Detach",
                    &__self_0),
            AuthorizerContext::AlterTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "AlterTable", &__self_0),
            AuthorizerContext::Reindex(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Reindex", &__self_0),
            AuthorizerContext::Analyze(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Analyze", &__self_0),
            AuthorizerContext::CreateVTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateVTable", &__self_0),
            AuthorizerContext::DropVTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropVTable", &__self_0),
            AuthorizerContext::Function(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Function", &__self_0),
            AuthorizerContext::Savepoint(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Savepoint", &__self_0),
            AuthorizerContext::Recursive(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Recursive", &__self_0),
            AuthorizerContext::Unknown(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Unknown", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl<'a> ::core::clone::Clone for AuthorizerContext<'a> {
    #[inline]
    fn clone(&self) -> AuthorizerContext<'a> {
        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::cmp::PartialEq for AuthorizerContext<'a> {
    #[inline]
    fn eq(&self, other: &AuthorizerContext<'a>) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (AuthorizerContext::CreateIndex(__self_0),
                    AuthorizerContext::CreateIndex(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::CreateTable(__self_0),
                    AuthorizerContext::CreateTable(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::CreateTempIndex(__self_0),
                    AuthorizerContext::CreateTempIndex(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::CreateTempTable(__self_0),
                    AuthorizerContext::CreateTempTable(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::CreateTempTrigger(__self_0),
                    AuthorizerContext::CreateTempTrigger(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::CreateTempView(__self_0),
                    AuthorizerContext::CreateTempView(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::CreateTrigger(__self_0),
                    AuthorizerContext::CreateTrigger(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::CreateView(__self_0),
                    AuthorizerContext::CreateView(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Delete(__self_0),
                    AuthorizerContext::Delete(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::DropIndex(__self_0),
                    AuthorizerContext::DropIndex(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::DropTable(__self_0),
                    AuthorizerContext::DropTable(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::DropTempIndex(__self_0),
                    AuthorizerContext::DropTempIndex(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::DropTempTable(__self_0),
                    AuthorizerContext::DropTempTable(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::DropTempTrigger(__self_0),
                    AuthorizerContext::DropTempTrigger(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::DropTempView(__self_0),
                    AuthorizerContext::DropTempView(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::DropTrigger(__self_0),
                    AuthorizerContext::DropTrigger(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::DropView(__self_0),
                    AuthorizerContext::DropView(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Insert(__self_0),
                    AuthorizerContext::Insert(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Pragma(__self_0),
                    AuthorizerContext::Pragma(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Read(__self_0),
                    AuthorizerContext::Read(__arg1_0)) => __self_0 == __arg1_0,
                (AuthorizerContext::Select(__self_0),
                    AuthorizerContext::Select(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Transaction(__self_0),
                    AuthorizerContext::Transaction(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Update(__self_0),
                    AuthorizerContext::Update(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Attach(__self_0),
                    AuthorizerContext::Attach(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Detach(__self_0),
                    AuthorizerContext::Detach(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::AlterTable(__self_0),
                    AuthorizerContext::AlterTable(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Reindex(__self_0),
                    AuthorizerContext::Reindex(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Analyze(__self_0),
                    AuthorizerContext::Analyze(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::CreateVTable(__self_0),
                    AuthorizerContext::CreateVTable(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::DropVTable(__self_0),
                    AuthorizerContext::DropVTable(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Function(__self_0),
                    AuthorizerContext::Function(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Savepoint(__self_0),
                    AuthorizerContext::Savepoint(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Recursive(__self_0),
                    AuthorizerContext::Recursive(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AuthorizerContext::Unknown(__self_0),
                    AuthorizerContext::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)]
457#[non_exhaustive]
458pub enum AuthorizerContext<'a> {
459    /// `CREATE INDEX`
460    CreateIndex(CreateIndex<'a>),
461    /// `CREATE TABLE`
462    CreateTable(CreateTable<'a>),
463    /// `CREATE TEMP INDEX`
464    CreateTempIndex(CreateTempIndex<'a>),
465    /// `CREATE TEMP TABLE`
466    CreateTempTable(CreateTempTable<'a>),
467    /// `CREATE TEMP TRIGGER`
468    CreateTempTrigger(CreateTempTrigger<'a>),
469    /// `CREATE TEMP VIEW`
470    CreateTempView(CreateTempView<'a>),
471    /// `CREATE TRIGGER`
472    CreateTrigger(CreateTrigger<'a>),
473    /// `CREATE VIEW`
474    CreateView(CreateView<'a>),
475    /// `DELETE`
476    Delete(Delete<'a>),
477    /// `DROP INDEX`
478    DropIndex(DropIndex<'a>),
479    /// `DROP TABLE`
480    DropTable(DropTable<'a>),
481    /// `DROP TEMP INDEX`
482    DropTempIndex(DropTempIndex<'a>),
483    /// `DROP TEMP TABLE`
484    DropTempTable(DropTempTable<'a>),
485    /// `DROP TEMP TRIGGER`
486    DropTempTrigger(DropTempTrigger<'a>),
487    /// `DROP TEMP VIEW`
488    DropTempView(DropTempView<'a>),
489    /// `DROP TRIGGER`
490    DropTrigger(DropTrigger<'a>),
491    /// `DROP VIEW`
492    DropView(DropView<'a>),
493    /// `INSERT`
494    Insert(Insert<'a>),
495    /// `PRAGMA`
496    Pragma(Pragma<'a>),
497    /// Reading a column value.
498    Read(Read<'a>),
499    /// `SELECT`
500    Select(Select<'a>),
501    /// Transaction control (`BEGIN`, `COMMIT`, `ROLLBACK`).
502    Transaction(Transaction<'a>),
503    /// `UPDATE`
504    Update(Update<'a>),
505    /// `ATTACH DATABASE`
506    Attach(Attach<'a>),
507    /// `DETACH DATABASE`
508    Detach(Detach<'a>),
509    /// `ALTER TABLE`
510    AlterTable(AlterTable<'a>),
511    /// `REINDEX`
512    Reindex(Reindex<'a>),
513    /// `ANALYZE`
514    Analyze(Analyze<'a>),
515    /// `CREATE VIRTUAL TABLE`
516    CreateVTable(CreateVTable<'a>),
517    /// `DROP VIRTUAL TABLE`
518    DropVTable(DropVTable<'a>),
519    /// A SQL function call.
520    Function(Function<'a>),
521    /// `SAVEPOINT`
522    Savepoint(Savepoint<'a>),
523    /// A recursive `SELECT`.
524    Recursive(Recursive<'a>),
525    /// An action code this version of diesel does not model.
526    Unknown(Unknown<'a>),
527}
528
529impl<'a> AuthorizerContext<'a> {
530    /// Returns `true` if this action modifies the database schema.
531    ///
532    /// Schema-modifying actions include creating, dropping, or altering
533    /// tables, indexes, triggers, views, and virtual tables.
534    ///
535    /// # Example
536    ///
537    /// ```rust
538    /// # use diesel::prelude::*;
539    /// use diesel::sqlite::{SqliteConnection, AuthorizerContext, AuthorizerDecision};
540    ///
541    /// # let conn = &mut SqliteConnection::establish(":memory:").unwrap();
542    /// conn.on_authorize(|ctx| {
543    ///     if ctx.is_schema_modifying() {
544    ///         AuthorizerDecision::Deny
545    ///     } else {
546    ///         AuthorizerDecision::Allow
547    ///     }
548    /// });
549    /// ```
550    pub fn is_schema_modifying(&self) -> bool {
551        #[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!(
552            self,
553            Self::CreateIndex(_)
554                | Self::CreateTable(_)
555                | Self::CreateTempIndex(_)
556                | Self::CreateTempTable(_)
557                | Self::CreateTempTrigger(_)
558                | Self::CreateTempView(_)
559                | Self::CreateTrigger(_)
560                | Self::CreateView(_)
561                | Self::CreateVTable(_)
562                | Self::DropIndex(_)
563                | Self::DropTable(_)
564                | Self::DropTempIndex(_)
565                | Self::DropTempTable(_)
566                | Self::DropTempTrigger(_)
567                | Self::DropTempView(_)
568                | Self::DropTrigger(_)
569                | Self::DropView(_)
570                | Self::DropVTable(_)
571                | Self::AlterTable(_)
572        )
573    }
574
575    /// Builds the context from the raw authorizer callback arguments.
576    ///
577    /// `database` is the 5th callback argument (the database name) and
578    /// `accessor` is the 6th (the trigger or view responsible). The `arg1` and
579    /// `arg2` values are the 3rd and 4th arguments, whose meaning depends on
580    /// the action code per the SQLite documentation.
581    pub(crate) fn from_ffi(
582        code: i32,
583        arg1: Option<&'a str>,
584        arg2: Option<&'a str>,
585        database: Option<&'a str>,
586        accessor: Option<&'a str>,
587    ) -> Self {
588        match code {
589            ffi::SQLITE_CREATE_INDEX => Self::CreateIndex(CreateIndex {
590                index: arg1,
591                table: arg2,
592                database,
593                accessor,
594            }),
595            ffi::SQLITE_CREATE_TABLE => Self::CreateTable(CreateTable {
596                table: arg1,
597                database,
598                accessor,
599            }),
600            ffi::SQLITE_CREATE_TEMP_INDEX => Self::CreateTempIndex(CreateTempIndex {
601                index: arg1,
602                table: arg2,
603                database,
604                accessor,
605            }),
606            ffi::SQLITE_CREATE_TEMP_TABLE => Self::CreateTempTable(CreateTempTable {
607                table: arg1,
608                database,
609                accessor,
610            }),
611            ffi::SQLITE_CREATE_TEMP_TRIGGER => Self::CreateTempTrigger(CreateTempTrigger {
612                trigger: arg1,
613                table: arg2,
614                database,
615                accessor,
616            }),
617            ffi::SQLITE_CREATE_TEMP_VIEW => Self::CreateTempView(CreateTempView {
618                view: arg1,
619                database,
620                accessor,
621            }),
622            ffi::SQLITE_CREATE_TRIGGER => Self::CreateTrigger(CreateTrigger {
623                trigger: arg1,
624                table: arg2,
625                database,
626                accessor,
627            }),
628            ffi::SQLITE_CREATE_VIEW => Self::CreateView(CreateView {
629                view: arg1,
630                database,
631                accessor,
632            }),
633            ffi::SQLITE_DELETE => Self::Delete(Delete {
634                table: arg1,
635                database,
636                accessor,
637            }),
638            ffi::SQLITE_DROP_INDEX => Self::DropIndex(DropIndex {
639                index: arg1,
640                table: arg2,
641                database,
642                accessor,
643            }),
644            ffi::SQLITE_DROP_TABLE => Self::DropTable(DropTable {
645                table: arg1,
646                database,
647                accessor,
648            }),
649            ffi::SQLITE_DROP_TEMP_INDEX => Self::DropTempIndex(DropTempIndex {
650                index: arg1,
651                table: arg2,
652                database,
653                accessor,
654            }),
655            ffi::SQLITE_DROP_TEMP_TABLE => Self::DropTempTable(DropTempTable {
656                table: arg1,
657                database,
658                accessor,
659            }),
660            ffi::SQLITE_DROP_TEMP_TRIGGER => Self::DropTempTrigger(DropTempTrigger {
661                trigger: arg1,
662                table: arg2,
663                database,
664                accessor,
665            }),
666            ffi::SQLITE_DROP_TEMP_VIEW => Self::DropTempView(DropTempView {
667                view: arg1,
668                database,
669                accessor,
670            }),
671            ffi::SQLITE_DROP_TRIGGER => Self::DropTrigger(DropTrigger {
672                trigger: arg1,
673                table: arg2,
674                database,
675                accessor,
676            }),
677            ffi::SQLITE_DROP_VIEW => Self::DropView(DropView {
678                view: arg1,
679                database,
680                accessor,
681            }),
682            ffi::SQLITE_INSERT => Self::Insert(Insert {
683                table: arg1,
684                database,
685                accessor,
686            }),
687            ffi::SQLITE_PRAGMA => Self::Pragma(Pragma {
688                name: arg1,
689                argument: arg2,
690                database,
691                accessor,
692            }),
693            ffi::SQLITE_READ => Self::Read(Read {
694                table: arg1,
695                column: arg2,
696                database,
697                accessor,
698            }),
699            ffi::SQLITE_SELECT => Self::Select(Select { accessor }),
700            ffi::SQLITE_TRANSACTION => Self::Transaction(Transaction {
701                operation: arg1,
702                accessor,
703            }),
704            ffi::SQLITE_UPDATE => Self::Update(Update {
705                table: arg1,
706                column: arg2,
707                database,
708                accessor,
709            }),
710            ffi::SQLITE_ATTACH => Self::Attach(Attach {
711                filename: arg1,
712                accessor,
713            }),
714            ffi::SQLITE_DETACH => Self::Detach(Detach {
715                database: arg1,
716                accessor,
717            }),
718            ffi::SQLITE_ALTER_TABLE => Self::AlterTable(AlterTable {
719                database: arg1,
720                table: arg2,
721                accessor,
722            }),
723            ffi::SQLITE_REINDEX => Self::Reindex(Reindex {
724                index: arg1,
725                database,
726                accessor,
727            }),
728            ffi::SQLITE_ANALYZE => Self::Analyze(Analyze {
729                table: arg1,
730                database,
731                accessor,
732            }),
733            ffi::SQLITE_CREATE_VTABLE => Self::CreateVTable(CreateVTable {
734                table: arg1,
735                module: arg2,
736                database,
737                accessor,
738            }),
739            ffi::SQLITE_DROP_VTABLE => Self::DropVTable(DropVTable {
740                table: arg1,
741                module: arg2,
742                database,
743                accessor,
744            }),
745            ffi::SQLITE_FUNCTION => Self::Function(Function {
746                function: arg2,
747                accessor,
748            }),
749            ffi::SQLITE_SAVEPOINT => Self::Savepoint(Savepoint {
750                operation: arg1,
751                name: arg2,
752                accessor,
753            }),
754            ffi::SQLITE_RECURSIVE => Self::Recursive(Recursive { accessor }),
755            other => Self::Unknown(Unknown {
756                code: other,
757                arg1,
758                arg2,
759                database,
760                accessor,
761            }),
762        }
763    }
764}
765
766/// Authorizer callback decision.
767///
768/// Returned by the authorizer callback to indicate whether to allow,
769/// ignore, or deny the requested operation.
770#[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]
impl ::core::clone::Clone for AuthorizerDecision {
    #[inline]
    fn clone(&self) -> AuthorizerDecision { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for AuthorizerDecision { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for AuthorizerDecision {
    #[inline]
    fn eq(&self, other: &AuthorizerDecision) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for AuthorizerDecision {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq)]
771pub enum AuthorizerDecision {
772    /// Allow the operation to proceed (`SQLITE_OK`).
773    Allow,
774    /// Ignore the operation (`SQLITE_IGNORE`).
775    ///
776    /// For `Read` actions, returns `NULL` instead of the column value.
777    /// For other actions, treats the operation as a no-op.
778    Ignore,
779    /// Deny the operation (`SQLITE_DENY`).
780    ///
781    /// Causes the entire SQL statement to fail with an authorization error.
782    Deny,
783}
784
785impl AuthorizerDecision {
786    /// Converts the decision to the FFI return code.
787    pub(crate) fn to_ffi(self) -> i32 {
788        match self {
789            Self::Allow => ffi::SQLITE_OK,
790            Self::Ignore => ffi::SQLITE_IGNORE,
791            Self::Deny => ffi::SQLITE_DENY,
792        }
793    }
794}