SQLite Forum

Non primary key alias to rowid
Login
I will admit that I am not familiar with sessions, but if sessions can't make the changesets based on the text field unique key then you solution may be to make the text field the primary key and live with the slight efficiency hit. You could perhaps minimize that and make the table a WITHOUT ROWID table, so the text key IS the real primary key, and thus omit the second lookup. 

You would also probably want to make that text field be the foreign key, as if it can't deal with the same text key mapping to different integer primary keys, are you sure it can handle matching by a differing secondary unique key from the two sources for the same primary key?

It also might be possible to pre-process looking at the text key and renumbering (with cascade update) if you find different ROWID  for the same text value.