MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / truncate_target_tables

Function truncate_target_tables

scripts/migrate_sqlite_to_postgres.py:112–116  ·  view source on GitHub ↗
(connection: Connection, table_names: Iterable[str])

Source from the content-addressed store, hash-verified

110
111
112def truncate_target_tables(connection: Connection, table_names: Iterable[str]) -> None:
113 quoted_names = [quote_identifier(connection, name) for name in table_names]
114 if not quoted_names:
115 return
116 connection.execute(text(f"TRUNCATE TABLE {', '.join(quoted_names)} RESTART IDENTITY CASCADE"))
117
118
119def ensure_target_empty(connection: Connection, plan: Sequence[TablePlan]) -> None:

Callers 1

Calls 1

quote_identifierFunction · 0.85

Tested by

no test coverage detected