embolalia/willie — pull request #383 by ProgressiveThinkin (2013-12-07 05:30:48+00:00)
Title: [DB] SQLite and Tuple Column related errors

Trying to create a table by specifying a list of tuple data resulted in errors and failure to load modules.

Ex. bot.db.add_table('channel_moderation',[('nick','TEXT'),('offense_date','INTEGER DEFAULT 0')],'nick')

This patch properly detects such commands and parses them correctly.

NOTE: I tested this by running the following commands and all tables were created correctly
bot.db.add_table('channel_moderation',[('nick','TEXT'),('offense_date','INTEGER DEFAULT 0')],'nick')
bot.db.add_table('channel_moderation2',['nick'],'nick')
bot.db.add_table('channel_moderation3',[('nick','TEXT')],'nick')
bot.db.add_table('channel_moderation4',['nick','offense_date'],'nick')

Then verified existence via sqlite3 .schema:
CREATE TABLE channel_moderation (nick TEXT NOT NULL, offense_date INTEGER DEFAULT 0, PRIMARY KEY (nick));
CREATE TABLE channel_moderation2 (nick string NOT NULL, PRIMARY KEY (nick));
CREATE TABLE channel_moderation3 (nick TEXT NOT NULL, PRIMARY KEY (nick));
CREATE TABLE channel_moderation4 (nick string NOT NULL, offense_date string, PRIMARY KEY (nick));

This should address issue #334