MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / get_domains

Method get_domains

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

Return a list of DOMAIN objects. Each member is a dictionary containing these fields: * name - name of the domain * schema - the schema name for the domain. * visible - boolean, whether or not this domain is visible in the default search pa

(
        self, schema: Optional[str] = None
    )

Source from the content-addressed store, hash-verified

3267 )
3268
3269 def get_domains(
3270 self, schema: Optional[str] = None
3271 ) -> List[ReflectedDomain]:
3272 """Return a list of DOMAIN objects.
3273
3274 Each member is a dictionary containing these fields:
3275
3276 * name - name of the domain
3277 * schema - the schema name for the domain.
3278 * visible - boolean, whether or not this domain is visible
3279 in the default search path.
3280 * type - the type defined by this domain.
3281 * nullable - Indicates if this domain can be ``NULL``.
3282 * default - The default value of the domain or ``None`` if the
3283 domain has no default.
3284 * constraints - A list of dict with the constraint defined by this
3285 domain. Each element contains two keys: ``name`` of the
3286 constraint and ``check`` with the constraint text.
3287
3288 :param schema: schema name. If None, the default schema
3289 (typically 'public') is used. May also be set to ``'*'`` to
3290 indicate load domains for all schemas.
3291
3292 .. versionadded:: 2.0
3293
3294 """
3295 with self._operation_context() as conn:
3296 return self.dialect._load_domains(
3297 conn, schema, info_cache=self.info_cache
3298 )
3299
3300 def get_enums(self, schema: Optional[str] = None) -> List[ReflectedEnum]:
3301 """Return a list of ENUM objects.

Callers 6

test_inspect_domainsMethod · 0.80
_domain_existsMethod · 0.80

Calls 2

_operation_contextMethod · 0.80
_load_domainsMethod · 0.80

Tested by 6

test_inspect_domainsMethod · 0.64
_domain_existsMethod · 0.64