MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / get_check_constraints

Method get_check_constraints

lib/sqlalchemy/dialects/mysql/base.py:3467–3483  ·  view source on GitHub ↗
(
        self,
        connection: Connection,
        table_name: str,
        schema: Optional[str] = None,
        **kw: Any,
    )

Source from the content-addressed store, hash-verified

3465
3466 @reflection.cache
3467 def get_check_constraints(
3468 self,
3469 connection: Connection,
3470 table_name: str,
3471 schema: Optional[str] = None,
3472 **kw: Any,
3473 ) -> list[ReflectedCheckConstraint]:
3474 parsed_state = self._parsed_state_or_create(
3475 connection, table_name, schema, **kw
3476 )
3477
3478 cks: list[ReflectedCheckConstraint] = [
3479 {"name": spec["name"], "sqltext": spec["sqltext"]}
3480 for spec in parsed_state.ck_constraints
3481 ]
3482 cks.sort(key=lambda d: d["name"] or "~") # sort None as last
3483 return cks if cks else ReflectionDefaults.check_constraints()
3484
3485 @reflection.cache
3486 def get_table_comment(

Callers

nothing calls this directly

Calls 3

sortMethod · 0.45
check_constraintsMethod · 0.45

Tested by

no test coverage detected