MCPcopy
hub / github.com/psycopg/psycopg / get_copy_stmt

Method get_copy_stmt

tests/scripts/copytest.py:77–84  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

75 return stmt
76
77 def get_copy_stmt(self) -> Query:
78 fields = sql.SQL(", ").join(
79 [sql.Identifier(f"f{i}") for i in range(self.args.nfields)]
80 )
81 stmt = sql.SQL("""\
82copy testcopy ({}) from stdin
83""").format(fields)
84 return stmt
85
86 def get_record(self) -> tuple[Any, ...]:
87 return tuple("x" * self.args.colsize for _ in range(self.args.nfields))

Callers 2

main_syncFunction · 0.95
main_asyncFunction · 0.95

Calls 2

formatMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected