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

Function create_components

pydbml/renderer/sql/default/index.py:23–43  ·  view source on GitHub ↗
(model: Index, keys: str)

Source from the content-addressed store, hash-verified

21
22
23def create_components(model: Index, keys: str) -> str:
24 components = []
25 if model.comment:
26 components.append(comment_to_sql(model.comment))
27
28 components.append('CREATE ')
29
30 if model.unique:
31 components.append('UNIQUE ')
32
33 components.append('INDEX ')
34
35 if model.name:
36 components.append(f'"{model.name}" ')
37 if model.table:
38 components.append(f'ON "{model.table.name}" ')
39
40 if model.type:
41 components.append(f'USING {model.type.upper()} ')
42 components.append(f'({keys})')
43 return ''.join(components) + ';'
44
45
46@DefaultSQLRenderer.renderer_for(Index)

Callers 1

render_indexFunction · 0.70

Calls 1

comment_to_sqlFunction · 0.90

Tested by

no test coverage detected