MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / has_type

Method has_type

lib/sqlalchemy/dialects/postgresql/base.py:3337–3354  ·  view source on GitHub ↗

Return if the database has the specified type in the provided schema. :param type_name: the type to check. :param schema: schema name. If None, the default schema (typically 'public') is used. May also be set to ``'*'`` to check in all schemas. .

(
        self, type_name: str, schema: Optional[str] = None, **kw: Any
    )

Source from the content-addressed store, hash-verified

3335 )
3336
3337 def has_type(
3338 self, type_name: str, schema: Optional[str] = None, **kw: Any
3339 ) -> bool:
3340 """Return if the database has the specified type in the provided
3341 schema.
3342
3343 :param type_name: the type to check.
3344 :param schema: schema name. If None, the default schema
3345 (typically 'public') is used. May also be set to ``'*'`` to
3346 check in all schemas.
3347
3348 .. versionadded:: 2.0
3349
3350 """
3351 with self._operation_context() as conn:
3352 return self.dialect.has_type(
3353 conn, type_name, schema, info_cache=self.info_cache
3354 )
3355
3356
3357class PGExecutionContext(default.DefaultExecutionContext):

Callers

nothing calls this directly

Calls 2

_operation_contextMethod · 0.80
has_typeMethod · 0.45

Tested by

no test coverage detected