code: func (t *VLANsTable) add(c context.Context) error {
  	// Avoid using the database connection to prepare unnecessary statements.
  	if len(t.additions) == 0 {
  		return nil
  	}
  
  	db := database.Get(c)
  	stmt, err := db.PrepareContext(c, `
  		INSERT INTO vlans (id, alias, state, cidr_block)
  		VALUES (?, ?, ?, ?)
  	`)
  	if err != nil {
  		return errors.Annotate(err, "failed to prepare statement").Err()
  	}
  	defer stmt.Close()
  
  	// Add each VLAN to the database, and update the slice of VLANs with each addition.
  	for len(t.additions) > 0 {
  		vlan := t.additions[0]
  		_, err := stmt.ExecContext(c, vlan.Id, vlan.Alias, vlan.State, vlan.CidrBlock)
  		if err != nil {
  			return errors.Annotate(err, "failed to add VLAN %d", vlan.Id).Err()
  		}
  		t.current = append(t.current, vlan)
  		t.additions = t.additions[1:]
  		logging.Infof(c, "Added VLAN %d", vlan.Id)
  	}
  	return nil
  }
docs: // add adds all VLANs pending addition to the database, clearing pending additions.
  // No-op unless computeChanges was called first. Idempotent until computeChanges is called again.