get_state_fields = async (table_id, viewname, { show_view }) => {
  const table = Table.findOne(table_id);
  const table_fields = table.fields;
  return table_fields
    .filter((f) => !f.primary_key)
    .map((f) => {
      const sf = new Field(f);
      sf.required = false;
      return sf;
    });
}
@param {number} table_id
@param {*} viewname
@param {object} opts
@param {*} opts.show_view
@returns {Promise<Field>}