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
24use super::SqliteConnection;
25
26/// Authorizing a `CREATE INDEX` statement.
27#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateIndex<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f, "CreateIndex",
            "index", &self.index, "table", &self.table, "database",
            &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateIndex<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateIndex<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateIndex<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.index == other.index && self.table == other.table &&
                self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateIndex<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
28#[non_exhaustive]
29pub struct CreateIndex<'a> {
30    /// Name of the index being created.
31    pub index: Option<&'a str>,
32    /// Name of the table the index is created on.
33    pub table: Option<&'a str>,
34    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
35    pub database: Option<&'a str>,
36    /// Inner-most trigger or view responsible for the access, if any.
37    pub accessor: Option<&'a str>,
38}
39
40/// Authorizing a `CREATE TABLE` statement.
41#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateTable<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "CreateTable",
            "table", &self.table, "database", &self.database, "accessor",
            &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateTable<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateTable<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.table == other.table && self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateTable<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
42#[non_exhaustive]
43pub struct CreateTable<'a> {
44    /// Name of the table being created.
45    pub table: Option<&'a str>,
46    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
47    pub database: Option<&'a str>,
48    /// Inner-most trigger or view responsible for the access, if any.
49    pub accessor: Option<&'a str>,
50}
51
52/// Authorizing a `CREATE TEMP INDEX` statement.
53#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateTempIndex<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f,
            "CreateTempIndex", "index", &self.index, "table", &self.table,
            "database", &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateTempIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateTempIndex<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateTempIndex<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateTempIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateTempIndex<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.index == other.index && self.table == other.table &&
                self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateTempIndex<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
54#[non_exhaustive]
55pub struct CreateTempIndex<'a> {
56    /// Name of the index being created.
57    pub index: Option<&'a str>,
58    /// Name of the table the index is created on.
59    pub table: Option<&'a str>,
60    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
61    pub database: Option<&'a str>,
62    /// Inner-most trigger or view responsible for the access, if any.
63    pub accessor: Option<&'a str>,
64}
65
66/// Authorizing a `CREATE TEMP TABLE` statement.
67#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateTempTable<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f,
            "CreateTempTable", "table", &self.table, "database",
            &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateTempTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateTempTable<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateTempTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateTempTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateTempTable<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.table == other.table && self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateTempTable<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
68#[non_exhaustive]
69pub struct CreateTempTable<'a> {
70    /// Name of the table being created.
71    pub table: Option<&'a str>,
72    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
73    pub database: Option<&'a str>,
74    /// Inner-most trigger or view responsible for the access, if any.
75    pub accessor: Option<&'a str>,
76}
77
78/// Authorizing a `CREATE TEMP TRIGGER` statement.
79#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateTempTrigger<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f,
            "CreateTempTrigger", "trigger", &self.trigger, "table",
            &self.table, "database", &self.database, "accessor",
            &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateTempTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateTempTrigger<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateTempTrigger<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateTempTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateTempTrigger<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.trigger == other.trigger && self.table == other.table &&
                self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateTempTrigger<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
80#[non_exhaustive]
81pub struct CreateTempTrigger<'a> {
82    /// Name of the trigger being created.
83    pub trigger: Option<&'a str>,
84    /// Name of the table the trigger is attached to.
85    pub table: Option<&'a str>,
86    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
87    pub database: Option<&'a str>,
88    /// Inner-most trigger or view responsible for the access, if any.
89    pub accessor: Option<&'a str>,
90}
91
92/// Authorizing a `CREATE TEMP VIEW` statement.
93#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateTempView<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f,
            "CreateTempView", "view", &self.view, "database", &self.database,
            "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateTempView<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateTempView<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateTempView<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateTempView<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateTempView<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.view == other.view && self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateTempView<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
94#[non_exhaustive]
95pub struct CreateTempView<'a> {
96    /// Name of the view being created.
97    pub view: Option<&'a str>,
98    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
99    pub database: Option<&'a str>,
100    /// Inner-most trigger or view responsible for the access, if any.
101    pub accessor: Option<&'a str>,
102}
103
104/// Authorizing a `CREATE TRIGGER` statement.
105#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateTrigger<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f, "CreateTrigger",
            "trigger", &self.trigger, "table", &self.table, "database",
            &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateTrigger<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateTrigger<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateTrigger<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.trigger == other.trigger && self.table == other.table &&
                self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateTrigger<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
106#[non_exhaustive]
107pub struct CreateTrigger<'a> {
108    /// Name of the trigger being created.
109    pub trigger: Option<&'a str>,
110    /// Name of the table the trigger is attached to.
111    pub table: Option<&'a str>,
112    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
113    pub database: Option<&'a str>,
114    /// Inner-most trigger or view responsible for the access, if any.
115    pub accessor: Option<&'a str>,
116}
117
118/// Authorizing a `CREATE VIEW` statement.
119#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateView<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "CreateView",
            "view", &self.view, "database", &self.database, "accessor",
            &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateView<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateView<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateView<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateView<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateView<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.view == other.view && self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateView<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
120#[non_exhaustive]
121pub struct CreateView<'a> {
122    /// Name of the view being created.
123    pub view: Option<&'a str>,
124    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
125    pub database: Option<&'a str>,
126    /// Inner-most trigger or view responsible for the access, if any.
127    pub accessor: Option<&'a str>,
128}
129
130/// Authorizing a `DELETE` statement.
131#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Delete<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "Delete",
            "table", &self.table, "database", &self.database, "accessor",
            &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Delete<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Delete<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Delete<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Delete<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Delete<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.table == other.table && self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Delete<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
132#[non_exhaustive]
133pub struct Delete<'a> {
134    /// Name of the table rows are deleted from.
135    pub table: Option<&'a str>,
136    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
137    pub database: Option<&'a str>,
138    /// Inner-most trigger or view responsible for the access, if any.
139    pub accessor: Option<&'a str>,
140}
141
142/// Authorizing a `DROP INDEX` statement.
143#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropIndex<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f, "DropIndex",
            "index", &self.index, "table", &self.table, "database",
            &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropIndex<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropIndex<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropIndex<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.index == other.index && self.table == other.table &&
                self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropIndex<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
144#[non_exhaustive]
145pub struct DropIndex<'a> {
146    /// Name of the index being dropped.
147    pub index: Option<&'a str>,
148    /// Name of the table the index belongs to.
149    pub table: Option<&'a str>,
150    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
151    pub database: Option<&'a str>,
152    /// Inner-most trigger or view responsible for the access, if any.
153    pub accessor: Option<&'a str>,
154}
155
156/// Authorizing a `DROP TABLE` statement.
157#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropTable<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "DropTable",
            "table", &self.table, "database", &self.database, "accessor",
            &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropTable<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropTable<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.table == other.table && self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropTable<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
