I've got a function which updates an existing record or inserts a new one, but it looks very clunky to me.
using (SQLiteConnection db = new SQLiteConnection(AppSettings.DbPath))
{
    db.RunInTransaction(() =>
    {
        var y = db.Table<MyClass>().Where(x => x.GUID == this.GUID && x.VersionNumber == this.VersionNumber).FirstOrDefault();
        bool insert = false;
        if (y == null)
        {
            y = new MyClass();
            y.GUID = this.GUID;
            insert = true;
        }
        y.VersionNumber = this.VersionNumber;
        y.WordCount = this.WordCount;
        y.Updated = DateTime.Now;
        y.Checksum = this.Checksum;
        y.Deleted = this.Deleted;
        y.Source = this.Source;
        if (insert)
        {
            db.Insert(y);
        }
        else
        {
            db.Update(y);
        }
    });
}
The only alternative I can see is a bigger if else, which looks neater but has some argument repitition
using (SQLiteConnection db = new SQLiteConnection(AppSettings.DbPath))
{
    db.RunInTransaction(() =>
    {
        var y = db.Table<PoeFileVersion>().Where(x => x.GUID == this.GUID && x.VersionNumber == this.VersionNumber).FirstOrDefault();
        if (y == null)
        {
            y = new PoeFileVersion();
            y.GUID = this.GUID;
            y.VersionNumber = this.VersionNumber;
            y.WordCount = this.WordCount;
            y.Updated = DateTime.Now;
            y.Checksum = this.Checksum;
            y.Deleted = this.Deleted;
            y.Source = this.Source;
            db.Insert(y);
        }
        else
        {               
            y.VersionNumber = this.VersionNumber;
            y.WordCount = this.WordCount;
            y.Updated = DateTime.Now;
            y.Checksum = this.Checksum;
            y.Deleted = this.Deleted;
            y.Source = this.Source;
            db.Update(y);
        }
    });
}
This is not unique to SQLite of course - I've come up against the same ugly code in Linq-to-SQL. Is there a better pattern?
CopyThisToY()\$\endgroup\$REPLACEis not an option? That way you could just skip the query/branch. \$\endgroup\$