MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _RawColumnEntity

Class _RawColumnEntity

lib/sqlalchemy/orm/context.py:3238–3313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3236
3237
3238class _RawColumnEntity(_ColumnEntity):
3239 entity_zero = None
3240 mapper = None
3241 supports_single_entity = False
3242
3243 __slots__ = (
3244 "expr",
3245 "column",
3246 "_label_name",
3247 "entity_zero_or_selectable",
3248 "_extra_entities",
3249 )
3250
3251 def __init__(
3252 self,
3253 compile_state,
3254 column,
3255 entities_collection,
3256 raw_column_index,
3257 is_current_entities,
3258 parent_bundle=None,
3259 ):
3260 self.expr = column
3261 self.raw_column_index = raw_column_index
3262 self.translate_raw_column = raw_column_index is not None
3263
3264 if column._is_star:
3265 compile_state.compile_options += {"_is_star": True}
3266
3267 if not is_current_entities or column._is_text_clause:
3268 self._label_name = None
3269 else:
3270 if parent_bundle:
3271 self._label_name = column._proxy_key
3272 else:
3273 self._label_name = compile_state._label_convention(column)
3274
3275 if parent_bundle:
3276 parent_bundle._entities.append(self)
3277 else:
3278 entities_collection.append(self)
3279
3280 self.column = column
3281 self.entity_zero_or_selectable = (
3282 self.column._from_objects[0] if self.column._from_objects else None
3283 )
3284 self._extra_entities = (self.expr, self.column)
3285 self._fetch_column = self._row_processor = None
3286
3287 def corresponds_to(self, entity):
3288 return False
3289
3290 def setup_dml_returning_compile_state(
3291 self,
3292 compile_state: _ORMCompileState,
3293 adapter: Optional[_DMLReturningColFilter],
3294 ) -> None:
3295 return self.setup_compile_state(compile_state)

Callers 1

_for_columnsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected