sqlier
sqlier copied to clipboard
#24 still persists on auto-increment tables
#24 still persists on auto-increment tables
I know I created another issue and disregarded it - my apologies for that, I've found a workaround not realizing the issue itself is still persisting.
If I were to create an auto-increment table and save it twice, it would create two entries, even if I wait for the previous instance to save asynchronously.
Could not reproduce in the latest version:
local item = reportsModel({
Time = os.time(),
Staff = "765611980898989898",
Reporter = "765611980898989898"
})
item:save()
print(item1.ID)
item:save()
print(item1.ID)
Console:
[SQLITE] INSERT INTO `reports`(`Time`, `Reporter`, `Staff`) VALUES('1656255391', '765611980898989898', '765611980898989898')
1
[SQLITE] SELECT * FROM `reports` WHERE `ID` = '31' LIMIT 1
[SQLITE] UPDATE `reports` SET `Reporter` = '765611980898989898', `Time` = '1656255391', `Staff` = '765611980898989898' WHERE `ID` = '31'
1