158#[non_exhaustive]
159pub struct DropTable<'a> {
160    /// Name of the table being dropped.
161    pub table: Option<&'a str>,
162    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
163    pub database: Option<&'a str>,
164    /// Inner-most trigger or view responsible for the access, if any.
165    pub accessor: Option<&'a str>,
166}
167
168/// Authorizing a `DROP TEMP INDEX` statement.
169#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropTempIndex<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f, "DropTempIndex",
            "index", &self.index, "table", &self.table, "database",
            &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropTempIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropTempIndex<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropTempIndex<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropTempIndex<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropTempIndex<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.index == other.index && self.table == other.table &&
                self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropTempIndex<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
170#[non_exhaustive]
171pub struct DropTempIndex<'a> {
172    /// Name of the index being dropped.
173    pub index: Option<&'a str>,
174    /// Name of the table the index belongs to.
175    pub table: Option<&'a str>,
176    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
177    pub database: Option<&'a str>,
178    /// Inner-most trigger or view responsible for the access, if any.
179    pub accessor: Option<&'a str>,
180}
181
182/// Authorizing a `DROP TEMP TABLE` statement.
183#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropTempTable<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "DropTempTable",
            "table", &self.table, "database", &self.database, "accessor",
            &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropTempTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropTempTable<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropTempTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropTempTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropTempTable<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.table == other.table && self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropTempTable<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
184#[non_exhaustive]
185pub struct DropTempTable<'a> {
186    /// Name of the table being dropped.
187    pub table: Option<&'a str>,
188    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
189    pub database: Option<&'a str>,
190    /// Inner-most trigger or view responsible for the access, if any.
191    pub accessor: Option<&'a str>,
192}
193
194/// Authorizing a `DROP TEMP TRIGGER` statement.
195#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropTempTrigger<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f,
            "DropTempTrigger", "trigger", &self.trigger, "table", &self.table,
            "database", &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropTempTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropTempTrigger<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropTempTrigger<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropTempTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropTempTrigger<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.trigger == other.trigger && self.table == other.table &&
                self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropTempTrigger<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
196#[non_exhaustive]
197pub struct DropTempTrigger<'a> {
198    /// Name of the trigger being dropped.
199    pub trigger: Option<&'a str>,
200    /// Name of the table the trigger is attached to.
201    pub table: Option<&'a str>,
202    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
203    pub database: Option<&'a str>,
204    /// Inner-most trigger or view responsible for the access, if any.
205    pub accessor: Option<&'a str>,
206}
207
208/// Authorizing a `DROP TEMP VIEW` statement.
209#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropTempView<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "DropTempView",
            "view", &self.view, "database", &self.database, "accessor",
            &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropTempView<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropTempView<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropTempView<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropTempView<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropTempView<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.view == other.view && self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropTempView<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
210#[non_exhaustive]
211pub struct DropTempView<'a> {
212    /// Name of the view being dropped.
213    pub view: Option<&'a str>,
214    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
215    pub database: Option<&'a str>,
216    /// Inner-most trigger or view responsible for the access, if any.
217    pub accessor: Option<&'a str>,
218}
219
220/// Authorizing a `DROP TRIGGER` statement.
221#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropTrigger<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f, "DropTrigger",
            "trigger", &self.trigger, "table", &self.table, "database",
            &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropTrigger<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropTrigger<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropTrigger<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropTrigger<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.trigger == other.trigger && self.table == other.table &&
                self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropTrigger<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
222#[non_exhaustive]
223pub struct DropTrigger<'a> {
224    /// Name of the trigger being dropped.
225    pub trigger: Option<&'a str>,
226    /// Name of the table the trigger is attached to.
227    pub table: Option<&'a str>,
228    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
229    pub database: Option<&'a str>,
230    /// Inner-most trigger or view responsible for the access, if any.
231    pub accessor: Option<&'a str>,
232}
233
234/// Authorizing a `DROP VIEW` statement.
235#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropView<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "DropView",
            "view", &self.view, "database", &self.database, "accessor",
            &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropView<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropView<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropView<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropView<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropView<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.view == other.view && self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropView<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
236#[non_exhaustive]
237pub struct DropView<'a> {
238    /// Name of the view being dropped.
239    pub view: Option<&'a str>,
240    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
241    pub database: Option<&'a str>,
242    /// Inner-most trigger or view responsible for the access, if any.
243    pub accessor: Option<&'a str>,
244}
245
246/// Authorizing an `INSERT` statement.
247#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Insert<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "Insert",
            "table", &self.table, "database", &self.database, "accessor",
            &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Insert<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Insert<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Insert<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Insert<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Insert<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.table == other.table && self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Insert<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
248#[non_exhaustive]
249pub struct Insert<'a> {
250    /// Name of the table rows are inserted into.
251    pub table: Option<&'a str>,
252    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
253    pub database: Option<&'a str>,
254    /// Inner-most trigger or view responsible for the access, if any.
255    pub accessor: Option<&'a str>,
256}
257
258/// Authorizing a `PRAGMA` statement.
259#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Pragma<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f, "Pragma",
            "name", &self.name, "argument", &self.argument, "database",
            &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Pragma<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Pragma<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Pragma<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Pragma<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Pragma<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.name == other.name && self.argument == other.argument &&
                self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Pragma<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
260#[non_exhaustive]
261pub struct Pragma<'a> {
262    /// Name of the pragma.
263    pub name: Option<&'a str>,
264    /// Argument to the pragma, or `None` when it is queried without one.
265    pub argument: Option<&'a str>,
266    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
267    pub database: Option<&'a str>,
268    /// Inner-most trigger or view responsible for the access, if any.
269    pub accessor: Option<&'a str>,
270}
271
272/// Authorizing a column read.
273#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Read<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f, "Read", "table",
            &self.table, "column", &self.column, "database", &self.database,
            "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Read<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Read<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Read<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Read<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Read<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.table == other.table && self.column == other.column &&
                self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Read<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
274#[non_exhaustive]
275pub struct Read<'a> {
276    /// Name of the table being read.
277    pub table: Option<&'a str>,
278    /// Name of the column being read.
279    pub column: Option<&'a str>,
280    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
281    pub database: Option<&'a str>,
282    /// Inner-most trigger or view responsible for the access, if any.
283    pub accessor: Option<&'a str>,
284}
285
286/// Authorizing a `SELECT` statement.
287#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Select<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field1_finish(f, "Select",
            "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Select<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Select<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Select<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Select<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Select<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool { self.accessor == other.accessor }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Select<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
