v1a0 / sqllex

The most pythonic ORM (for SQLite and PostgreSQL). Seriously, try it out!
https://v1a0.github.io/sqllex
GNU General Public License v3.0
91 stars 8 forks source link

BUG | PRIMARY ID #27

Closed kingabzpro closed 3 years ago

kingabzpro commented 3 years ago

============== TEMPLATE ==============

✅ DESCRIBE THE BUG

When you try to add a duplicate PRIMARY ID, it doesn't give an error. It just adds some kind of values to populate the table and make the rest of the table NONE. I am actually working on another article so, I am sorry to point out bugs so rapidly.

Example log:

[['Pakistan',
  8263763,
  38.9,
  '1.1%',
  'CanSino, Oxford/AstraZeneca, Sinopharm/Beijing, Sinovac, Sputnik V',
  '13/06/2021 08:59:22'],
 [b'\xb0\x8d\x9cy\x84\x7f\x00\x00\x10\xf7\xc7y\x84\x7f\x00\x00\xd0\xdc\x90y\x84\x7f\x00\x000\xa0\x9cy\x84\x7f\x00\x000\xc1\x9by\x84\x7f\x00\x00p\x01\x94y\x84\x7f\x00\x00',
  None,
  None,
  None,
  None,
  None]]
...
sqlite3.OperationalError: no such table: PRAGMA_TABLE_INFO

✅ CODE

Show the code (or just a few lines) raise this bug. Show what methods you call and what the input data is. MAKE SURE IT DOESN'T CONTAINS ANY PRIVATE DATA!

For example:

vaccine_db.insert('Pakistan', data[data["Country"] == "Pakistan"].values);

SCREENSHOTS

image

⚠️ CONFIGURATIONS

OTHER

kingabzpro commented 3 years ago

it was my bad, the issues were resolved with insert many and it was not about the Primary key, it was about to insert and insert many.