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

Method add

pydbml/database.py:57–71  ·  view source on GitHub ↗
(self, obj: Any)

Source from the content-addressed store, hash-verified

55 obj.database = None
56
57 def add(self, obj: Any) -> Any:
58 if isinstance(obj, Table):
59 return self.add_table(obj)
60 elif isinstance(obj, Reference):
61 return self.add_reference(obj)
62 elif isinstance(obj, Enum):
63 return self.add_enum(obj)
64 elif isinstance(obj, TableGroup):
65 return self.add_table_group(obj)
66 elif isinstance(obj, Project):
67 return self.add_project(obj)
68 elif isinstance(obj, StickyNote):
69 return self.add_sticky_note(obj)
70 else:
71 raise DatabaseValidationError(f'Unsupported type {type(obj)}.')
72
73 def add_table(self, obj: Table) -> Table:
74 if obj in self.tables:

Callers 15

test_addMethod · 0.95
test_add_badMethod · 0.95
test_deleteMethod · 0.95
create_databaseMethod · 0.95
test_get_refsMethod · 0.95
test_database_setMethod · 0.95
test_databaseMethod · 0.95
test_get_refsMethod · 0.95
test_enum_typeMethod · 0.95
test_enum_type_schemaMethod · 0.95
simple_column_with_tableFunction · 0.80

Calls 7

add_tableMethod · 0.95
add_referenceMethod · 0.95
add_enumMethod · 0.95
add_table_groupMethod · 0.95
add_projectMethod · 0.95
add_sticky_noteMethod · 0.95

Tested by 15

test_addMethod · 0.76
test_add_badMethod · 0.76
test_deleteMethod · 0.76
create_databaseMethod · 0.76
test_get_refsMethod · 0.76
test_database_setMethod · 0.76
test_databaseMethod · 0.76
test_get_refsMethod · 0.76
test_enum_typeMethod · 0.76
test_enum_type_schemaMethod · 0.76
simple_column_with_tableFunction · 0.64