288#[non_exhaustive]
289pub struct Select<'a> {
290    /// Inner-most trigger or view responsible for the access, if any.
291    pub accessor: Option<&'a str>,
292}
293
294/// Authorizing a transaction control operation (`BEGIN`, `COMMIT`, `ROLLBACK`).
295#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Transaction<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f, "Transaction",
            "operation", &self.operation, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Transaction<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Transaction<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Transaction<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Transaction<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Transaction<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.operation == other.operation && self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Transaction<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
296#[non_exhaustive]
297pub struct Transaction<'a> {
298    /// The operation, for example `"BEGIN"`, `"COMMIT"`, or `"ROLLBACK"`.
299    pub operation: Option<&'a str>,
300    /// Inner-most trigger or view responsible for the access, if any.
301    pub accessor: Option<&'a str>,
302}
303
304/// Authorizing an `UPDATE` statement.
305#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Update<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f, "Update",
            "table", &self.table, "column", &self.column, "database",
            &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Update<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Update<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Update<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Update<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Update<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.table == other.table && self.column == other.column &&
                self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Update<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
306#[non_exhaustive]
307pub struct Update<'a> {
308    /// Name of the table being updated.
309    pub table: Option<&'a str>,
310    /// Name of the column being updated.
311    pub column: Option<&'a str>,
312    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
313    pub database: Option<&'a str>,
314    /// Inner-most trigger or view responsible for the access, if any.
315    pub accessor: Option<&'a str>,
316}
317
318/// Authorizing an `ATTACH DATABASE` statement.
319#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Attach<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f, "Attach",
            "filename", &self.filename, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Attach<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Attach<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Attach<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Attach<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Attach<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.filename == other.filename && self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Attach<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
320#[non_exhaustive]
321pub struct Attach<'a> {
322    /// Filename of the database being attached.
323    pub filename: Option<&'a str>,
324    /// Inner-most trigger or view responsible for the access, if any.
325    pub accessor: Option<&'a str>,
326}
327
328/// Authorizing a `DETACH DATABASE` statement.
329#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Detach<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f, "Detach",
            "database", &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Detach<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Detach<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Detach<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Detach<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Detach<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.database == other.database && self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Detach<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
330#[non_exhaustive]
331pub struct Detach<'a> {
332    /// Name of the database being detached.
333    pub database: Option<&'a str>,
334    /// Inner-most trigger or view responsible for the access, if any.
335    pub accessor: Option<&'a str>,
336}
337
338/// Authorizing an `ALTER TABLE` statement.
339#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for AlterTable<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "AlterTable",
            "database", &self.database, "table", &self.table, "accessor",
            &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for AlterTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for AlterTable<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for AlterTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for AlterTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for AlterTable<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.database == other.database && self.table == other.table &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for AlterTable<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
340#[non_exhaustive]
341pub struct AlterTable<'a> {
342    /// Database the table lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
343    pub database: Option<&'a str>,
344    /// Name of the table being altered.
345    pub table: Option<&'a str>,
346    /// Inner-most trigger or view responsible for the access, if any.
347    pub accessor: Option<&'a str>,
348}
349
350/// Authorizing a `REINDEX` statement.
351#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Reindex<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "Reindex",
            "index", &self.index, "database", &self.database, "accessor",
            &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Reindex<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Reindex<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Reindex<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Reindex<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Reindex<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.index == other.index && self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Reindex<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
352#[non_exhaustive]
353pub struct Reindex<'a> {
354    /// Name of the index being rebuilt.
355    pub index: Option<&'a str>,
356    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
357    pub database: Option<&'a str>,
358    /// Inner-most trigger or view responsible for the access, if any.
359    pub accessor: Option<&'a str>,
360}
361
362/// Authorizing an `ANALYZE` statement.
363#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Analyze<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "Analyze",
            "table", &self.table, "database", &self.database, "accessor",
            &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Analyze<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Analyze<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Analyze<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Analyze<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Analyze<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.table == other.table && self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Analyze<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
364#[non_exhaustive]
365pub struct Analyze<'a> {
366    /// Name of the table being analyzed.
367    pub table: Option<&'a str>,
368    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
369    pub database: Option<&'a str>,
370    /// Inner-most trigger or view responsible for the access, if any.
371    pub accessor: Option<&'a str>,
372}
373
374/// Authorizing a `CREATE VIRTUAL TABLE` statement.
375#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for CreateVTable<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f, "CreateVTable",
            "table", &self.table, "module", &self.module, "database",
            &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for CreateVTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for CreateVTable<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for CreateVTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for CreateVTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for CreateVTable<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.table == other.table && self.module == other.module &&
                self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for CreateVTable<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
376#[non_exhaustive]
377pub struct CreateVTable<'a> {
378    /// Name of the virtual table being created.
379    pub table: Option<&'a str>,
380    /// Name of the module implementing the virtual table.
381    pub module: Option<&'a str>,
382    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
383    pub database: Option<&'a str>,
384    /// Inner-most trigger or view responsible for the access, if any.
385    pub accessor: Option<&'a str>,
386}
387
388/// Authorizing a `DROP VIRTUAL TABLE` statement.
389#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for DropVTable<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f, "DropVTable",
            "table", &self.table, "module", &self.module, "database",
            &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for DropVTable<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for DropVTable<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for DropVTable<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for DropVTable<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for DropVTable<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.table == other.table && self.module == other.module &&
                self.database == other.database &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for DropVTable<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
390#[non_exhaustive]
391pub struct DropVTable<'a> {
392    /// Name of the virtual table being dropped.
393    pub table: Option<&'a str>,
394    /// Name of the module implementing the virtual table.
395    pub module: Option<&'a str>,
396    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
397    pub database: Option<&'a str>,
398    /// Inner-most trigger or view responsible for the access, if any.
399    pub accessor: Option<&'a str>,
400}
401
402/// Authorizing a SQL function call.
403#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Function<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f, "Function",
            "function", &self.function, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Function<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Function<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Function<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Function<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Function<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.function == other.function && self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Function<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
404#[non_exhaustive]
405pub struct Function<'a> {
406    /// Name of the function being called.
407    pub function: Option<&'a str>,
408    /// Inner-most trigger or view responsible for the access, if any.
409    pub accessor: Option<&'a str>,
410}
411
412/// Authorizing a `SAVEPOINT` operation.
413#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Savepoint<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "Savepoint",
            "operation", &self.operation, "name", &self.name, "accessor",
            &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Savepoint<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Savepoint<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Savepoint<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Savepoint<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Savepoint<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.operation == other.operation && self.name == other.name &&
            self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Savepoint<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
414#[non_exhaustive]
415pub struct Savepoint<'a> {
416    /// The operation, for example `"BEGIN"`, `"RELEASE"`, or `"ROLLBACK"`.
417    pub operation: Option<&'a str>,
418    /// Name of the savepoint.
419    pub name: Option<&'a str>,
420    /// Inner-most trigger or view responsible for the access, if any.
421    pub accessor: Option<&'a str>,
422}
423
424/// Authorizing a recursive `SELECT`.
425#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Recursive<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field1_finish(f, "Recursive",
            "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Recursive<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Recursive<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Recursive<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Recursive<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Recursive<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool { self.accessor == other.accessor }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Recursive<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
