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

Method add_enum

pydbml/database.py:105–114  ·  view source on GitHub ↗
(self, obj: Enum)

Source from the content-addressed store, hash-verified

103 return obj
104
105 def add_enum(self, obj: Enum) -> Enum:
106 if obj in self.enums:
107 raise DatabaseValidationError(f'{obj} is already in the database.')
108 for enum in self.enums:
109 if enum.name == obj.name and enum.schema == obj.schema:
110 raise DatabaseValidationError(f'Enum {obj.schema}.{obj.name} is already in the database.')
111
112 self._set_database(obj)
113 self.enums.append(obj)
114 return obj
115
116 def add_sticky_note(self, obj: StickyNote) -> StickyNote:
117 self._set_database(obj)

Callers 4

test_add_enumMethod · 0.95
test_add_enum_badMethod · 0.95
test_delete_enumMethod · 0.95
addMethod · 0.95

Calls 2

_set_databaseMethod · 0.95

Tested by 3

test_add_enumMethod · 0.76
test_add_enum_badMethod · 0.76
test_delete_enumMethod · 0.76