code: def _set_sequence(cls, val):
          
          if db.engine.dialect.name == 'postgresql':  # pragma: no cover
              db.session.execute(
                  "SELECT setval(pg_get_serial_sequence("
                  "'{0}', 'recid'), :newval)".format(
                      cls.__tablename__), dict(newval=val))
docs: Internal function to reset sequence to specific value.
  
          Note: this function is for PostgreSQL compatibility.
  
          :param val: The value to be set.