Skip to main content

PythonBackend

Struct PythonBackend 

Source
pub struct PythonBackend;
Expand description

Python language backend.

Trait Implementations§

Source§

impl LanguageBackend for PythonBackend

Source§

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

Wraps a type name in the language’s array/list syntax. Read more
Source§

fn not_in_suffix(&self) -> &'static str

Suffix for the “not in collection” operator. Read more
Source§

fn startswith_suffix(&self) -> &'static str

Suffix for the “starts with” string operator. Read more
Source§

fn endswith_suffix(&self) -> &'static str

Suffix for the “ends with” string operator. Read more
Source§

fn null_suffix(&self) -> &'static str

Suffix for the null-check operator. Read more
Source§

fn null_literal(&self) -> &'static str

The null literal in this language (Python: "None", TS: "null").
Source§

fn true_literal(&self) -> &'static str

The boolean true literal (Python: "True", TS: "true").
Source§

fn false_literal(&self) -> &'static str

The boolean false literal (Python: "False", TS: "false").
Source§

fn string_literal(&self, s: &str) -> String

Format a string literal (Python: "\"hello\"", TS: "'hello'").
Source§

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

Returns true for fields whose values are supplied automatically by the database: autoincrement(), uuid(), or now(). Read more
Source§

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>

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>

Returns filter operators for a field, considering its resolved type (scalar, enum, or relation).
Source§

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

Resolves the base type name for a relation field. Read more
Source§

fn get_base_type( &self, field: &FieldIr, enums: &HashMap<String, EnumIr>, ) -> String

Returns the bare base type for a field without array or optional wrappers.
Source§

fn get_default_value(&self, field: &FieldIr) -> Option<String>

Returns the default value expression for a field, or None if no default.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V