Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sqlite3.OperationalError: no such table: sqlite_schema

Tags:

python

sqlite

I am facing a weird issue. In TablePlus when I run the following command it returns table but same query does not work in Python.

SELECT 
    name
FROM 
    sqlite_schema
WHERE 
    type ='table' 
    AND 
    name NOT LIKE 'lookup%';

Python code is given below:

def get_connection():
    path = 'data.sqlite3'
    connection = sqlite3.connect(path)
    return connection

sql_select = "SELECT name FROM sqlite_schema WHERE type ='table' AND name NOT LIKE 'lookup%';"
cursor = connection.execute(sql_select)

Error:

cursor = connection.execute(sql_select)
sqlite3.OperationalError: no such table: sqlite_schema

I am using SQLite 3.36

like image 836
Volatil3 Avatar asked Mar 15 '26 20:03

Volatil3


1 Answers

Change sqlite_schema for sqlite_master in PHP CPANEL VERSION 92, SUCCESS

like image 74
sergioriverafl Avatar answered Mar 18 '26 10:03

sergioriverafl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!