MCPcopy Create free account
hub / github.com/tortoise/tortoise-orm / PsycopgSQLQueryBuilder

Class PsycopgSQLQueryBuilder

tortoise/backends/psycopg/client.py:43–53  ·  view source on GitHub ↗

Psycopg opted to use a custom parameter placeholder, so we need to override the default

Source from the content-addressed store, hash-verified

41
42
43class PsycopgSQLQueryBuilder(PostgreSQLQueryBuilder):
44 """
45 Psycopg opted to use a custom parameter placeholder, so we need to override the default
46 """
47
48 def get_parameterized_sql(self, ctx: SqlContext | None = None) -> tuple[str, list]:
49 if not ctx:
50 ctx = self.QUERY_CLS.SQL_CONTEXT
51 if not ctx.parameterizer:
52 ctx = ctx.copy(parameterizer=Parameterizer(placeholder_factory=lambda _: "%s"))
53 return super().get_parameterized_sql(ctx)
54
55
56class PsycopgClient(postgres_client.BasePostgresClient):

Callers 1

_builderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…