I am using Python/Mysql and Peewee as ORM. I am stuck in a situation. Suppose i want to insert a row using peewee but check if that row exist skip else insert. Is there any procedure to do so in python using peewee.
Not sure what you've tried already, but I'd suggest the Model.get_or_create()
or Model.create_or_get()
methods from peewee to do what you're looking for: Peewee Get or Create
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With