MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _copy

Method _copy

lib/sqlalchemy/sql/schema.py:4942–4963  ·  view source on GitHub ↗
(
        self, *, target_table: Optional[Table] = None, **kw: Any
    )

Source from the content-addressed store, hash-verified

4940 return self._copy(target_table=target_table, **kw)
4941
4942 def _copy(
4943 self, *, target_table: Optional[Table] = None, **kw: Any
4944 ) -> CheckConstraint:
4945 if target_table is not None:
4946 # note that target_table is None for the copy process of
4947 # a column-bound CheckConstraint, so this path is not reached
4948 # in that case.
4949 sqltext = _copy_expression(self.sqltext, self.table, target_table)
4950 else:
4951 sqltext = self.sqltext
4952 c = CheckConstraint(
4953 sqltext,
4954 name=self.name,
4955 initially=self.initially,
4956 deferrable=self.deferrable,
4957 _create_rule=self._create_rule,
4958 table=target_table,
4959 comment=self.comment,
4960 _autoattach=False,
4961 _type_bound=self._type_bound,
4962 )
4963 return self._schema_item_copy(c)
4964
4965
4966class ForeignKeyConstraint(ColumnCollectionConstraint):

Callers 3

copyMethod · 0.95

Calls 3

_copy_expressionFunction · 0.85
CheckConstraintClass · 0.85
_schema_item_copyMethod · 0.80

Tested by 2