[GH-ISSUE #56] sqlite db displays on {} on http://0.0.0.0:5000/ #38

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

Originally created by @MortalCatalyst on GitHub (Mar 6, 2017).
Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/56

Following the instructions on the main githiub page I attempt to connect to a small db that I have started creating. However I am receiving only when I open the localhost

{}

I am in the same directory and connect to the db race.db you can see here in this structure, I connect no errors just am not receiving the expected output.

sayth@linux-2sg8:~/xml/XML_race_dict> ll
total 104
-rw-r--r-- 1 sayth users 86434 Mar  6 13:33 mycsv.csv
-rw-r--r-- 1 sayth users     0 Mar  6 13:38 race
-rw-r--r-- 1 sayth users  8192 Mar  6 13:33 race.db
-rw-r--r-- 1 sayth users  4228 Mar  6 13:33 xml_race.py
sayth@linux-2sg8:~/xml/XML_race_dict> sandman2ctl sqlite+pysqlite:///race.db
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [06/Mar/2017 13:40:28] "GET /race HTTP/1.1" 404 -
127.0.0.1 - - [06/Mar/2017 13:40:33] "GET / HTTP/1.1" 200 -

Not sure what would help so to show db has valid data I pulled it console using sql2csv.

sayth@linux-2sg8:~/xml/XML_race_dict> sql2csv --db "sqlite:///race.db" --query "select * from race"
R_Number,R_KEY,R_NAME,R_AGE,R_DIST,R_CLASS,M_ID
1,227392,BENCHMARK 85 HCP,3U,2000,BM85,46295
2,227393,TAB HIGHWAY PLATE,3U,1600,CL3,46295
3,227394,SWEET EMBRACE STAKES,2,1200,~,46295
4,227395,SKYLINE STAKES,2,1200,~,46295
5,227396,LIVERPOOL CITY CUP,3U,1300,~,46295
6,227397,SURROUND STAKES,3,1400,~,46295
7,227398,CHIPPING NORTON STAKES,3U,1600,~,46295
8,227399,GUY WALTER STAKES,4U,1400,~,46295
9,227400,BENCHMARK 85 HCP,3U,1200,BM85,46295
sayth@linux-2sg8:~/xml/XML_race_dict> 
Originally created by @MortalCatalyst on GitHub (Mar 6, 2017). Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/56 Following the instructions on the main githiub page I attempt to connect to a small db that I have started creating. However I am receiving only when I open the localhost > {} I am in the same directory and connect to the db race.db you can see here in this structure, I connect no errors just am not receiving the expected output. ```bash sayth@linux-2sg8:~/xml/XML_race_dict> ll total 104 -rw-r--r-- 1 sayth users 86434 Mar 6 13:33 mycsv.csv -rw-r--r-- 1 sayth users 0 Mar 6 13:38 race -rw-r--r-- 1 sayth users 8192 Mar 6 13:33 race.db -rw-r--r-- 1 sayth users 4228 Mar 6 13:33 xml_race.py sayth@linux-2sg8:~/xml/XML_race_dict> sandman2ctl sqlite+pysqlite:///race.db * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) 127.0.0.1 - - [06/Mar/2017 13:40:28] "GET /race HTTP/1.1" 404 - 127.0.0.1 - - [06/Mar/2017 13:40:33] "GET / HTTP/1.1" 200 - ``` Not sure what would help so to show db has valid data I pulled it console using sql2csv. ```bash sayth@linux-2sg8:~/xml/XML_race_dict> sql2csv --db "sqlite:///race.db" --query "select * from race" R_Number,R_KEY,R_NAME,R_AGE,R_DIST,R_CLASS,M_ID 1,227392,BENCHMARK 85 HCP,3U,2000,BM85,46295 2,227393,TAB HIGHWAY PLATE,3U,1600,CL3,46295 3,227394,SWEET EMBRACE STAKES,2,1200,~,46295 4,227395,SKYLINE STAKES,2,1200,~,46295 5,227396,LIVERPOOL CITY CUP,3U,1300,~,46295 6,227397,SURROUND STAKES,3,1400,~,46295 7,227398,CHIPPING NORTON STAKES,3U,1600,~,46295 8,227399,GUY WALTER STAKES,4U,1400,~,46295 9,227400,BENCHMARK 85 HCP,3U,1200,BM85,46295 sayth@linux-2sg8:~/xml/XML_race_dict> ```
kerem closed this issue 2026-02-26 01:32:58 +03:00
Author
Owner

@jeffknupp commented on GitHub (Mar 6, 2017):

That's quite odd. Is race.db something you would be comfortable attaching so I can investigate more?

<!-- gh-comment-id:284379010 --> @jeffknupp commented on GitHub (Mar 6, 2017): That's quite odd. Is `race.db` something you would be comfortable attaching so I can investigate more?
Author
Owner

@MortalCatalyst commented on GitHub (Mar 7, 2017):

race.db.zip

<!-- gh-comment-id:284698852 --> @MortalCatalyst commented on GitHub (Mar 7, 2017): [race.db.zip](https://github.com/jeffknupp/sandman2/files/824257/race.db.zip)
Author
Owner

@jeffknupp commented on GitHub (Mar 7, 2017):

Ah. The problem here is that there are no primary keys defined. Without a primary key, it's not really possible to create a REST API as there's no way to uniquely refer to an individual resource.

<!-- gh-comment-id:284772406 --> @jeffknupp commented on GitHub (Mar 7, 2017): Ah. The problem here is that there are no primary keys defined. Without a primary key, it's not really possible to create a REST API as there's no way to uniquely refer to an individual resource.
Author
Owner

@MortalCatalyst commented on GitHub (Mar 11, 2017):

Ah okay easy fixed on my end. Thanks.

<!-- gh-comment-id:285907441 --> @MortalCatalyst commented on GitHub (Mar 11, 2017): Ah okay easy fixed on my end. Thanks.
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#38
No description provided.