MCPcopy Index your code
hub / github.com/clips/pattern / drop

Method drop

pattern/db/__init__.py:620–634  ·  view source on GitHub ↗

Removes the table with the given name.

(self, table)

Source from the content-addressed store, hash-verified

618 return self.tables[table]
619
620 def drop(self, table):
621 """ Removes the table with the given name.
622 """
623 if isinstance(table, Table) and table.db == self:
624 table = table.name
625 if table in self.tables:
626 self.tables[table].database = None
627 self.tables.pop(table)
628 self.execute("drop table `%s`;" % table, commit=True)
629 # The SQLite version in Python 2.5 has a drop/recreate table bug.
630 # Reconnect. This means that any reference to Database.connection
631 # is no longer valid after Database.drop().
632 if self.type == SQLITE and sys.version < "2.6":
633 self.disconnect()
634 self.connect()
635
636 remove = drop
637

Callers 6

setupMethod · 0.80
tearDownMethod · 0.80
test_create_tableMethod · 0.80
tearDownMethod · 0.80
tearDownMethod · 0.80
tearDownMethod · 0.80

Calls 4

executeMethod · 0.95
disconnectMethod · 0.95
connectMethod · 0.95
popMethod · 0.45

Tested by 5

tearDownMethod · 0.64
test_create_tableMethod · 0.64
tearDownMethod · 0.64
tearDownMethod · 0.64
tearDownMethod · 0.64