Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#24 still persists on auto-increment tables #26

Open
GlorifiedPig opened this issue May 30, 2022 · 1 comment
Open

#24 still persists on auto-increment tables #26

GlorifiedPig opened this issue May 30, 2022 · 1 comment

Comments

@GlorifiedPig
Copy link

#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.

@ceifa
Copy link
Owner

ceifa commented Jun 26, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants