pub struct PythonBackend;Expand description
Python language backend.
Trait Implementations§
Source§impl LanguageBackend for PythonBackend
impl LanguageBackend for PythonBackend
Source§fn scalar_to_type(&self, scalar: &ScalarType) -> &'static str
fn scalar_to_type(&self, scalar: &ScalarType) -> &'static str
Maps a Nautilus scalar type to the target language’s type name.
Source§fn array_type(&self, inner: &str) -> String
fn array_type(&self, inner: &str) -> String
Wraps a type name in the language’s array/list syntax. Read more
Source§fn not_in_suffix(&self) -> &'static str
fn not_in_suffix(&self) -> &'static str
Suffix for the “not in collection” operator. Read more
Source§fn startswith_suffix(&self) -> &'static str
fn startswith_suffix(&self) -> &'static str
Suffix for the “starts with” string operator. Read more
Source§fn endswith_suffix(&self) -> &'static str
fn endswith_suffix(&self) -> &'static str
Suffix for the “ends with” string operator. Read more
Source§fn null_suffix(&self) -> &'static str
fn null_suffix(&self) -> &'static str
Suffix for the null-check operator. Read more
Source§fn null_literal(&self) -> &'static str
fn null_literal(&self) -> &'static str
The null literal in this language (Python:
"None", TS: "null").Source§fn true_literal(&self) -> &'static str
fn true_literal(&self) -> &'static str
The boolean true literal (Python:
"True", TS: "true").Source§fn false_literal(&self) -> &'static str
fn false_literal(&self) -> &'static str
The boolean false literal (Python:
"False", TS: "false").Source§fn string_literal(&self, s: &str) -> String
fn string_literal(&self, s: &str) -> String
Format a string literal (Python:
"\"hello\"", TS: "'hello'").Source§fn empty_array_literal(&self) -> &'static str
fn empty_array_literal(&self) -> &'static str
The empty-array factory expression (Python:
"Field(default_factory=list)", TS: "[]").Source§fn is_auto_generated(&self, field: &FieldIr) -> bool
fn is_auto_generated(&self, field: &FieldIr) -> bool
Returns
true for fields whose values are supplied automatically by the
database: autoincrement(), uuid(), or now(). Read moreSource§fn numeric_operators(&self, type_name: &str) -> Vec<FilterOperator>
fn numeric_operators(&self, type_name: &str) -> Vec<FilterOperator>
Returns the standard comparison operators (
lt, lte, gt, gte,
in, not_in/notIn) for a numeric-like type.Source§fn get_filter_operators_for_scalar(
&self,
scalar: &ScalarType,
) -> Vec<FilterOperator>
fn get_filter_operators_for_scalar( &self, scalar: &ScalarType, ) -> Vec<FilterOperator>
Returns the filter operators available for a given scalar type.
Source§fn get_filter_operators_for_field(
&self,
field: &FieldIr,
enums: &HashMap<String, EnumIr>,
) -> Vec<FilterOperator>
fn get_filter_operators_for_field( &self, field: &FieldIr, enums: &HashMap<String, EnumIr>, ) -> Vec<FilterOperator>
Returns filter operators for a field, considering its resolved type
(scalar, enum, or relation).
Source§fn enum_variant_literal(&self, variant: &str) -> String
fn enum_variant_literal(&self, variant: &str) -> String
Format an enum variant as a default value (Python: unquoted, TS: single-quoted).
Source§fn relation_type(&self, target_model: &str) -> String
fn relation_type(&self, target_model: &str) -> String
Resolves the base type name for a relation field. Read more
Auto Trait Implementations§
impl Freeze for PythonBackend
impl RefUnwindSafe for PythonBackend
impl Send for PythonBackend
impl Sync for PythonBackend
impl Unpin for PythonBackend
impl UnsafeUnpin for PythonBackend
impl UnwindSafe for PythonBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more