426#[non_exhaustive]
427pub struct Recursive<'a> {
428    /// Inner-most trigger or view responsible for the access, if any.
429    pub accessor: Option<&'a str>,
430}
431
432/// An action code SQLite reported that this version of diesel does not model.
433///
434/// The raw arguments are exposed unchanged for forward compatibility.
435#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for Unknown<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field5_finish(f, "Unknown",
            "code", &self.code, "arg1", &self.arg1, "arg2", &self.arg2,
            "database", &self.database, "accessor", &&self.accessor)
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for Unknown<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for Unknown<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<i32>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        let _: ::core::clone::AssertParamIsClone<Option<&'a str>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for Unknown<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for Unknown<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for Unknown<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.code == other.code && self.arg1 == other.arg1 &&
                    self.arg2 == other.arg2 && self.database == other.database
            && self.accessor == other.accessor
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for Unknown<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<i32>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
        let _: ::core::cmp::AssertParamIsEq<Option<&'a str>>;
    }
}Eq)]
436#[non_exhaustive]
437pub struct Unknown<'a> {
438    /// The raw SQLite action code.
439    pub code: i32,
440    /// The third argument to the authorizer callback, if any.
441    pub arg1: Option<&'a str>,
442    /// The fourth argument to the authorizer callback, if any.
443    pub arg2: Option<&'a str>,
444    /// Database the object lives in (`"main"`, `"temp"`, or an `ATTACH` alias).
445    pub database: Option<&'a str>,
446    /// Inner-most trigger or view responsible for the access, if any.
447    pub accessor: Option<&'a str>,
448}
449
450/// Context information passed to the authorizer callback.
451///
452/// One variant per SQLite action code. Each variant carries the arguments for
453/// that action under descriptive field names, so there is no need to consult a
454/// table of what each positional argument means. The callback is invoked
455/// during SQL statement compilation (not during execution).
456///
457/// Added in SQLite 3.0.0 (June 2004).
458#[derive(#[automatically_derived]
impl<'a> ::core::fmt::Debug for AuthorizerContext<'a> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::CreateIndex(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateIndex", &__self_0),
            Self::CreateTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateTable", &__self_0),
            Self::CreateTempIndex(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateTempIndex", &__self_0),
            Self::CreateTempTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateTempTable", &__self_0),
            Self::CreateTempTrigger(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateTempTrigger", &__self_0),
            Self::CreateTempView(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateTempView", &__self_0),
            Self::CreateTrigger(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateTrigger", &__self_0),
            Self::CreateView(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateView", &__self_0),
            Self::Delete(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Delete",
                    &__self_0),
            Self::DropIndex(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropIndex", &__self_0),
            Self::DropTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropTable", &__self_0),
            Self::DropTempIndex(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropTempIndex", &__self_0),
            Self::DropTempTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropTempTable", &__self_0),
            Self::DropTempTrigger(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropTempTrigger", &__self_0),
            Self::DropTempView(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropTempView", &__self_0),
            Self::DropTrigger(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropTrigger", &__self_0),
            Self::DropView(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropView", &__self_0),
            Self::Insert(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Insert",
                    &__self_0),
            Self::Pragma(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Pragma",
                    &__self_0),
            Self::Read(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Read",
                    &__self_0),
            Self::Select(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Select",
                    &__self_0),
            Self::Transaction(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Transaction", &__self_0),
            Self::Update(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Update",
                    &__self_0),
            Self::Attach(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Attach",
                    &__self_0),
            Self::Detach(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Detach",
                    &__self_0),
            Self::AlterTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "AlterTable", &__self_0),
            Self::Reindex(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Reindex", &__self_0),
            Self::Analyze(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Analyze", &__self_0),
            Self::CreateVTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CreateVTable", &__self_0),
            Self::DropVTable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DropVTable", &__self_0),
            Self::Function(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Function", &__self_0),
            Self::Savepoint(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Savepoint", &__self_0),
            Self::Recursive(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Recursive", &__self_0),
            Self::Unknown(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Unknown", &__self_0),
        }
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl<'a> ::core::clone::TrivialClone for AuthorizerContext<'a> { }
#[automatically_derived]
impl<'a> ::core::clone::Clone for AuthorizerContext<'a> {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<CreateIndex<'a>>;
        let _: ::core::clone::AssertParamIsClone<CreateTable<'a>>;
        let _: ::core::clone::AssertParamIsClone<CreateTempIndex<'a>>;
        let _: ::core::clone::AssertParamIsClone<CreateTempTable<'a>>;
        let _: ::core::clone::AssertParamIsClone<CreateTempTrigger<'a>>;
        let _: ::core::clone::AssertParamIsClone<CreateTempView<'a>>;
        let _: ::core::clone::AssertParamIsClone<CreateTrigger<'a>>;
        let _: ::core::clone::AssertParamIsClone<CreateView<'a>>;
        let _: ::core::clone::AssertParamIsClone<Delete<'a>>;
        let _: ::core::clone::AssertParamIsClone<DropIndex<'a>>;
        let _: ::core::clone::AssertParamIsClone<DropTable<'a>>;
        let _: ::core::clone::AssertParamIsClone<DropTempIndex<'a>>;
        let _: ::core::clone::AssertParamIsClone<DropTempTable<'a>>;
        let _: ::core::clone::AssertParamIsClone<DropTempTrigger<'a>>;
        let _: ::core::clone::AssertParamIsClone<DropTempView<'a>>;
        let _: ::core::clone::AssertParamIsClone<DropTrigger<'a>>;
        let _: ::core::clone::AssertParamIsClone<DropView<'a>>;
        let _: ::core::clone::AssertParamIsClone<Insert<'a>>;
        let _: ::core::clone::AssertParamIsClone<Pragma<'a>>;
        let _: ::core::clone::AssertParamIsClone<Read<'a>>;
        let _: ::core::clone::AssertParamIsClone<Select<'a>>;
        let _: ::core::clone::AssertParamIsClone<Transaction<'a>>;
        let _: ::core::clone::AssertParamIsClone<Update<'a>>;
        let _: ::core::clone::AssertParamIsClone<Attach<'a>>;
        let _: ::core::clone::AssertParamIsClone<Detach<'a>>;
        let _: ::core::clone::AssertParamIsClone<AlterTable<'a>>;
        let _: ::core::clone::AssertParamIsClone<Reindex<'a>>;
        let _: ::core::clone::AssertParamIsClone<Analyze<'a>>;
        let _: ::core::clone::AssertParamIsClone<CreateVTable<'a>>;
        let _: ::core::clone::AssertParamIsClone<DropVTable<'a>>;
        let _: ::core::clone::AssertParamIsClone<Function<'a>>;
        let _: ::core::clone::AssertParamIsClone<Savepoint<'a>>;
        let _: ::core::clone::AssertParamIsClone<Recursive<'a>>;
        let _: ::core::clone::AssertParamIsClone<Unknown<'a>>;
        *self
    }
}Clone, #[automatically_derived]
impl<'a> ::core::marker::Copy for AuthorizerContext<'a> { }Copy, #[automatically_derived]
impl<'a> ::core::marker::StructuralPartialEq for AuthorizerContext<'a> { }
#[automatically_derived]
impl<'a> ::core::cmp::PartialEq for AuthorizerContext<'a> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::CreateIndex(__self_0), Self::CreateIndex(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::CreateTable(__self_0), Self::CreateTable(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::CreateTempIndex(__self_0),
                    Self::CreateTempIndex(__arg1_0)) => __self_0 == __arg1_0,
                (Self::CreateTempTable(__self_0),
                    Self::CreateTempTable(__arg1_0)) => __self_0 == __arg1_0,
                (Self::CreateTempTrigger(__self_0),
                    Self::CreateTempTrigger(__arg1_0)) => __self_0 == __arg1_0,
                (Self::CreateTempView(__self_0),
                    Self::CreateTempView(__arg1_0)) => __self_0 == __arg1_0,
                (Self::CreateTrigger(__self_0), Self::CreateTrigger(__arg1_0))
                    => __self_0 == __arg1_0,
                (Self::CreateView(__self_0), Self::CreateView(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Delete(__self_0), Self::Delete(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::DropIndex(__self_0), Self::DropIndex(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::DropTable(__self_0), Self::DropTable(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::DropTempIndex(__self_0), Self::DropTempIndex(__arg1_0))
                    => __self_0 == __arg1_0,
                (Self::DropTempTable(__self_0), Self::DropTempTable(__arg1_0))
                    => __self_0 == __arg1_0,
                (Self::DropTempTrigger(__self_0),
                    Self::DropTempTrigger(__arg1_0)) => __self_0 == __arg1_0,
                (Self::DropTempView(__self_0), Self::DropTempView(__arg1_0))
                    => __self_0 == __arg1_0,
                (Self::DropTrigger(__self_0), Self::DropTrigger(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::DropView(__self_0), Self::DropView(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Insert(__self_0), Self::Insert(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Pragma(__self_0), Self::Pragma(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Read(__self_0), Self::Read(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Select(__self_0), Self::Select(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Transaction(__self_0), Self::Transaction(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Update(__self_0), Self::Update(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Attach(__self_0), Self::Attach(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Detach(__self_0), Self::Detach(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::AlterTable(__self_0), Self::AlterTable(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Reindex(__self_0), Self::Reindex(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Analyze(__self_0), Self::Analyze(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::CreateVTable(__self_0), Self::CreateVTable(__arg1_0))
                    => __self_0 == __arg1_0,
                (Self::DropVTable(__self_0), Self::DropVTable(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Function(__self_0), Self::Function(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Savepoint(__self_0), Self::Savepoint(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Recursive(__self_0), Self::Recursive(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Unknown(__self_0), Self::Unknown(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => unsafe { ::core::intrinsics::unreachable() }
            }
    }
}PartialEq, #[automatically_derived]
impl<'a> ::core::cmp::Eq for AuthorizerContext<'a> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<CreateIndex<'a>>;
        let _: ::core::cmp::AssertParamIsEq<CreateTable<'a>>;
        let _: ::core::cmp::AssertParamIsEq<CreateTempIndex<'a>>;
        let _: ::core::cmp::AssertParamIsEq<CreateTempTable<'a>>;
        let _: ::core::cmp::AssertParamIsEq<CreateTempTrigger<'a>>;
        let _: ::core::cmp::AssertParamIsEq<CreateTempView<'a>>;
        let _: ::core::cmp::AssertParamIsEq<CreateTrigger<'a>>;
        let _: ::core::cmp::AssertParamIsEq<CreateView<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Delete<'a>>;
        let _: ::core::cmp::AssertParamIsEq<DropIndex<'a>>;
        let _: ::core::cmp::AssertParamIsEq<DropTable<'a>>;
        let _: ::core::cmp::AssertParamIsEq<DropTempIndex<'a>>;
        let _: ::core::cmp::AssertParamIsEq<DropTempTable<'a>>;
        let _: ::core::cmp::AssertParamIsEq<DropTempTrigger<'a>>;
        let _: ::core::cmp::AssertParamIsEq<DropTempView<'a>>;
        let _: ::core::cmp::AssertParamIsEq<DropTrigger<'a>>;
        let _: ::core::cmp::AssertParamIsEq<DropView<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Insert<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Pragma<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Read<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Select<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Transaction<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Update<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Attach<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Detach<'a>>;
        let _: ::core::cmp::AssertParamIsEq<AlterTable<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Reindex<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Analyze<'a>>;
        let _: ::core::cmp::AssertParamIsEq<CreateVTable<'a>>;
        let _: ::core::cmp::AssertParamIsEq<DropVTable<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Function<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Savepoint<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Recursive<'a>>;
        let _: ::core::cmp::AssertParamIsEq<Unknown<'a>>;
    }
}Eq)]
459#[non_exhaustive]
460pub enum AuthorizerContext<'a> {
461    /// `CREATE INDEX`
462    CreateIndex(CreateIndex<'a>),
463    /// `CREATE TABLE`
464    CreateTable(CreateTable<'a>),
465    /// `CREATE TEMP INDEX`
466    CreateTempIndex(CreateTempIndex<'a>),
467    /// `CREATE TEMP TABLE`
468    CreateTempTable(CreateTempTable<'a>),
469    /// `CREATE TEMP TRIGGER`
470    CreateTempTrigger(CreateTempTrigger<'a>),
471    /// `CREATE TEMP VIEW`
472    CreateTempView(CreateTempView<'a>),
473    /// `CREATE TRIGGER`
474    CreateTrigger(CreateTrigger<'a>),
475    /// `CREATE VIEW`
476    CreateView(CreateView<'a>),
477    /// `DELETE`
478    Delete(Delete<'a>),
479    /// `DROP INDEX`
480    DropIndex(DropIndex<'a>),
481    /// `DROP TABLE`
482    DropTable(DropTable<'a>),
483    /// `DROP TEMP INDEX`
484    DropTempIndex(DropTempIndex<'a>),
485    /// `DROP TEMP TABLE`
486    DropTempTable(DropTempTable<'a>),
487    /// `DROP TEMP TRIGGER`
488    DropTempTrigger(DropTempTrigger<'a>),
489    /// `DROP TEMP VIEW`
490    DropTempView(DropTempView<'a>),
491    /// `DROP TRIGGER`
492    DropTrigger(DropTrigger<'a>),
493    /// `DROP VIEW`
494    DropView(DropView<'a>),
495    /// `INSERT`
496    Insert(Insert<'a>),
497    /// `PRAGMA`
498    Pragma(Pragma<'a>),
499    /// Reading a column value.
500    Read(Read<'a>),
501    /// `SELECT`
502    Select(Select<'a>),
503    /// Transaction control (`BEGIN`, `COMMIT`, `ROLLBACK`).
504    Transaction(Transaction<'a>),
505    /// `UPDATE`
506    Update(Update<'a>),
507    /// `ATTACH DATABASE`
508    Attach(Attach<'a>),
509    /// `DETACH DATABASE`
510    Detach(Detach<'a>),
511    /// `ALTER TABLE`
512    AlterTable(AlterTable<'a>),
513    /// `REINDEX`
514    Reindex(Reindex<'a>),
515    /// `ANALYZE`
516    Analyze(Analyze<'a>),
517    /// `CREATE VIRTUAL TABLE`
518    CreateVTable(CreateVTable<'a>),
519    /// `DROP VIRTUAL TABLE`
520    DropVTable(DropVTable<'a>),
521    /// A SQL function call.
522    Function(Function<'a>),
523    /// `SAVEPOINT`
524    Savepoint(Savepoint<'a>),
525    /// A recursive `SELECT`.
526    Recursive(Recursive<'a>),
527    /// An action code this version of diesel does not model.
528    Unknown(Unknown<'a>),
529}
530
531impl<'a> AuthorizerContext<'a> {
532    /// Returns `true` if this action modifies the database schema.
533    ///
534    /// Schema-modifying actions include creating, dropping, or altering
535    /// tables, indexes, triggers, views, and virtual tables.
536    ///
537    /// # Example
538    ///
539    /// ```rust
540    /// # use diesel::prelude::*;
541    /// use diesel::sqlite::{SqliteConnection, AuthorizerContext, AuthorizerDecision};
542    ///
543    /// # let conn = &mut SqliteConnection::establish(":memory:").unwrap();
544    /// conn.on_authorize(|ctx| {
545    ///     if ctx.is_schema_modifying() {
546    ///         AuthorizerDecision::Deny
547    ///     } else {
548    ///         AuthorizerDecision::Allow
549    ///     }
550    /// });
551    /// ```
552    pub fn is_schema_modifying(&self) -> bool {
553        #[allow(non_exhaustive_omitted_patterns)] match self {
    Self::CreateIndex(_) | Self::CreateTable(_) | Self::CreateTempIndex(_) |
        Self::CreateTempTable(_) | Self::CreateTempTrigger(_) |
        Self::CreateTempView(_) | Self::CreateTrigger(_) | Self::CreateView(_)
        | Self::CreateVTable(_) | Self::DropIndex(_) | Self::DropTable(_) |
        Self::DropTempIndex(_) | Self::DropTempTable(_) |
        Self::DropTempTrigger(_) | Self::DropTempView(_) |
        Self::DropTrigger(_) | Self::DropView(_) | Self::DropVTable(_) |
        Self::AlterTable(_) => true,
    _ => false,
}matches!(
554            self,
555            Self::CreateIndex(_)
556                | Self::CreateTable(_)
557                | Self::CreateTempIndex(_)
558                | Self::CreateTempTable(_)
559                | Self::CreateTempTrigger(_)
560                | Self::CreateTempView(_)
561                | Self::CreateTrigger(_)
562                | Self::CreateView(_)
563                | Self::CreateVTable(_)
564                | Self::DropIndex(_)
565                | Self::DropTable(_)
566                | Self::DropTempIndex(_)
567                | Self::DropTempTable(_)
568                | Self::DropTempTrigger(_)
569                | Self::DropTempView(_)
570                | Self::DropTrigger(_)
571                | Self::DropView(_)
572                | Self::DropVTable(_)
573                | Self::AlterTable(_)
574        )
575    }
576
577    /// Builds the context from the raw authorizer callback arguments.
578    ///
579    /// `database` is the 5th callback argument (the database name) and
580    /// `accessor` is the 6th (the trigger or view responsible). The `arg1` and
581    /// `arg2` values are the 3rd and 4th arguments, whose meaning depends on
582    /// the action code per the SQLite documentation.
583    pub(crate) fn from_ffi(
584        code: i32,
585        arg1: Option<&'a str>,
586        arg2: Option<&'a str>,
587        database: Option<&'a str>,
588        accessor: Option<&'a str>,
589    ) -> Self {
590        match code {
591            ffi::SQLITE_CREATE_INDEX => Self::CreateIndex(CreateIndex {
592                index: arg1,
593                table: arg2,
594                database,
595                accessor,
596            }),
597            ffi::SQLITE_CREATE_TABLE => Self::CreateTable(CreateTable {
598                table: arg1,
599                database,
600                accessor,
601            }),
602            ffi::SQLITE_CREATE_TEMP_INDEX => Self::CreateTempIndex(CreateTempIndex {
603                index: arg1,
604                table: arg2,
605                database,
606                accessor,
607            }),
608            ffi::SQLITE_CREATE_TEMP_TABLE => Self::CreateTempTable(CreateTempTable {
609                table: arg1,
610                database,
611                accessor,
612            }),
613            ffi::SQLITE_CREATE_TEMP_TRIGGER => Self::CreateTempTrigger(CreateTempTrigger {
614                trigger: arg1,
615                table: arg2,
616                database,
617                accessor,
618            }),
619            ffi::SQLITE_CREATE_TEMP_VIEW => Self::CreateTempView(CreateTempView {
620                view: arg1,
621                database,
622                accessor,
623            }),
624            ffi::SQLITE_CREATE_TRIGGER => Self::CreateTrigger(CreateTrigger {
625                trigger: arg1,
626                table: arg2,
627                database,
628                accessor,
629            }),
630            ffi::SQLITE_CREATE_VIEW => Self::CreateView(CreateView {
631                view: arg1,
632                database,
633                accessor,
634            }),
635            ffi::SQLITE_DELETE => Self::Delete(Delete {
636                table: arg1,
637                database,
638                accessor,
639            }),
640            ffi::SQLITE_DROP_INDEX => Self::DropIndex(DropIndex {
641                index: arg1,
642                table: arg2,
643                database,
644                accessor,
645            }),
646            ffi::SQLITE_DROP_TABLE => Self::DropTable(DropTable {
647                table: arg1,
648                database,
649                accessor,
650            }),
651            ffi::SQLITE_DROP_TEMP_INDEX => Self::DropTempIndex(DropTempIndex {
652                index: arg1,
653                table: arg2,
654                database,
655                accessor,
656            }),
657            ffi::SQLITE_DROP_TEMP_TABLE => Self::DropTempTable(DropTempTable {
658                table: arg1,
659                database,
660                accessor,
661            }),
662            ffi::SQLITE_DROP_TEMP_TRIGGER => Self::DropTempTrigger(DropTempTrigger {
663                trigger: arg1,
664                table: arg2,
665                database,
666                accessor,
667            }),
668            ffi::SQLITE_DROP_TEMP_VIEW => Self::DropTempView(DropTempView {
669                view: arg1,
670                database,
671                accessor,
672            }),
673            ffi::SQLITE_DROP_TRIGGER => Self::DropTrigger(DropTrigger {
674                trigger: arg1,
675                table: arg2,
676                database,
677                accessor,
678            }),
679            ffi::SQLITE_DROP_VIEW => Self::DropView(DropView {
680                view: arg1,
681                database,
682                accessor,
683            }),
684            ffi::SQLITE_INSERT => Self::Insert(Insert {
685                table: arg1,
686                database,
687                accessor,
688            }),
689            ffi::SQLITE_PRAGMA => Self::Pragma(Pragma {
690                name: arg1,
691                argument: arg2,
692                database,
693                accessor,
694            }),
695            ffi::SQLITE_READ => Self::Read(Read {
696                table: arg1,
697                column: arg2,
698                database,
699                accessor,
700            }),
701            ffi::SQLITE_SELECT => Self::Select(Select { accessor }),
702            ffi::SQLITE_TRANSACTION => Self::Transaction(Transaction {
703                operation: arg1,
704                accessor,
705            }),
706            ffi::SQLITE_UPDATE => Self::Update(Update {
707                table: arg1,
708                column: arg2,
709                database,
710                accessor,
711            }),
712            ffi::SQLITE_ATTACH => Self::Attach(Attach {
713                filename: arg1,
714                accessor,
715            }),
716            ffi::SQLITE_DETACH => Self::Detach(Detach {
717                database: arg1,
718                accessor,
719            }),
720            ffi::SQLITE_ALTER_TABLE => Self::AlterTable(AlterTable {
721                database: arg1,
722                table: arg2,
723                accessor,
724            }),
725            ffi::SQLITE_REINDEX => Self::Reindex(Reindex {
726                index: arg1,
727                database,
728                accessor,
729            }),
730            ffi::SQLITE_ANALYZE => Self::Analyze(Analyze {
731                table: arg1,
732                database,
733                accessor,
734            }),
735            ffi::SQLITE_CREATE_VTABLE => Self::CreateVTable(CreateVTable {
736                table: arg1,
737                module: arg2,
738                database,
739                accessor,
740            }),
741            ffi::SQLITE_DROP_VTABLE => Self::DropVTable(DropVTable {
742                table: arg1,
743                module: arg2,
744                database,
745                accessor,
746            }),
747            ffi::SQLITE_FUNCTION => Self::Function(Function {
748                function: arg2,
749                accessor,
750            }),
751            ffi::SQLITE_SAVEPOINT => Self::Savepoint(Savepoint {
752                operation: arg1,
753                name: arg2,
754                accessor,
755            }),
756            ffi::SQLITE_RECURSIVE => Self::Recursive(Recursive { accessor }),
757            other => Self::Unknown(Unknown {
758                code: other,
759                arg1,
760                arg2,
761                database,
762                accessor,
763            }),
764        }
765    }
766}
767
768/// Authorizer callback decision.
769///
770/// Returned by the authorizer callback to indicate whether to allow,
771/// ignore, or deny the requested operation.
772#[derive(#[automatically_derived]
impl ::core::fmt::Debug for AuthorizerDecision {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                AuthorizerDecision::Allow => "Allow",
                AuthorizerDecision::Ignore => "Ignore",
                AuthorizerDecision::Deny => "Deny",
            })
    }
}Debug, #[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for AuthorizerDecision { }
#[automatically_derived]
impl ::core::clone::Clone for AuthorizerDecision {
    #[inline]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for AuthorizerDecision { }Copy, #[automatically_derived]
impl ::core::marker::StructuralPartialEq for AuthorizerDecision { }
#[automatically_derived]
impl ::core::cmp::PartialEq for AuthorizerDecision {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for AuthorizerDecision { }Eq)]
773pub enum AuthorizerDecision {
774    /// Allow the operation to proceed (`SQLITE_OK`).
775    Allow,
776    /// Ignore the operation (`SQLITE_IGNORE`).
777    ///
778    /// For `Read` actions, returns `NULL` instead of the column value.
779    /// For other actions, treats the operation as a no-op.
780    Ignore,
781    /// Deny the operation (`SQLITE_DENY`).
782    ///
783    /// Causes the entire SQL statement to fail with an authorization error.
784    Deny,
785}
786
787impl AuthorizerDecision {
788    /// Converts the decision to the FFI return code.
789    pub(crate) fn to_ffi(self) -> i32 {
790        match self {
791            Self::Allow => ffi::SQLITE_OK,
792            Self::Ignore => ffi::SQLITE_IGNORE,
793            Self::Deny => ffi::SQLITE_DENY,
794        }
795    }
796}
797
798impl SqliteConnection {
799    /// Registers an authorizer callback for SQL compilation access control.
800    /// Added in SQLite 3.0.0 (June 2004).
801    ///
802    /// The callback is invoked during `sqlite3_prepare()` (statement
803    /// compilation) to control access to database objects. It receives
804    /// an [`AuthorizerContext`] describing the operation and returns an
805    /// [`AuthorizerDecision`].
806    ///
807    /// The authorizer is consulted only at statement preparation, so treat it
808    /// as defense-in-depth rather than a complete sandbox. SQLite re-checks
809    /// already-prepared statements when an authorizer is installed. Removing the
810    /// authorizer clears diesel's statement cache so statements prepared while
811    /// it was active are re-prepared without it.
812    ///
813    /// The authorizer may be re-invoked during `sqlite3_step()` if a schema
814    /// change triggers statement recompilation.
815    ///
816    /// The callback must not modify the database connection. It is invoked
817    /// synchronously on the thread driving the connection, so it is never
818    /// called concurrently.
819    ///
820    /// Only one authorizer can be active at a time per connection.
821    /// Registering a new one replaces the previous. Panics in the callback
822    /// abort the process.
823    ///
824    /// See: [`sqlite3_set_authorizer`](https://sqlite.org/c3ref/set_authorizer.html)
825    ///
826    /// # Example
827    ///
828    /// ```rust
829    /// # use diesel::prelude::*;
830    /// use diesel::sqlite::{SqliteConnection, AuthorizerContext, AuthorizerDecision};
831    ///
832    /// # let conn = &mut SqliteConnection::establish(":memory:").unwrap();
833    /// conn.on_authorize(|ctx| match ctx {
834    ///     AuthorizerContext::Delete(_) => AuthorizerDecision::Deny,
835    ///     AuthorizerContext::DropTable(_) | AuthorizerContext::DropIndex(_) => {
836    ///         AuthorizerDecision::Deny
837    ///     }
838    ///     _ => AuthorizerDecision::Allow,
839    /// });
840    ///
841    /// // Later: remove the authorizer
842    /// conn.remove_authorizer();
843    /// ```
844    pub fn on_authorize<F>(&mut self, hook: F)
845    where
846        F: FnMut(AuthorizerContext<'_>) -> AuthorizerDecision + Send + 'static,
847    {
848        // No cache clear is needed here. Installing a non-null authorizer makes
849        // SQLite expire every prepared statement on the connection, and because
850        // diesel prepares with `sqlite3_prepare_v3` those statements are
851        // transparently re-prepared under the new authorizer on their next step.
852        self.raw_connection.set_authorizer(hook);
853        // The public documentation doesn't explicitly state what happens with existing
854        // prepared statements, so rather be safe and nuke them. We don't
855        // expect that people change the authorizer all the time, so this should be fine
856        self.statement_cache.clear();
857    }
858
859    /// Removes the authorizer callback.
860    ///
861    /// See [`on_authorize`](Self::on_authorize) for usage example.
862    pub fn remove_authorizer(&mut self) {
863        self.raw_connection.remove_authorizer();
864        // Removing an authorizer does not expire prepared statements: SQLite
865        // expires them only when a non-null authorizer is installed. A statement
866        // prepared while the authorizer was active can have its decisions
867        // compiled in (an `Ignore` on a column read, for example, bakes a `NULL`
868        // into the statement), and nothing invalidates that cached statement on
869        // removal, so it keeps returning the old result. Clear the cache to force
870        // the next query to re-prepare without the authorizer.
871        self.statement_cache.clear();
872    }
873}
874
875// miri doesn't support callbacks yet
876#[cfg(all(test, not(miri)))]
877mod tests {
878    use super::*;
879    use crate::connection::Connection;
880    use crate::query_dsl::RunQueryDsl;
881    use std::sync::Arc;
882    use std::sync::atomic::{AtomicU32, Ordering};
883
884    fn connection() -> SqliteConnection {
885        SqliteConnection::establish(":memory:").unwrap()
886    }
887
888    #[diesel_test_helper::test]
889    fn on_authorize_deny_rejects_statement() {
890        let conn = &mut connection();
891        crate::sql_query("CREATE TABLE auth_basic (id INTEGER PRIMARY KEY)")
892            .execute(conn)
893            .unwrap();
894
895        let calls = Arc::new(AtomicU32::new(0));
896        let calls2 = calls.clone();
897
898        conn.on_authorize(move |_ctx| {
899            calls2.fetch_add(1, Ordering::Relaxed);
900            AuthorizerDecision::Deny
901        });
902
903        // The authorizer is consulted while the statement is prepared, denies
904        // it, and the statement is rejected.
905        let denied = crate::sql_query("SELECT id FROM auth_basic").execute(conn);
906        assert!(denied.is_err(), "a denied statement should fail to prepare");
907        assert!(
908            calls.load(Ordering::Relaxed) > 0,
909            "the authorizer callback should have been invoked"
910        );
911
912        // Removing the authorizer restores access.
913        conn.remove_authorizer();
914        crate::sql_query("SELECT id FROM auth_basic")
915            .execute(conn)
916            .unwrap();
917    }
918
919    #[diesel_test_helper::test]
920    fn remove_authorizer_re_prepares_cached_statements() {
921        use crate::prelude::*;
922        use crate::sqlite::AuthorizerContext;
923
924        crate::table! {
925            auth_ignore_items (id) {
926                id -> Integer,
927            }
928        }
929
930        let conn = &mut connection();
931        crate::sql_query("CREATE TABLE auth_ignore_items (id INTEGER PRIMARY KEY)")
932            .execute(conn)
933            .unwrap();
934        crate::sql_query("INSERT INTO auth_ignore_items (id) VALUES (42)")
935            .execute(conn)
936            .unwrap();
937
938        // An authorizer that ignores column reads. SQLite bakes a NULL
939        // substitution for the column into the prepared (and cached) statement.
940        // A typed query is used because raw `sql_query` is never cached.
941        conn.on_authorize(|ctx| match ctx {
942            AuthorizerContext::Read(_) => AuthorizerDecision::Ignore,
943            _ => AuthorizerDecision::Allow,
944        });
945        let ignored = auth_ignore_items::table
946            .select(auth_ignore_items::id.nullable())
947            .load::<Option<i32>>(conn)
948            .unwrap();
949        assert_eq!(
950            ignored,
951            vec![None],
952            "Ignore substitutes NULL for the column"
953        );
954
955        // SQLite does not expire prepared statements when an authorizer is
956        // removed, so `remove_authorizer` clears diesel's statement cache to
957        // force the cached statement (with its baked-in NULL) to be re-prepared.
958        conn.remove_authorizer();
959        let restored = auth_ignore_items::table
960            .select(auth_ignore_items::id.nullable())
961            .load::<Option<i32>>(conn)
962            .unwrap();
963        assert_eq!(
964            restored,
965            vec![Some(42)],
966            "after removing the authorizer the real value is returned"
967        );
968    }
969
970    #[diesel_test_helper::test]
971    fn on_authorize_re_prepares_cached_statements() {
972        use crate::prelude::*;
973        use crate::sqlite::AuthorizerContext;
974
975        crate::table! {
976            auth_replace_items (id) {
977                id -> Integer,
978            }
979        }
980
981        let conn = &mut connection();
982        crate::sql_query("CREATE TABLE auth_replace_items (id INTEGER PRIMARY KEY)")
983            .execute(conn)
984            .unwrap();
985        crate::sql_query("INSERT INTO auth_replace_items (id) VALUES (42)")
986            .execute(conn)
987            .unwrap();
988
989        // A first authorizer that allows everything. The typed query is
990        // prepared and cached while it is active, returning the real value.
991        conn.on_authorize(|_ctx| AuthorizerDecision::Allow);
992        let allowed = auth_replace_items::table
993            .select(auth_replace_items::id.nullable())
994            .load::<Option<i32>>(conn)
995            .unwrap();
996        assert_eq!(
997            allowed,
998            vec![Some(42)],
999            "the allow-all authorizer returns the real value"
1000        );
1001
1002        // Installing the replacement authorizer expires the cached statement
1003        // (SQLite expires all prepared statements when a non-null authorizer is
1004        // set), so `sqlite3_prepare_v3` re-prepares it under the new authorizer
1005        // and it now yields NULL. This documents that no diesel-side cache clear
1006        // is required on the install path.
1007        conn.on_authorize(|ctx| match ctx {
1008            AuthorizerContext::Read(_) => AuthorizerDecision::Ignore,
1009            _ => AuthorizerDecision::Allow,
1010        });
1011        let ignored = auth_replace_items::table
1012            .select(auth_replace_items::id.nullable())
1013            .load::<Option<i32>>(conn)
1014            .unwrap();
1015        assert_eq!(
1016            ignored,
1017            vec![None],
1018            "after replacing the authorizer the new decision takes effect"
1019        );
1020    }
1021}