With auto_increment turned on when creating a table, one is able to add records with an auto-generated key, perfect!
Q1: How do I get that record by reading the key when the value does not include it?
Q2: How do I run an SQL select that will include the key as part of the returned objects?
BANanoSQL has a LastInserted() method. What does that return (right after your INSERT)?
What does SELECT * FROM return? It could give you a clue where the key is stored in AlaSQL.
I personally use UUIDs as key (not auto incremented of course). This allows me to be prepared if I want to sync the browser records to my server DB.
CREATE TABLE IF NOT EXISTS [users] ([id] INT PRIMARY KEY AUTOINCREMENT, [age] INT, [name] TEXT)
The insert command is like...
B4X:
INSERT INTO [users] ([name], [age]) VALUES (?, ?) and the args are for example, ["Faulkner", 35]
The inserts will add records like... of course these does not have the auto-increment id value. This assumption was based on how other dbs work.
Update:
As BANanoSQL is a wrap of AlaSQL, I bumped into some function call on the net to ensure that each record gets the auto-increment id. A function named autoval.
I looked further into this and it seems upto now, AlaSql has not yet fixed/implemented this for INDEXEDDB, which BANanoSQL uses.
AlaSQL is a very complex library but I will look into it if I can fix/implement it myself.