MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __init__

Method __init__

lib/sqlalchemy/sql/elements.py:2058–2159  ·  view source on GitHub ↗
(
        self,
        key: Optional[str],
        value: Any = _NoArg.NO_ARG,
        type_: Optional[_TypeEngineArgument[_T]] = None,
        unique: bool = False,
        required: Union[bool, Literal[_NoArg.NO_ARG]] = _NoArg.NO_ARG,
        quote: Optional[bool] = None,
        callable_: Optional[Callable[[], Any]] = None,
        expanding: bool = False,
        isoutparam: bool = False,
        literal_execute: bool = False,
        _compared_to_operator: Optional[OperatorType] = None,
        _compared_to_type: Optional[TypeEngine[Any]] = None,
        _is_crud: bool = False,
    )

Source from the content-addressed store, hash-verified

2056 inherit_cache = True
2057
2058 def __init__(
2059 self,
2060 key: Optional[str],
2061 value: Any = _NoArg.NO_ARG,
2062 type_: Optional[_TypeEngineArgument[_T]] = None,
2063 unique: bool = False,
2064 required: Union[bool, Literal[_NoArg.NO_ARG]] = _NoArg.NO_ARG,
2065 quote: Optional[bool] = None,
2066 callable_: Optional[Callable[[], Any]] = None,
2067 expanding: bool = False,
2068 isoutparam: bool = False,
2069 literal_execute: bool = False,
2070 _compared_to_operator: Optional[OperatorType] = None,
2071 _compared_to_type: Optional[TypeEngine[Any]] = None,
2072 _is_crud: bool = False,
2073 ):
2074 if required is _NoArg.NO_ARG:
2075 required = value is _NoArg.NO_ARG and callable_ is None
2076 if value is _NoArg.NO_ARG:
2077 value = None
2078
2079 if quote is not None:
2080 key = quoted_name.construct(key, quote)
2081
2082 if unique:
2083 self.key, self._anon_map_key = (
2084 _anonymous_label.safe_construct_with_key(
2085 id(self),
2086 (
2087 key
2088 if key is not None
2089 and not isinstance(key, _anonymous_label)
2090 else "param"
2091 ),
2092 sanitize_key=True,
2093 )
2094 )
2095 elif key:
2096 self.key = key
2097 else:
2098 self.key, self._anon_map_key = (
2099 _anonymous_label.safe_construct_with_key(id(self), "param")
2100 )
2101
2102 # identifying key that won't change across
2103 # clones, used to identify the bind's logical
2104 # identity
2105 self._identifying_key = self.key
2106
2107 # key that was passed in the first place, used to
2108 # generate new keys
2109 self._orig_key = key or "param"
2110
2111 self.unique = unique
2112 self.value = value
2113 self.callable = callable_
2114 self.isoutparam = isoutparam
2115 self.required = required

Callers

nothing calls this directly

Calls 6

is_tuple_typeFunction · 0.85
castFunction · 0.70
constructMethod · 0.45
coerce_compared_valueMethod · 0.45

Tested by

no test coverage detected