title: How to increment quantity column if record exists, else insert record?
body: <p>I've got the below sqlite database:</p>
  
  <pre><code>CREATE TABLE `test` (
      `idx`   INTEGER PRIMARY KEY AUTOINCREMENT,
      `qty`   INTEGER,
      `brand` TEXT,
      `type`  TEXT
  );
  
  insert into test (qty, brand, type) values (1, "Merc", "petrol");
  insert into test (qty, brand, type) values (1, "Toyota", "diesel");
  </code></pre>
  
  <p>I want to insert another record but if it exists then I want to increase the qty field, so:</p>
  
  <pre><code>insert into test (qty, brand, type) values (1, "Merc", "diesel");
  </code></pre>
  
  <p>so would just increase the qty field by one, and </p>
  
  <pre><code>insert into test (qty, brand, type) values (1, "Merc", "petrol");
  </code></pre>
  
  <p>would insert a new record.</p>