I have created a sqlite database in sqlalchemy and I have inserted data into it. Now I would like to get the total number of rows that was inserted.
I am trying to follow the example of this stack overflow question
Get the number of rows in table using SQLAlchemy
However, this involved creating a 'Congress' class and geoalchemy
library, which I am not sure where they came from, or how they are related.
This is my code
import sqlalchemy
from sqlalchemy import create_engine
engine = sqlalchemy.create_engine("sqlite:///dbfile/CSSummaries.db")
pandasDataframeExample.to_sql('CS_table', engine, index = False, if_exists= 'append')
Now I would like to see how many rows have been added, and perhaps see a few samples from the database to make sure everything saved ok.
I would like to see that it has x many rows.
Bonus:
A easy to way to sample some of the data in the database.