title: How to solve the duplicated key value error in sqlalchemy?
body: <p>In scripts I create database with some data and use there <strong>bulk_save_objects</strong>. After then i trying ro add new record to db without explicitly indicating id, i get error <strong>duplicated key value</strong>
  Some code from my scripts:</p>
  <pre><code>Base.metadata.create_all(engine)
  room = Room(id=1, name='room', size=0, floor=0)
  db.bulk_save_objects([room])
  </code></pre>
  <p>and more saving with more models.
  My api for add bew record to db, in payload id not specified:</p>
  <pre><code>room = Room(**payload.dict())
  db.add(room)
  db.commit()
  </code></pre>
  <p>Model:</p>
  <pre><code>class Room(Base):
      __tablename__ = 'rooms'
  
      id = Column(Integer, primary_key=True)
      name = Column(String)
      size = Column(Float)
      floor = Column(Integer)
  </code></pre>
  <p>How to solve this problem?</p>