sqlmesh.core.engine_adapter.shared
1from __future__ import annotations 2 3import typing as t 4from enum import Enum 5 6from pydantic import Field 7 8from sqlmesh.utils.pydantic import PydanticModel 9 10 11class TransactionType(str, Enum): 12 DDL = "DDL" 13 DML = "DML" 14 15 @property 16 def is_ddl(self) -> bool: 17 return self == TransactionType.DDL 18 19 @property 20 def is_dml(self) -> bool: 21 return self == TransactionType.DML 22 23 24class DataObjectType(str, Enum): 25 UNKNOWN = "unknown" 26 TABLE = "table" 27 VIEW = "view" 28 29 @property 30 def is_unknown(self) -> bool: 31 return self == DataObjectType.UNKNOWN 32 33 @property 34 def is_table(self) -> bool: 35 return self == DataObjectType.TABLE 36 37 @property 38 def is_view(self) -> bool: 39 return self == DataObjectType.VIEW 40 41 @classmethod 42 def from_str(cls, s: str) -> DataObjectType: 43 s = s.lower() 44 if s == "table": 45 return DataObjectType.TABLE 46 if s == "view": 47 return DataObjectType.VIEW 48 return DataObjectType.UNKNOWN 49 50 51class DataObject(PydanticModel): 52 catalog: t.Optional[str] = None 53 schema_name: str = Field(alias="schema") 54 name: str 55 type: DataObjectType
class
TransactionType(builtins.str, enum.Enum):
12class TransactionType(str, Enum): 13 DDL = "DDL" 14 DML = "DML" 15 16 @property 17 def is_ddl(self) -> bool: 18 return self == TransactionType.DDL 19 20 @property 21 def is_dml(self) -> bool: 22 return self == TransactionType.DML
An enumeration.
DDL = <TransactionType.DDL: 'DDL'>
DML = <TransactionType.DML: 'DML'>
Inherited Members
- enum.Enum
- name
- value
- builtins.str
- encode
- replace
- split
- rsplit
- join
- capitalize
- casefold
- title
- center
- count
- expandtabs
- find
- partition
- index
- ljust
- lower
- lstrip
- rfind
- rindex
- rjust
- rstrip
- rpartition
- splitlines
- strip
- swapcase
- translate
- upper
- startswith
- endswith
- removeprefix
- removesuffix
- isascii
- islower
- isupper
- istitle
- isspace
- isdecimal
- isdigit
- isnumeric
- isalpha
- isalnum
- isidentifier
- isprintable
- zfill
- format
- format_map
- maketrans
class
DataObjectType(builtins.str, enum.Enum):
25class DataObjectType(str, Enum): 26 UNKNOWN = "unknown" 27 TABLE = "table" 28 VIEW = "view" 29 30 @property 31 def is_unknown(self) -> bool: 32 return self == DataObjectType.UNKNOWN 33 34 @property 35 def is_table(self) -> bool: 36 return self == DataObjectType.TABLE 37 38 @property 39 def is_view(self) -> bool: 40 return self == DataObjectType.VIEW 41 42 @classmethod 43 def from_str(cls, s: str) -> DataObjectType: 44 s = s.lower() 45 if s == "table": 46 return DataObjectType.TABLE 47 if s == "view": 48 return DataObjectType.VIEW 49 return DataObjectType.UNKNOWN
An enumeration.
UNKNOWN = <DataObjectType.UNKNOWN: 'unknown'>
TABLE = <DataObjectType.TABLE: 'table'>
VIEW = <DataObjectType.VIEW: 'view'>
Inherited Members
- enum.Enum
- name
- value
- builtins.str
- encode
- replace
- split
- rsplit
- join
- capitalize
- casefold
- title
- center
- count
- expandtabs
- find
- partition
- index
- ljust
- lower
- lstrip
- rfind
- rindex
- rjust
- rstrip
- rpartition
- splitlines
- strip
- swapcase
- translate
- upper
- startswith
- endswith
- removeprefix
- removesuffix
- isascii
- islower
- isupper
- istitle
- isspace
- isdecimal
- isdigit
- isnumeric
- isalpha
- isalnum
- isidentifier
- isprintable
- zfill
- format
- format_map
- maketrans
52class DataObject(PydanticModel): 53 catalog: t.Optional[str] = None 54 schema_name: str = Field(alias="schema") 55 name: str 56 type: DataObjectType
Inherited Members
- pydantic.main.BaseModel
- BaseModel
- parse_obj
- parse_raw
- parse_file
- from_orm
- construct
- copy
- schema
- schema_json
- validate
- update_forward_refs