[GH-ISSUE #39] No tables read from sqlite3 file #27

Closed
opened 2026-02-26 01:32:56 +03:00 by kerem · 2 comments
Owner

Originally created by @agordon on GitHub (Aug 2, 2016).
Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/39

Hello,

On some sqlite3 tables, it seems sandman2 is unable to discover the names of the tables, and presents empty list on the admin page (and returns 'not found' for all tables).

Example:

$ echo "create table foo(a integer); insert into foo values (1),(2),(3);" | sqlite3  bar.sqlite3
$ echo "select * from foo;" | sqlite3 bar.sqlite3 
1
2
3
$ sandman2ctl sqlite+pysqlite:///bar.sqlite3

Visiting "localhost:5000/admin" shows no tables at all.
No errors are displayed on the terminal, either.

Any ideas how to solve this?

The installed versions are:

$ pip freeze | grep -Ei 'sandman|sql|flask'
Flask==0.11.1
Flask-Admin==1.4.2
Flask-HTTPAuth==3.1.2
Flask-SQLAlchemy==2.1
SQLAlchemy==1.0.14
pysqlite==2.6.3
sandman2==0.0.7

Thanks!

Originally created by @agordon on GitHub (Aug 2, 2016). Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/39 Hello, On some sqlite3 tables, it seems sandman2 is unable to discover the names of the tables, and presents empty list on the admin page (and returns 'not found' for all tables). Example: ``` $ echo "create table foo(a integer); insert into foo values (1),(2),(3);" | sqlite3 bar.sqlite3 $ echo "select * from foo;" | sqlite3 bar.sqlite3 1 2 3 $ sandman2ctl sqlite+pysqlite:///bar.sqlite3 ``` Visiting "localhost:5000/admin" shows no tables at all. No errors are displayed on the terminal, either. Any ideas how to solve this? The installed versions are: ``` $ pip freeze | grep -Ei 'sandman|sql|flask' Flask==0.11.1 Flask-Admin==1.4.2 Flask-HTTPAuth==3.1.2 Flask-SQLAlchemy==2.1 SQLAlchemy==1.0.14 pysqlite==2.6.3 sandman2==0.0.7 ``` Thanks!
kerem closed this issue 2026-02-26 01:32:56 +03:00
Author
Owner

@jeffknupp commented on GitHub (Aug 2, 2016):

it's likely due to the table not having a primary key, which SQLAlchemy doesn't support (and REST APIs generally aren't compatible with either). I'll check why it's not raising an Exception

<!-- gh-comment-id:237031853 --> @jeffknupp commented on GitHub (Aug 2, 2016): it's likely due to the table not having a primary key, which SQLAlchemy doesn't support (and REST APIs generally aren't compatible with either). I'll check why it's not raising an `Exception`
Author
Owner

@agordon commented on GitHub (Aug 2, 2016):

Thanks for the quick response! Adding a primary key indeed solved the issue.

BTW, there's also no indication if one specifies a non-existing sqlite3 file. I know 'sqlite3' can autocreate the file if it doesn't exist, but without any indication (and showing no tables in either way) - it's a bit confusing to troubleshoot.

In any case, thanks for a fantastic program!

<!-- gh-comment-id:237047417 --> @agordon commented on GitHub (Aug 2, 2016): Thanks for the quick response! Adding a primary key indeed solved the issue. BTW, there's also no indication if one specifies a non-existing sqlite3 file. I know 'sqlite3' can autocreate the file if it doesn't exist, but without any indication (and showing no tables in either way) - it's a bit confusing to troubleshoot. In any case, thanks for a fantastic program!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/sandman2-jeffknupp#27
No description provided.