From 208adc93a6ca09524e8326bb715fb9b0f51d03bd Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 14 May 2018 17:41:47 +0200 Subject: [PATCH] Stop using without rowid altogether While something nice to have if supported, it just causes problems for people trying to use the same session accross systems having different sqlite versions. See https://t.me/TelethonChat/36771. --- telethon/sessions/sqlite.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/telethon/sessions/sqlite.py b/telethon/sessions/sqlite.py index c18b5cd3..0825543a 100644 --- a/telethon/sessions/sqlite.py +++ b/telethon/sessions/sqlite.py @@ -179,16 +179,8 @@ class SQLiteSession(MemorySession): @staticmethod def _create_table(c, *definitions): - """ - Creates a table given its definition 'name (columns). - If the sqlite version is >= 3.8.2, it will use "without rowid". - See http://www.sqlite.org/releaselog/3_8_2.html. - """ - required = (3, 8, 2) - sqlite_v = tuple(int(x) for x in sqlite3.sqlite_version.split('.')) - extra = ' without rowid' if sqlite_v >= required else '' for definition in definitions: - c.execute('create table {}{}'.format(definition, extra)) + c.execute('create table {}'.format(definition)) # Data from sessions should be kept as properties # not to fetch the database every time we need it