MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / createTable

Method createTable

src/Db/DbCursor.py:142–150  ·  view source on GitHub ↗
(self, table, cols)

Source from the content-addressed store, hash-verified

140 # Create new table
141 # Return: True on success
142 def createTable(self, table, cols):
143 # TODO: Check current structure
144 self.execute("DROP TABLE IF EXISTS %s" % table)
145 col_definitions = []
146 for col_name, col_type in cols:
147 col_definitions.append("%s %s" % (col_name, col_type))
148
149 self.execute("CREATE TABLE %s (%s)" % (table, ",".join(col_definitions)))
150 return True
151
152 # Create indexes on table
153 # Return: True on success

Callers 1

needTableMethod · 0.95

Calls 1

executeMethod · 0.95

Tested by

no test coverage detected