Skip to content

Commit afd677b

Browse files
committed
Improve table name extraction
1 parent 716ff00 commit afd677b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

datasette_connectors/cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def execute(
5454
match = re.search(r'select count\(\*\) from (.*)', sql)
5555
results = [{'count(*)': self.connector.table_count(match.group(1))}]
5656
elif sql.startswith("PRAGMA table_info("):
57-
match = re.search(r'PRAGMA table_info\((.*)\)', sql)
57+
match = re.search(r'PRAGMA table_info\(\[?\"?([\d\w\/]*)\"?\]?\)', sql)
5858
results = self.connector.table_info(match.group(1))
5959
elif sql.startswith("select name from sqlite_master where rootpage = 0 and ( sql like \'%VIRTUAL TABLE%USING FTS%content="):
6060
match = re.search(r'select name from sqlite_master where rootpage = 0 and \( sql like \'%VIRTUAL TABLE%USING FTS%content="(.*)"', sql)

0 commit comments

Comments
 (0)