MCPcopy Index your code
hub / github.com/Vanderhoof/PyDBML / check_attributes_for_sql

Method check_attributes_for_sql

pydbml/_classes/base.py:14–23  ·  view source on GitHub ↗

Check if all attributes, required for rendering SQL are set in the instance. If some attribute is missing, raise AttributeMissingError

(self)

Source from the content-addressed store, hash-verified

12 dont_compare_fields: Tuple[str, ...] = ()
13
14 def check_attributes_for_sql(self):
15 '''
16 Check if all attributes, required for rendering SQL are set in the
17 instance. If some attribute is missing, raise AttributeMissingError
18 '''
19 for attr in self.required_attributes:
20 if getattr(self, attr) is None:
21 raise AttributeMissingError(
22 f'Cannot render SQL. Missing required attribute "{attr}".'
23 )
24 @property
25 def sql(self) -> str:
26 if hasattr(self, 'database') and self.database is not None:

Callers 2

renderMethod · 0.80

Calls 1

Tested by 1