def column_exists(table, column): """ Check if a column exists in the given table. """ return bool(lib_database.fetch_object(\ lib_database.query("SHOW COLUMNS FROM {" + \ lib_database.escape_table(table) + "} LIKE '" + \ lib_database.escape_table(column) + "'")))
def table_exists(table): """ Check if a table exists. """ return bool(lib_database.fetch_object(\ lib_database.query("SHOW TABLES LIKE '{" + \ lib_database.escape_table(table) + "}'")))