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

Function parse_column_settings

pydbml/definitions/column.py:67–90  ·  view source on GitHub ↗

[ NOT NULL, increment, default: `now()`]

(s, loc, tok)

Source from the content-addressed store, hash-verified

65
66
67def parse_column_settings(s, loc, tok):
68 '''
69 [ NOT NULL, increment, default: `now()`]
70 '''
71 result = {}
72 if tok.get('notnull'):
73 result['not_null'] = True
74 if 'pk' in tok:
75 result['pk'] = True
76 if 'unique' in tok:
77 result['unique'] = True
78 if 'increment' in tok:
79 result['autoinc'] = True
80 if 'note' in tok:
81 result['note'] = tok['note']
82 if 'default' in tok:
83 result['default'] = tok['default'][0]
84 if 'ref' in tok:
85 result['ref_blueprints'] = list(tok['ref'])
86 if 'comment' in tok:
87 result['comment'] = tok['comment'][0]
88 if 'property' in tok:
89 result['properties'] = {k: v for k, v in tok['property']}
90 return result
91
92
93column_settings.set_parse_action(parse_column_settings)

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected