MySQL Queries via Peewee are not bringing back data.

Skip to first unread message


Feb 18, 2021, 7:54:52 PM2/18/21
to peewee-orm
I switched from an SQLite database to a MySQL database. I've created and converted an `.sql` file to MySQL and I have confirmed that all of the data has moved on the server. The only problem is that now I am unable to get any results despite the entry existing on the server. I've done this on another project and it worked fine but im not sure what went wrong here. 

My code:
databaseData = [database.MRP_Blacklist_Data.DiscUsername, database.MRP_Blacklist_Data.DiscID, database.MRP_Blacklist_Data.Gamertag, database.MRP_Blacklist_Data.BannedFrom, database.MRP_Blacklist_Data.KnownAlts, database.MRP_Blacklist_Data.ReasonforBan, database.MRP_Blacklist_Data.DateofIncident, database.MRP_Blacklist_Data.TypeofBan, database.MRP_Blacklist_Data.DatetheBanEnds, database.MRP_Blacklist_Data.entryid]
ResultsGiven = False

for data in databaseData:
  query = (
  if query.exists():
      for p in query:
        ResultsGiven = True
  if ResultsGiven == False:
      print("No Results")


Feb 18, 2021, 8:00:18 PM2/18/21
to peewee-orm

I've just noticed that Peewee has created new tables with the same name but lowercase.
Is there a way to point it to the original uppercase ones?

Charles Leifer

Feb 19, 2021, 9:07:38 AM2/19/21
Specify the table name explicitly:

class MyModel(Model):
    class Meta:
        table_name = 'MyModel'

You received this message because you are subscribed to the Google Groups "peewee-orm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages