Files
telegram_files_cache_server/src/prisma.rs
2023-08-09 01:34:00 +02:00

1361 lines
71 KiB
Rust

// Code generated by Prisma Client Rust. DO NOT EDIT
pub static DATAMODEL_STR: &str =
include_str!("../prisma/schema.prisma");
static DATABASE_STR: &str = "postgresql";
pub async fn new_client() -> Result<PrismaClient, ::prisma_client_rust::NewClientError> {
PrismaClient::_builder().build().await
}
pub async fn new_client_with_url(
url: &str,
) -> Result<PrismaClient, ::prisma_client_rust::NewClientError> {
PrismaClient::_builder()
.with_url(url.to_string())
.build()
.await
}
pub mod cached_file {
use super::*;
pub const NAME: &str = "CachedFile";
pub mod id {
use super::super::*;
use super::{
OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam,
};
pub const NAME: &str = "id";
pub struct Set(pub i32);
impl From<Set> for SetParam {
fn from(Set(v): Set) -> Self {
Self::SetId(v)
}
}
impl From<Set> for UncheckedSetParam {
fn from(Set(v): Set) -> Self {
Self::Id(v)
}
}
pub fn set<T: From<Set>>(value: i32) -> T {
Set(value).into()
}
pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam {
OrderByParam::Id(direction)
}
pub fn equals<T: From<UniqueWhereParam>>(value: i32) -> T {
UniqueWhereParam::IdEquals(value).into()
}
::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Id, {
fn in_vec(_: Vec<i32>) -> InVec;
fn not_in_vec(_: Vec<i32>) -> NotInVec;
fn lt(_: i32) -> Lt;
fn lte(_: i32) -> Lte;
fn gt(_: i32) -> Gt;
fn gte(_: i32) -> Gte;
fn not(_: i32) -> Not;
});
pub fn increment(value: i32) -> SetParam {
SetParam::IncrementId(value)
}
pub fn decrement(value: i32) -> SetParam {
SetParam::DecrementId(value)
}
pub fn multiply(value: i32) -> SetParam {
SetParam::MultiplyId(value)
}
pub fn divide(value: i32) -> SetParam {
SetParam::DivideId(value)
}
pub struct Include;
impl From<Include> for super::IncludeParam {
fn from(val: Include) -> Self {
super::IncludeParam::Id(val)
}
}
impl Include {
pub fn to_selection(self) -> ::prisma_client_rust::Selection {
::prisma_client_rust::sel(NAME)
}
}
pub struct Select;
impl From<Select> for super::SelectParam {
fn from(val: Select) -> Self {
super::SelectParam::Id(val)
}
}
impl Select {
pub fn to_selection(self) -> ::prisma_client_rust::Selection {
::prisma_client_rust::sel(NAME)
}
}
}
pub mod object_id {
use super::super::*;
use super::{
OrderByParam, SetParam, UncheckedSetParam, WhereParam,
};
pub const NAME: &str = "object_id";
pub struct Set(pub i32);
impl From<Set> for SetParam {
fn from(Set(v): Set) -> Self {
Self::SetObjectId(v)
}
}
impl From<Set> for UncheckedSetParam {
fn from(Set(v): Set) -> Self {
Self::ObjectId(v)
}
}
pub fn set<T: From<Set>>(value: i32) -> T {
Set(value).into()
}
pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam {
OrderByParam::ObjectId(direction)
}
pub fn equals(value: i32) -> WhereParam {
WhereParam::ObjectId(_prisma::read_filters::IntFilter::Equals(value))
}
::prisma_client_rust::scalar_where_param_fns!(
_prisma::read_filters::IntFilter,
ObjectId,
{
fn in_vec(_: Vec<i32>) -> InVec;
fn not_in_vec(_: Vec<i32>) -> NotInVec;
fn lt(_: i32) -> Lt;
fn lte(_: i32) -> Lte;
fn gt(_: i32) -> Gt;
fn gte(_: i32) -> Gte;
fn not(_: i32) -> Not;
}
);
pub fn increment(value: i32) -> SetParam {
SetParam::IncrementObjectId(value)
}
pub fn decrement(value: i32) -> SetParam {
SetParam::DecrementObjectId(value)
}
pub fn multiply(value: i32) -> SetParam {
SetParam::MultiplyObjectId(value)
}
pub fn divide(value: i32) -> SetParam {
SetParam::DivideObjectId(value)
}
pub struct Include;
impl From<Include> for super::IncludeParam {
fn from(val: Include) -> Self {
super::IncludeParam::ObjectId(val)
}
}
impl Include {
pub fn to_selection(self) -> ::prisma_client_rust::Selection {
::prisma_client_rust::sel(NAME)
}
}
pub struct Select;
impl From<Select> for super::SelectParam {
fn from(val: Select) -> Self {
super::SelectParam::ObjectId(val)
}
}
impl Select {
pub fn to_selection(self) -> ::prisma_client_rust::Selection {
::prisma_client_rust::sel(NAME)
}
}
}
pub mod object_type {
use super::super::*;
use super::{
OrderByParam, SetParam, UncheckedSetParam, WhereParam,
};
pub const NAME: &str = "object_type";
pub struct Set(pub String);
impl From<Set> for SetParam {
fn from(Set(v): Set) -> Self {
Self::SetObjectType(v)
}
}
impl From<Set> for UncheckedSetParam {
fn from(Set(v): Set) -> Self {
Self::ObjectType(v)
}
}
pub fn set<T: From<Set>>(value: String) -> T {
Set(value).into()
}
pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam {
OrderByParam::ObjectType(direction)
}
pub fn equals(value: String) -> WhereParam {
WhereParam::ObjectType(_prisma::read_filters::StringFilter::Equals(value))
}
::prisma_client_rust::scalar_where_param_fns!(
_prisma::read_filters::StringFilter,
ObjectType,
{
fn in_vec(_: Vec<String>) -> InVec;
fn not_in_vec(_: Vec<String>) -> NotInVec;
fn lt(_: String) -> Lt;
fn lte(_: String) -> Lte;
fn gt(_: String) -> Gt;
fn gte(_: String) -> Gte;
fn contains(_: String) -> Contains;
fn starts_with(_: String) -> StartsWith;
fn ends_with(_: String) -> EndsWith;
fn mode(_: super::super::QueryMode) -> Mode;
fn not(_: String) -> Not;
}
);
pub struct Include;
impl From<Include> for super::IncludeParam {
fn from(val: Include) -> Self {
super::IncludeParam::ObjectType(val)
}
}
impl Include {
pub fn to_selection(self) -> ::prisma_client_rust::Selection {
::prisma_client_rust::sel(NAME)
}
}
pub struct Select;
impl From<Select> for super::SelectParam {
fn from(val: Select) -> Self {
super::SelectParam::ObjectType(val)
}
}
impl Select {
pub fn to_selection(self) -> ::prisma_client_rust::Selection {
::prisma_client_rust::sel(NAME)
}
}
}
pub mod message_id {
use super::super::*;
use super::{
OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam,
};
pub const NAME: &str = "message_id";
pub struct Set(pub i64);
impl From<Set> for SetParam {
fn from(Set(v): Set) -> Self {
Self::SetMessageId(v)
}
}
impl From<Set> for UncheckedSetParam {
fn from(Set(v): Set) -> Self {
Self::MessageId(v)
}
}
pub fn set<T: From<Set>>(value: i64) -> T {
Set(value).into()
}
pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam {
OrderByParam::MessageId(direction)
}
pub fn equals<T: From<UniqueWhereParam>>(value: i64) -> T {
UniqueWhereParam::MessageIdEquals(value).into()
}
::prisma_client_rust::scalar_where_param_fns!(
_prisma::read_filters::BigIntFilter,
MessageId,
{
fn in_vec(_: Vec<i64>) -> InVec;
fn not_in_vec(_: Vec<i64>) -> NotInVec;
fn lt(_: i64) -> Lt;
fn lte(_: i64) -> Lte;
fn gt(_: i64) -> Gt;
fn gte(_: i64) -> Gte;
fn not(_: i64) -> Not;
}
);
pub fn increment(value: i64) -> SetParam {
SetParam::IncrementMessageId(value)
}
pub fn decrement(value: i64) -> SetParam {
SetParam::DecrementMessageId(value)
}
pub fn multiply(value: i64) -> SetParam {
SetParam::MultiplyMessageId(value)
}
pub fn divide(value: i64) -> SetParam {
SetParam::DivideMessageId(value)
}
pub struct Include;
impl From<Include> for super::IncludeParam {
fn from(val: Include) -> Self {
super::IncludeParam::MessageId(val)
}
}
impl Include {
pub fn to_selection(self) -> ::prisma_client_rust::Selection {
::prisma_client_rust::sel(NAME)
}
}
pub struct Select;
impl From<Select> for super::SelectParam {
fn from(val: Select) -> Self {
super::SelectParam::MessageId(val)
}
}
impl Select {
pub fn to_selection(self) -> ::prisma_client_rust::Selection {
::prisma_client_rust::sel(NAME)
}
}
}
pub mod chat_id {
use super::super::*;
use super::{
OrderByParam, SetParam, UncheckedSetParam, WhereParam,
};
pub const NAME: &str = "chat_id";
pub struct Set(pub i64);
impl From<Set> for SetParam {
fn from(Set(v): Set) -> Self {
Self::SetChatId(v)
}
}
impl From<Set> for UncheckedSetParam {
fn from(Set(v): Set) -> Self {
Self::ChatId(v)
}
}
pub fn set<T: From<Set>>(value: i64) -> T {
Set(value).into()
}
pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam {
OrderByParam::ChatId(direction)
}
pub fn equals(value: i64) -> WhereParam {
WhereParam::ChatId(_prisma::read_filters::BigIntFilter::Equals(value))
}
::prisma_client_rust::scalar_where_param_fns!(
_prisma::read_filters::BigIntFilter,
ChatId,
{
fn in_vec(_: Vec<i64>) -> InVec;
fn not_in_vec(_: Vec<i64>) -> NotInVec;
fn lt(_: i64) -> Lt;
fn lte(_: i64) -> Lte;
fn gt(_: i64) -> Gt;
fn gte(_: i64) -> Gte;
fn not(_: i64) -> Not;
}
);
pub fn increment(value: i64) -> SetParam {
SetParam::IncrementChatId(value)
}
pub fn decrement(value: i64) -> SetParam {
SetParam::DecrementChatId(value)
}
pub fn multiply(value: i64) -> SetParam {
SetParam::MultiplyChatId(value)
}
pub fn divide(value: i64) -> SetParam {
SetParam::DivideChatId(value)
}
pub struct Include;
impl From<Include> for super::IncludeParam {
fn from(val: Include) -> Self {
super::IncludeParam::ChatId(val)
}
}
impl Include {
pub fn to_selection(self) -> ::prisma_client_rust::Selection {
::prisma_client_rust::sel(NAME)
}
}
pub struct Select;
impl From<Select> for super::SelectParam {
fn from(val: Select) -> Self {
super::SelectParam::ChatId(val)
}
}
impl Select {
pub fn to_selection(self) -> ::prisma_client_rust::Selection {
::prisma_client_rust::sel(NAME)
}
}
}
pub fn message_id_chat_id<T: From<UniqueWhereParam>>(message_id: i64, chat_id: i64) -> T {
UniqueWhereParam::MessageIdChatIdEquals(message_id, chat_id).into()
}
pub fn object_id_object_type<T: From<UniqueWhereParam>>(
object_id: i32,
object_type: String,
) -> T {
UniqueWhereParam::ObjectIdObjectTypeEquals(object_id, object_type).into()
}
pub fn create(
object_id: i32,
object_type: String,
message_id: i64,
chat_id: i64,
_params: Vec<SetParam>,
) -> (i32, String, i64, i64, Vec<SetParam>) {
(object_id, object_type, message_id, chat_id, _params)
}
pub fn create_unchecked(
object_id: i32,
object_type: String,
message_id: i64,
chat_id: i64,
_params: Vec<SetParam>,
) -> (i32, String, i64, i64, Vec<SetParam>) {
(object_id, object_type, message_id, chat_id, _params)
}
#[macro_export]
macro_rules ! _select_cached_file { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { $crate :: prisma :: cached_file :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = $crate :: prisma :: cached_file :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: cached_file :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: cached_file :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: cached_file :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: cached_file :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , object_id , object_type , message_id , chat_id } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: cached_file :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: cached_file :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: cached_file :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: cached_file :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: cached_file :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: cached_file :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "object_id" , "object_type" , "message_id" , "chat_id"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: cached_file :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; object_id) => { i32 } ; (@ field_type ; object_type) => { String } ; (@ field_type ; message_id) => { i64 } ; (@ field_type ; chat_id) => { i64 } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "CachedFile" , available relations are "id, object_id, object_type, message_id, chat_id")) } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: cached_file :: SelectParam > :: into (crate :: prisma :: cached_file :: id :: Select) } ; (@ selection_field_to_selection_param ; object_id) => { Into :: < crate :: prisma :: cached_file :: SelectParam > :: into (crate :: prisma :: cached_file :: object_id :: Select) } ; (@ selection_field_to_selection_param ; object_type) => { Into :: < crate :: prisma :: cached_file :: SelectParam > :: into (crate :: prisma :: cached_file :: object_type :: Select) } ; (@ selection_field_to_selection_param ; message_id) => { Into :: < crate :: prisma :: cached_file :: SelectParam > :: into (crate :: prisma :: cached_file :: message_id :: Select) } ; (@ selection_field_to_selection_param ; chat_id) => { Into :: < crate :: prisma :: cached_file :: SelectParam > :: into (crate :: prisma :: cached_file :: chat_id :: Select) } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: cached_file :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; object_id) => { "object_id" } ; (@ field_serde_name ; object_type) => { "object_type" } ; (@ field_serde_name ; message_id) => { "message_id" } ; (@ field_serde_name ; chat_id) => { "chat_id" } ; }
pub use _select_cached_file as select;
pub enum SelectParam {
Id(id::Select),
ObjectId(object_id::Select),
ObjectType(object_type::Select),
MessageId(message_id::Select),
ChatId(chat_id::Select),
}
impl SelectParam {
pub fn to_selection(self) -> ::prisma_client_rust::Selection {
match self {
Self::Id(data) => data.to_selection(),
Self::ObjectId(data) => data.to_selection(),
Self::ObjectType(data) => data.to_selection(),
Self::MessageId(data) => data.to_selection(),
Self::ChatId(data) => data.to_selection(),
}
}
}
#[macro_export]
macro_rules ! _include_cached_file { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { $crate :: prisma :: cached_file :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = $crate :: prisma :: cached_file :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: cached_file :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: cached_file :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: cached_file :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: cached_file :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: cached_file :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: cached_file :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : i32 , pub object_id : i32 , pub object_type : String , pub message_id : i64 , pub chat_id : i64 , $ (pub $ field : crate :: prisma :: cached_file :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (object_id) , stringify ! (object_type) , stringify ! (message_id) , stringify ! (chat_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: cached_file :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: cached_file :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: cached_file :: object_id :: NAME , & self . object_id) ? ; state . serialize_field (crate :: prisma :: cached_file :: object_type :: NAME , & self . object_type) ? ; state . serialize_field (crate :: prisma :: cached_file :: message_id :: NAME , & self . message_id) ? ; state . serialize_field (crate :: prisma :: cached_file :: chat_id :: NAME , & self . chat_id) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , object_id , object_type , message_id , chat_id } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: cached_file :: $ field :: NAME) , + , crate :: prisma :: cached_file :: id :: NAME , crate :: prisma :: cached_file :: object_id :: NAME , crate :: prisma :: cached_file :: object_type :: NAME , crate :: prisma :: cached_file :: message_id :: NAME , crate :: prisma :: cached_file :: chat_id :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: cached_file :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: cached_file :: id :: NAME => Ok (Field :: id) , crate :: prisma :: cached_file :: object_id :: NAME => Ok (Field :: object_id) , crate :: prisma :: cached_file :: object_type :: NAME => Ok (Field :: object_type) , crate :: prisma :: cached_file :: message_id :: NAME => Ok (Field :: message_id) , crate :: prisma :: cached_file :: chat_id :: NAME => Ok (Field :: chat_id) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut object_id = None ; let mut object_type = None ; let mut message_id = None ; let mut chat_id = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: cached_file :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: object_id => { if object_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: cached_file :: object_id :: NAME)) ; } object_id = Some (map . next_value () ?) ; } Field :: object_type => { if object_type . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: cached_file :: object_type :: NAME)) ; } object_type = Some (map . next_value () ?) ; } Field :: message_id => { if message_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: cached_file :: message_id :: NAME)) ; } message_id = Some (map . next_value () ?) ; } Field :: chat_id => { if chat_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: cached_file :: chat_id :: NAME)) ; } chat_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: cached_file :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: cached_file :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: cached_file :: id :: NAME)) ? ; let object_id = object_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: cached_file :: object_id :: NAME)) ? ; let object_type = object_type . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: cached_file :: object_type :: NAME)) ? ; let message_id = message_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: cached_file :: message_id :: NAME)) ? ; let chat_id = chat_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: cached_file :: chat_id :: NAME)) ? ; Ok (Data { id , object_id , object_type , message_id , chat_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "object_id" , "object_type" , "message_id" , "chat_id"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: cached_file :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "CachedFile" , available relations are "")) } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: cached_file :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; object_id) => { "object_id" } ; (@ field_serde_name ; object_type) => { "object_type" } ; (@ field_serde_name ; message_id) => { "message_id" } ; (@ field_serde_name ; chat_id) => { "chat_id" } ; }
pub use _include_cached_file as include;
pub enum IncludeParam {
Id(id::Include),
ObjectId(object_id::Include),
ObjectType(object_type::Include),
MessageId(message_id::Include),
ChatId(chat_id::Include),
}
impl IncludeParam {
pub fn to_selection(self) -> ::prisma_client_rust::Selection {
match self {
Self::Id(data) => data.to_selection(),
Self::ObjectId(data) => data.to_selection(),
Self::ObjectType(data) => data.to_selection(),
Self::MessageId(data) => data.to_selection(),
Self::ChatId(data) => data.to_selection(),
}
}
}
#[macro_export]
macro_rules ! _partial_unchecked_cached_file { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { $crate :: prisma :: cached_file struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "object_id")] pub object_id : i32 , # [serde (rename = "object_type")] pub object_type : String , # [serde (rename = "message_id")] pub message_id : i64 , # [serde (rename = "chat_id")] pub chat_id : i64 } [$ ($ scalar_field) , +] } } ; }
pub use _partial_unchecked_cached_file as partial_unchecked;
#[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct Data {
#[serde(rename = "id")]
pub id: i32,
#[serde(rename = "object_id")]
pub object_id: i32,
#[serde(rename = "object_type")]
pub object_type: String,
#[serde(rename = "message_id")]
pub message_id: i64,
#[serde(rename = "chat_id")]
pub chat_id: i64,
}
impl Data {}
#[derive(Clone)]
pub enum WithParam {}
impl From<WithParam> for ::prisma_client_rust::Selection {
fn from(val: WithParam) -> Self {
match val {}
}
}
#[derive(Clone)]
pub enum SetParam {
SetId(i32),
IncrementId(i32),
DecrementId(i32),
MultiplyId(i32),
DivideId(i32),
SetObjectId(i32),
IncrementObjectId(i32),
DecrementObjectId(i32),
MultiplyObjectId(i32),
DivideObjectId(i32),
SetObjectType(String),
SetMessageId(i64),
IncrementMessageId(i64),
DecrementMessageId(i64),
MultiplyMessageId(i64),
DivideMessageId(i64),
SetChatId(i64),
IncrementChatId(i64),
DecrementChatId(i64),
MultiplyChatId(i64),
DivideChatId(i64),
}
impl From<SetParam> for (String, ::prisma_client_rust::PrismaValue) {
fn from(param: SetParam) -> Self {
match param {
SetParam::SetId(value) => (
id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
),
SetParam::IncrementId(value) => (
id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"increment".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)]),
),
SetParam::DecrementId(value) => (
id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"decrement".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)]),
),
SetParam::MultiplyId(value) => (
id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"multiply".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)]),
),
SetParam::DivideId(value) => (
id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"divide".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)]),
),
SetParam::SetObjectId(value) => (
object_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
),
SetParam::IncrementObjectId(value) => (
object_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"increment".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)]),
),
SetParam::DecrementObjectId(value) => (
object_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"decrement".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)]),
),
SetParam::MultiplyObjectId(value) => (
object_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"multiply".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)]),
),
SetParam::DivideObjectId(value) => (
object_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"divide".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)]),
),
SetParam::SetObjectType(value) => (
object_type::NAME.to_string(),
::prisma_client_rust::PrismaValue::String(value),
),
SetParam::SetMessageId(value) => (
message_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
),
SetParam::IncrementMessageId(value) => (
message_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"increment".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)]),
),
SetParam::DecrementMessageId(value) => (
message_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"decrement".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)]),
),
SetParam::MultiplyMessageId(value) => (
message_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"multiply".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)]),
),
SetParam::DivideMessageId(value) => (
message_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"divide".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)]),
),
SetParam::SetChatId(value) => (
chat_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
),
SetParam::IncrementChatId(value) => (
chat_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"increment".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)]),
),
SetParam::DecrementChatId(value) => (
chat_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"decrement".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)]),
),
SetParam::MultiplyChatId(value) => (
chat_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"multiply".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)]),
),
SetParam::DivideChatId(value) => (
chat_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Object(vec![(
"divide".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)]),
),
}
}
}
#[derive(Clone)]
pub enum UncheckedSetParam {
Id(i32),
ObjectId(i32),
ObjectType(String),
MessageId(i64),
ChatId(i64),
}
impl From<UncheckedSetParam> for SetParam {
fn from(param: UncheckedSetParam) -> Self {
match param {
UncheckedSetParam::Id(value) => Self::SetId(value),
UncheckedSetParam::ObjectId(value) => Self::SetObjectId(value),
UncheckedSetParam::ObjectType(value) => Self::SetObjectType(value),
UncheckedSetParam::MessageId(value) => Self::SetMessageId(value),
UncheckedSetParam::ChatId(value) => Self::SetChatId(value),
}
}
}
#[derive(Clone)]
pub enum OrderByParam {
Id(::prisma_client_rust::Direction),
ObjectId(::prisma_client_rust::Direction),
ObjectType(::prisma_client_rust::Direction),
MessageId(::prisma_client_rust::Direction),
ChatId(::prisma_client_rust::Direction),
}
impl From<OrderByParam> for (String, ::prisma_client_rust::PrismaValue) {
fn from(val: OrderByParam) -> Self {
match val {
OrderByParam::Id(direction) => (
id::NAME.to_string(),
::prisma_client_rust::PrismaValue::String(direction.to_string()),
),
OrderByParam::ObjectId(direction) => (
object_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::String(direction.to_string()),
),
OrderByParam::ObjectType(direction) => (
object_type::NAME.to_string(),
::prisma_client_rust::PrismaValue::String(direction.to_string()),
),
OrderByParam::MessageId(direction) => (
message_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::String(direction.to_string()),
),
OrderByParam::ChatId(direction) => (
chat_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::String(direction.to_string()),
),
}
}
}
#[derive(Clone)]
pub enum WhereParam {
Not(Vec<WhereParam>),
Or(Vec<WhereParam>),
And(Vec<WhereParam>),
MessageIdChatIdEquals(i64, i64),
ObjectIdObjectTypeEquals(i32, String),
Id(_prisma::read_filters::IntFilter),
ObjectId(_prisma::read_filters::IntFilter),
ObjectType(_prisma::read_filters::StringFilter),
MessageId(_prisma::read_filters::BigIntFilter),
ChatId(_prisma::read_filters::BigIntFilter),
}
impl ::prisma_client_rust::WhereInput for WhereParam {
fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput {
let (name, value) = match self {
Self::Not(value) => (
"NOT",
::prisma_client_rust::SerializedWhereValue::Object(
::prisma_client_rust::merge_fields(
value
.into_iter()
.map(::prisma_client_rust::WhereInput::serialize)
.map(Into::into)
.collect(),
),
),
),
Self::Or(value) => (
"OR",
::prisma_client_rust::SerializedWhereValue::List(
value
.into_iter()
.map(::prisma_client_rust::WhereInput::serialize)
.map(Into::into)
.map(|v| vec![v])
.map(::prisma_client_rust::PrismaValue::Object)
.collect(),
),
),
Self::And(value) => (
"AND",
::prisma_client_rust::SerializedWhereValue::Object(
::prisma_client_rust::merge_fields(
value
.into_iter()
.map(::prisma_client_rust::WhereInput::serialize)
.map(Into::into)
.collect(),
),
),
),
Self::MessageIdChatIdEquals(message_id, chat_id) => (
"message_id_chat_id",
::prisma_client_rust::SerializedWhereValue::Object(vec![
(
message_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::BigInt(message_id),
),
(
chat_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::BigInt(chat_id),
),
]),
),
Self::ObjectIdObjectTypeEquals(object_id, object_type) => (
"object_id_object_type",
::prisma_client_rust::SerializedWhereValue::Object(vec![
(
object_id::NAME.to_string(),
::prisma_client_rust::PrismaValue::Int(object_id as i64),
),
(
object_type::NAME.to_string(),
::prisma_client_rust::PrismaValue::String(object_type),
),
]),
),
Self::Id(value) => (id::NAME, value.into()),
Self::ObjectId(value) => (object_id::NAME, value.into()),
Self::ObjectType(value) => (object_type::NAME, value.into()),
Self::MessageId(value) => (message_id::NAME, value.into()),
Self::ChatId(value) => (chat_id::NAME, value.into()),
};
::prisma_client_rust::SerializedWhereInput::new(name, value)
}
}
#[derive(Clone)]
pub enum UniqueWhereParam {
MessageIdEquals(i64),
MessageIdChatIdEquals(i64, i64),
ObjectIdObjectTypeEquals(i32, String),
IdEquals(i32),
}
impl From<UniqueWhereParam> for WhereParam {
fn from(value: UniqueWhereParam) -> Self {
match value {
UniqueWhereParam::MessageIdEquals(value) => {
Self::MessageId(_prisma::read_filters::BigIntFilter::Equals(value))
}
UniqueWhereParam::MessageIdChatIdEquals(message_id, chat_id) => {
Self::MessageIdChatIdEquals(message_id, chat_id)
}
UniqueWhereParam::ObjectIdObjectTypeEquals(object_id, object_type) => {
Self::ObjectIdObjectTypeEquals(object_id, object_type)
}
UniqueWhereParam::IdEquals(value) => {
Self::Id(_prisma::read_filters::IntFilter::Equals(value))
}
}
}
}
impl From<::prisma_client_rust::Operator<Self>> for WhereParam {
fn from(op: ::prisma_client_rust::Operator<Self>) -> Self {
match op {
::prisma_client_rust::Operator::Not(value) => Self::Not(value),
::prisma_client_rust::Operator::And(value) => Self::And(value),
::prisma_client_rust::Operator::Or(value) => Self::Or(value),
}
}
}
#[derive(Clone)]
pub struct Types;
impl ::prisma_client_rust::ModelTypes for Types {
type Data = Data;
type Where = WhereParam;
type UncheckedSet = UncheckedSetParam;
type Set = SetParam;
type With = WithParam;
type OrderBy = OrderByParam;
type Cursor = UniqueWhereParam;
const MODEL: &'static str = NAME;
fn scalar_selections() -> Vec<::prisma_client_rust::Selection> {
vec![
::prisma_client_rust::sel(id::NAME),
::prisma_client_rust::sel(object_id::NAME),
::prisma_client_rust::sel(object_type::NAME),
::prisma_client_rust::sel(message_id::NAME),
::prisma_client_rust::sel(chat_id::NAME),
]
}
}
pub type UniqueArgs = ::prisma_client_rust::UniqueArgs<Types>;
pub type ManyArgs = ::prisma_client_rust::ManyArgs<Types>;
pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>;
pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>;
pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>;
pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>;
pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>;
pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>;
pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>;
pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>;
pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>;
pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>;
pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>;
#[derive(Clone)]
pub struct Actions<'a> {
pub client: &'a ::prisma_client_rust::PrismaClientInternals,
}
impl<'a> Actions<'a> {
pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> {
FindUnique::new(self.client, _where.into())
}
pub fn find_first(self, _where: Vec<WhereParam>) -> FindFirst<'a> {
FindFirst::new(self.client, _where)
}
pub fn find_many(self, _where: Vec<WhereParam>) -> FindMany<'a> {
FindMany::new(self.client, _where)
}
pub fn create(
self,
object_id: i32,
object_type: String,
message_id: i64,
chat_id: i64,
mut _params: Vec<SetParam>,
) -> Create<'a> {
_params.extend([
object_id::set(object_id),
object_type::set(object_type),
message_id::set(message_id),
chat_id::set(chat_id),
]);
Create::new(self.client, _params)
}
pub fn create_unchecked(
self,
object_id: i32,
object_type: String,
message_id: i64,
chat_id: i64,
mut _params: Vec<UncheckedSetParam>,
) -> Create<'a> {
_params.extend([
object_id::set(object_id),
object_type::set(object_type),
message_id::set(message_id),
chat_id::set(chat_id),
]);
Create::new(self.client, _params.into_iter().map(Into::into).collect())
}
pub fn create_many(
self,
data: Vec<(i32, String, i64, i64, Vec<SetParam>)>,
) -> CreateMany<'a> {
let data = data
.into_iter()
.map(
|(object_id, object_type, message_id, chat_id, mut _params)| {
_params.extend([
object_id::set(object_id),
object_type::set(object_type),
message_id::set(message_id),
chat_id::set(chat_id),
]);
_params
},
)
.collect();
CreateMany::new(self.client, data)
}
pub fn update(self, _where: UniqueWhereParam, _params: Vec<SetParam>) -> Update<'a> {
Update::new(self.client, _where.into(), _params, vec![])
}
pub fn update_unchecked(
self,
_where: UniqueWhereParam,
_params: Vec<UncheckedSetParam>,
) -> Update<'a> {
Update::new(
self.client,
_where.into(),
_params.into_iter().map(Into::into).collect(),
vec![],
)
}
pub fn update_many(
self,
_where: Vec<WhereParam>,
_params: Vec<SetParam>,
) -> UpdateMany<'a> {
UpdateMany::new(self.client, _where, _params)
}
pub fn upsert(
self,
_where: UniqueWhereParam,
(object_id, object_type, message_id, chat_id, mut _params): (
i32,
String,
i64,
i64,
Vec<SetParam>,
),
_update: Vec<SetParam>,
) -> Upsert<'a> {
_params.extend([
object_id::set(object_id),
object_type::set(object_type),
message_id::set(message_id),
chat_id::set(chat_id),
]);
Upsert::new(self.client, _where.into(), _params, _update)
}
pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> {
Delete::new(self.client, _where.into(), vec![])
}
pub fn delete_many(self, _where: Vec<WhereParam>) -> DeleteMany<'a> {
DeleteMany::new(self.client, _where)
}
pub fn count(self, _where: Vec<WhereParam>) -> Count<'a> {
Count::new(self.client, _where)
}
pub fn find_raw<T: ::prisma_client_rust::Data>(
self,
) -> ::prisma_client_rust::FindRaw<'a, Types, T> {
::prisma_client_rust::FindRaw::new(self.client)
}
pub fn aggregate_raw<T: ::prisma_client_rust::Data>(
self,
) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> {
::prisma_client_rust::AggregateRaw::new(self.client)
}
}
}
pub mod _prisma {
pub struct PrismaClientBuilder {
url: Option<String>,
action_notifier: ::prisma_client_rust::ActionNotifier,
}
impl PrismaClientBuilder {
fn new() -> Self {
Self {
url: None,
action_notifier: ::prisma_client_rust::ActionNotifier::new(),
}
}
pub fn with_url(mut self, url: String) -> Self {
self.url = Some(url);
self
}
pub async fn build(self) -> Result<PrismaClient, ::prisma_client_rust::NewClientError> {
let internals = ::prisma_client_rust::PrismaClientInternals::new(
self.url,
self.action_notifier,
super::DATAMODEL_STR,
)
.await?;
Ok(PrismaClient(internals))
}
}
pub struct PrismaClient(::prisma_client_rust::PrismaClientInternals);
impl ::std::fmt::Debug for PrismaClient {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.debug_struct("PrismaClient").finish()
}
}
impl PrismaClient {
pub fn _builder() -> PrismaClientBuilder {
PrismaClientBuilder::new()
}
pub fn _query_raw<T: ::prisma_client_rust::Data>(
&self,
query: ::prisma_client_rust::Raw,
) -> ::prisma_client_rust::QueryRaw<T> {
::prisma_client_rust::QueryRaw::new(&self.0, query, super::DATABASE_STR)
}
pub fn _execute_raw(
&self,
query: ::prisma_client_rust::Raw,
) -> ::prisma_client_rust::ExecuteRaw {
::prisma_client_rust::ExecuteRaw::new(&self.0, query, super::DATABASE_STR)
}
pub async fn _batch<
'batch,
T: ::prisma_client_rust::BatchContainer<'batch, Marker>,
Marker,
>(
&self,
queries: T,
) -> ::prisma_client_rust::Result<
<T as ::prisma_client_rust::BatchContainer<'batch, Marker>>::ReturnType,
> {
::prisma_client_rust::batch(queries, &self.0).await
}
pub fn _transaction(&self) -> ::prisma_client_rust::TransactionBuilder<Self> {
::prisma_client_rust::TransactionBuilder::_new(self, &self.0)
}
pub fn cached_file(&self) -> super::cached_file::Actions {
super::cached_file::Actions { client: &self.0 }
}
}
impl ::prisma_client_rust::PrismaClient for PrismaClient {
fn internals(&self) -> &::prisma_client_rust::PrismaClientInternals {
&self.0
}
fn internals_mut(&mut self) -> &mut ::prisma_client_rust::PrismaClientInternals {
&mut self.0
}
fn with_tx_id(&self, tx_id: Option<::prisma_client_rust::query_core::TxId>) -> Self {
Self(self.0.with_tx_id(tx_id))
}
}
#[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)]
pub enum CachedFileScalarFieldEnum {
#[serde(rename = "id")]
Id,
#[serde(rename = "object_id")]
ObjectId,
#[serde(rename = "object_type")]
ObjectType,
#[serde(rename = "message_id")]
MessageId,
#[serde(rename = "chat_id")]
ChatId,
}
impl ToString for CachedFileScalarFieldEnum {
fn to_string(&self) -> String {
match self {
Self::Id => "id".to_string(),
Self::ObjectId => "object_id".to_string(),
Self::ObjectType => "object_type".to_string(),
Self::MessageId => "message_id".to_string(),
Self::ChatId => "chat_id".to_string(),
}
}
}
#[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)]
pub enum QueryMode {
#[serde(rename = "default")]
Default,
#[serde(rename = "insensitive")]
Insensitive,
}
impl ToString for QueryMode {
fn to_string(&self) -> String {
match self {
Self::Default => "default".to_string(),
Self::Insensitive => "insensitive".to_string(),
}
}
}
#[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)]
pub enum SortOrder {
#[serde(rename = "asc")]
Asc,
#[serde(rename = "desc")]
Desc,
}
impl ToString for SortOrder {
fn to_string(&self) -> String {
match self {
Self::Asc => "asc".to_string(),
Self::Desc => "desc".to_string(),
}
}
}
#[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)]
pub enum TransactionIsolationLevel {
#[serde(rename = "ReadUncommitted")]
ReadUncommitted,
#[serde(rename = "ReadCommitted")]
ReadCommitted,
#[serde(rename = "RepeatableRead")]
RepeatableRead,
#[serde(rename = "Serializable")]
Serializable,
}
impl ToString for TransactionIsolationLevel {
fn to_string(&self) -> String {
match self {
Self::ReadUncommitted => "ReadUncommitted".to_string(),
Self::ReadCommitted => "ReadCommitted".to_string(),
Self::RepeatableRead => "RepeatableRead".to_string(),
Self::Serializable => "Serializable".to_string(),
}
}
}
impl ::prisma_client_rust::TransactionIsolationLevel for TransactionIsolationLevel {}
pub mod read_filters {
#[derive(Clone)]
pub enum IntFilter {
Equals(i32),
InVec(Vec<i32>),
NotInVec(Vec<i32>),
Lt(i32),
Lte(i32),
Gt(i32),
Gte(i32),
Not(i32),
}
impl Into<::prisma_client_rust::SerializedWhereValue> for IntFilter {
fn into(self) -> ::prisma_client_rust::SerializedWhereValue {
match self {
Self::Equals(value) => {
::prisma_client_rust::SerializedWhereValue::Object(vec![(
"equals".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)])
}
Self::InVec(value) => {
::prisma_client_rust::SerializedWhereValue::Object(vec![(
"in".to_string(),
::prisma_client_rust::PrismaValue::List(
value
.into_iter()
.map(|value| {
::prisma_client_rust::PrismaValue::Int(value as i64)
})
.collect(),
),
)])
}
Self::NotInVec(value) => {
::prisma_client_rust::SerializedWhereValue::Object(vec![(
"notIn".to_string(),
::prisma_client_rust::PrismaValue::List(
value
.into_iter()
.map(|value| {
::prisma_client_rust::PrismaValue::Int(value as i64)
})
.collect(),
),
)])
}
Self::Lt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"lt".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)]),
Self::Lte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"lte".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)]),
Self::Gt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"gt".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)]),
Self::Gte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"gte".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)]),
Self::Not(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"not".to_string(),
::prisma_client_rust::PrismaValue::Int(value as i64),
)]),
}
}
}
#[derive(Clone)]
pub enum StringFilter {
Equals(String),
InVec(Vec<String>),
NotInVec(Vec<String>),
Lt(String),
Lte(String),
Gt(String),
Gte(String),
Contains(String),
StartsWith(String),
EndsWith(String),
Mode(super::super::QueryMode),
Not(String),
}
impl Into<::prisma_client_rust::SerializedWhereValue> for StringFilter {
fn into(self) -> ::prisma_client_rust::SerializedWhereValue {
match self {
Self::Equals(value) => {
::prisma_client_rust::SerializedWhereValue::Object(vec![(
"equals".to_string(),
::prisma_client_rust::PrismaValue::String(value),
)])
}
Self::InVec(value) => {
::prisma_client_rust::SerializedWhereValue::Object(vec![(
"in".to_string(),
::prisma_client_rust::PrismaValue::List(
value
.into_iter()
.map(::prisma_client_rust::PrismaValue::String)
.collect(),
),
)])
}
Self::NotInVec(value) => {
::prisma_client_rust::SerializedWhereValue::Object(vec![(
"notIn".to_string(),
::prisma_client_rust::PrismaValue::List(
value
.into_iter()
.map(::prisma_client_rust::PrismaValue::String)
.collect(),
),
)])
}
Self::Lt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"lt".to_string(),
::prisma_client_rust::PrismaValue::String(value),
)]),
Self::Lte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"lte".to_string(),
::prisma_client_rust::PrismaValue::String(value),
)]),
Self::Gt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"gt".to_string(),
::prisma_client_rust::PrismaValue::String(value),
)]),
Self::Gte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"gte".to_string(),
::prisma_client_rust::PrismaValue::String(value),
)]),
Self::Contains(value) => {
::prisma_client_rust::SerializedWhereValue::Object(vec![(
"contains".to_string(),
::prisma_client_rust::PrismaValue::String(value),
)])
}
Self::StartsWith(value) => {
::prisma_client_rust::SerializedWhereValue::Object(vec![(
"startsWith".to_string(),
::prisma_client_rust::PrismaValue::String(value),
)])
}
Self::EndsWith(value) => {
::prisma_client_rust::SerializedWhereValue::Object(vec![(
"endsWith".to_string(),
::prisma_client_rust::PrismaValue::String(value),
)])
}
Self::Mode(value) => {
::prisma_client_rust::SerializedWhereValue::Object(vec![(
"mode".to_string(),
::prisma_client_rust::PrismaValue::Enum(value.to_string()),
)])
}
Self::Not(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"not".to_string(),
::prisma_client_rust::PrismaValue::String(value),
)]),
}
}
}
#[derive(Clone)]
pub enum BigIntFilter {
Equals(i64),
InVec(Vec<i64>),
NotInVec(Vec<i64>),
Lt(i64),
Lte(i64),
Gt(i64),
Gte(i64),
Not(i64),
}
impl Into<::prisma_client_rust::SerializedWhereValue> for BigIntFilter {
fn into(self) -> ::prisma_client_rust::SerializedWhereValue {
match self {
Self::Equals(value) => {
::prisma_client_rust::SerializedWhereValue::Object(vec![(
"equals".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)])
}
Self::InVec(value) => {
::prisma_client_rust::SerializedWhereValue::Object(vec![(
"in".to_string(),
::prisma_client_rust::PrismaValue::List(
value
.into_iter()
.map(::prisma_client_rust::PrismaValue::BigInt)
.collect(),
),
)])
}
Self::NotInVec(value) => {
::prisma_client_rust::SerializedWhereValue::Object(vec![(
"notIn".to_string(),
::prisma_client_rust::PrismaValue::List(
value
.into_iter()
.map(::prisma_client_rust::PrismaValue::BigInt)
.collect(),
),
)])
}
Self::Lt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"lt".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)]),
Self::Lte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"lte".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)]),
Self::Gt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"gt".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)]),
Self::Gte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"gte".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)]),
Self::Not(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![(
"not".to_string(),
::prisma_client_rust::PrismaValue::BigInt(value),
)]),
}
}
}
}
}
pub use _prisma::*;