My table:
class api(Base):
__tablename__ = "api"
id = Column(Integer, primary_key=True)
date = Column(DateTime, nullable=False)
gender = Column(String)
age = Column(String)
value = Column(Integer)
Base.metadata.drop_all(engine)
Base.metadata.create_all(engine)
When I send an api query with dates which overlaps with previous queries duplicate rows are created. How can I avoid that? I can delete duplicates but is there a more efficient way to avoid inserting them in the first place?