F
F
ForSureN12019-11-06 11:42:40
Flask
ForSureN1, 2019-11-06 11:42:40

Why is the sqlite3 database table not opening?

Good afternoon.
I have an initial web application, and I needed to create a database via SQLAlchemy + sqlite3
When the web application is launched, it does not give any errors, a file is created (mydatabase.db), there are a couple of columns in the class by type: email, password.
in the terminal I enter sqlite3 mydatabase.db
After I enter Select * from mydatabase.db;
and gives the following error: "Error: no such table: Users"
But if I open the database directly, then all the columns are there.
I tried to change both the name of the class and the name of the database, nothing helped.
5dc2872a9e3fa330684917.png
5dc2873be82a1900378276.png
WXKJIDc1Hfg.jpg
X371AOTJPr8.jpg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pcdesign, 2019-11-06
@pcdesign

You have created the Users class.
And now there are two ways. Hands to create the users table in sql that not to eat well.
Or run something like:
and then all tables will be created automatically.
https://habr.com/en/post/251415/

A
Alexander, 2019-11-06
@Survtur

First, check which tables are in the database at all with the command
.tables

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question