if the Python+SQLite3 record does not exist, insert it and ignore it if it exists.
if the Python+SQLite3 record does not exist, insert it and ignore it if it exists.
SQL
Topic.insert(topic_id=topic_id, name=name, level=parent.level+1, parent_id=parent_id).on_conflict_ignore().execute()
the key point is on_conflict_ignore ()
Previous: Ask the rewrite or other mapping methods of segment's img src?
Next: Xiaobai asked, what's the difference between HashMap and HashedMap?