title: Is possible to log sqlite changes in a trigger without list all the fields, defining a custom function?
body: <p>I need to log all the changes made to most tables in my sqlite db.</p>
  <p>Using triggers I need to list all the fields for it, and duplicate it for all crud events (insert, update, delete).</p>
  <p>I understand is not possible to use <code>NEW</code>/<code>OLD</code> as values so I wonder if <a href="https://www.sqlite.org/appfunc.html" rel="nofollow noreferrer">registering a custom function</a> that I could do in Rust, I can add this functionality so my triggers get simplified to:</p>
  <pre class="lang-sql prettyprint-override"><code>CREATE TRIGGER visit_log
    AFTER INSERT ON visit
  BEGIN
      INSERT INTO log (table, pk, data, date) VALUES(.., data = to_my_json(???));
  END;
  </code></pre>