How do you get the value of the primary key of a record inserted by FireDAC into a SQLite database?

How do you get the value of the primary key of a record inserted by FireDAC into a SQLite database?
I have surprisingly little experience using Delphi's database side, so this might be a silly question. But: I have a SQLite database and am accessing it via FireDAC in Seattle. According to the SQLite docs, if the primary key is an integer not null, it's an alias for the table's internal rowid, and when you insert a record if you specify NULL as the value it is assigned a value automatically.

How, then, do you find out what that value was when it was inserted?

Apparently it's the SQLite connection's LastRowId, but I don't know where or how to find that in Delphi's DB layer.

I'm inserting via a query which contains SQL "insert into..." etc, with the primary key parameter explicitly set to a null variant. I tried editing the parameter types in the query editor to say it was an output or result parameter, but get an error "[FireDAC][Phys][SQLite]-303. Capability is not supported." (In fact the only parameter type that seems to be supported is ptInput.) I also examined the FDConnection to see if it had a last row or last anything-at-all, but there isn't.

Some or all of this might be the wrong way to do it, too - as I said, not that much experience in this area. Advice and corrections appreciated :)

Comments