From 522f46ef03efd028cb4344a30b0bfb80d00f9643 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sat, 21 Nov 2020 20:15:17 +0100 Subject: [PATCH] datasette==0.51.1 --- datasette_connectors/cursor.py | 2 +- setup.py | 2 +- tests/dummy.py | 21 +++++++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/datasette_connectors/cursor.py b/datasette_connectors/cursor.py index bf3a1b1..02585a3 100644 --- a/datasette_connectors/cursor.py +++ b/datasette_connectors/cursor.py @@ -54,7 +54,7 @@ class Cursor: match = re.search(r'select count\(\*\) from (.*)', sql) results = [{'count(*)': self.connector.table_count(match.group(1))}] elif sql.startswith("PRAGMA table_info("): - match = re.search(r'PRAGMA table_info\(\[?\"?([\d\w\/]*)\"?\]?\)', sql) + match = re.search(r'PRAGMA table_info\(\[?\"?([\d\w\/%]*)\"?\]?\)', sql) results = self.connector.table_info(match.group(1)) elif sql.startswith("select name from sqlite_master where rootpage = 0 and ( sql like \'%VIRTUAL TABLE%USING FTS%content="): match = re.search(r'select name from sqlite_master where rootpage = 0 and \( sql like \'%VIRTUAL TABLE%USING FTS%content="(.*)"', sql) diff --git a/setup.py b/setup.py index 8d52909..32bee3f 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( license='Apache License, Version 2.0', packages=['datasette_connectors'], install_requires=[ - 'datasette==0.48', + 'datasette==0.51.1', ], tests_require=[ 'pytest', diff --git a/tests/dummy.py b/tests/dummy.py index 04c6686..873894f 100644 --- a/tests/dummy.py +++ b/tests/dummy.py @@ -22,19 +22,28 @@ class DummyConnector(dc.Connector): def table_info(self, table_name): return [ { - 'idx': 0, + 'cid': 0, 'name': 'c1', - 'primary_key': False, + 'type': 'integer', + 'notnull': False, + 'default_value': None, + 'is_pk': False, }, { - 'idx': 0, + 'cid': 1, 'name': 'c2', - 'primary_key': False, + 'type': 'integer', + 'notnull': False, + 'default_value': None, + 'is_pk': False, }, { - 'idx': 0, + 'cid': 2, 'name': 'c3', - 'primary_key': False, + 'type': 'integer', + 'notnull': False, + 'default_value': None, + 'is_pk': False, }, ] -- 2.39.5