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

Function main

scripts/migrate_sqlite_to_postgres.py:266–286  ·  view source on GitHub ↗
(argv: Sequence[str] | None = None)

Source from the content-addressed store, hash-verified

264
265
266def main(argv: Sequence[str] | None = None) -> int:
267 parser = build_argument_parser()
268 args = parser.parse_args(argv)
269 target_url = resolve_target_url(args.target)
270
271 try:
272 results = migrate_sqlite_to_postgres(
273 source_url=args.source,
274 target_url=target_url,
275 batch_size=args.batch_size,
276 truncate_target=args.truncate_target,
277 )
278 except MigrationError as exc:
279 parser.error(str(exc))
280 return 2
281 except Exception as exc:
282 print(f"迁移失败: {exc}", file=sys.stderr)
283 return 1
284
285 print_summary(results)
286 return 0
287
288
289if __name__ == "__main__":

Callers 1

Calls 5

build_argument_parserFunction · 0.85
resolve_target_urlFunction · 0.85
print_summaryFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected