MCPcopy Create free account
hub / github.com/Vanderhoof/PyDBML / IndexBlueprint

Class IndexBlueprint

pydbml/parser/blueprints.py:165–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163
164@dataclass
165class IndexBlueprint(Blueprint):
166 subject_names: List[Union[str, ExpressionBlueprint]]
167 name: Optional[str] = None
168 unique: bool = False
169 type: Optional[
170 Literal[
171 # https://www.postgresql.org/docs/current/indexes-types.html
172 "brin",
173 "btree",
174 "gin",
175 "gist",
176 "hash",
177 "spgist",
178 ]
179 ] = None
180 pk: bool = False
181 note: Optional[NoteBlueprint] = None
182 comment: Optional[str] = None
183
184 table = None
185
186 def build(self) -> 'Index':
187 return Index(
188 # TableBlueprint will process subjects
189 subjects=[],
190 name=self.name,
191 unique=self.unique,
192 type=self.type,
193 pk=self.pk,
194 note=self.note.build() if self.note else None,
195 comment=self.comment
196 )
197
198
199@dataclass

Callers 5

test_with_indexesMethod · 0.90
test_bad_indexMethod · 0.90
test_build_minimalMethod · 0.90
test_build_fullMethod · 0.90
parse_indexFunction · 0.90

Calls

no outgoing calls

Tested by 4

test_with_indexesMethod · 0.72
test_bad_indexMethod · 0.72
test_build_minimalMethod · 0.72
test_build_fullMethod · 0.72