You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The UUIDPrimaryKeyMixin ist not working properly with SQLite.
When creating a Model, the UUID is generated and saved correctly in the database, but the models id is set to the rowid instead of the actual uuid.
To Reproduce
Steps to reproduce the behavior:
Setup project using SQLite database
Create Model with UUIDPrimaryKeyMixin
Save new record by calling create() function, without providing a value for the id field: project = Project.create({'label': name})
Access the id field: new_id = project.id
It will be some integer value
Expected behavior
The id field of the model should be set to the UUID value that was saved to the database.
What database are you using?
Type: SQLite
Version: 3.34.0
Masonite ORM: 1.0.46
Additional context
I traced the problem down to the SQLitePostProcessor.
It returns the lastrowid in process_insert_get_id():
Describe the bug
The UUIDPrimaryKeyMixin ist not working properly with SQLite.
When creating a Model, the UUID is generated and saved correctly in the database, but the models id is set to the rowid instead of the actual uuid.
To Reproduce
Steps to reproduce the behavior:
project = Project.create({'label': name})
new_id = project.id
Expected behavior
The id field of the model should be set to the UUID value that was saved to the database.
What database are you using?
Additional context
I traced the problem down to the SQLitePostProcessor.
It returns the lastrowid in process_insert_get_id():
The text was updated successfully, but these errors were encountered: