Releases: nezuo/lapis
Releases · nezuo/lapis
0.3.3
- Files now use the
.luau
extension instead of.lua
. (#61) - Switched wally realm to
shared
. This means Lapis can be used as a shared or server dependency. (#62) beforeClose
andbeforeSave
now throw an error if they yield. For more information, see the PR. (#64)- Added
Collection:remove
to remove the data from a document. (#65) - Session locks will now be removed from documents if
Document:close
fails for the following reasons: (#66)beforeSave
/beforeClose
threw an error.validate
threw an error.validate
didn't returntrue
.
DataStoreKeyInfo:GetMetadata()
is now preserved. Before, it would be erased anytime aDocument
was saved or closed. (#67)
0.3.2
0.3.1
- Added
Document:keyInfo()
. It returns the last updatedDataStoreKeyInfo
returned from loading, saving, or closing the document. (#50) - Migrations can now update the data mutably. Note: The value still needs to be returned from the migration function. (#51)
- Gracefully handle
validate
throwing an error inCollection:load
. Before it would keep retrying the load and spam the console with confusing errors. (#52) - Allow
defaultData
to be a function. The return value will be validated when a new document is created. (#53) - Migrations can now be marked as
backwardsCompatible
. This allows documents to be loaded on servers with an older version as long as they are compatible.
For more information, see the docs. (#54) - The
validate
option for collections is now optional. (#56) - Add
freezeData
option to collections to allow mutable updates to documents. (#57)
0.3.0
The following change fixes an edge case that could result in data loss:
- BREAKING CHANGE:
Collection:load
no longer caches promises. Each call will now return a unique promise and attempt to load the document separately. This is to fix an edge case that can result in data loss. More information can be found in the pull request. (#48)
0.2.11
0.2.10
0.2.9
0.2.8
0.2.7
0.2.6
- Added types (#24)
- Added
document:beforeClose
callback to make final changes to a document before it closes (#25)- This callback works even when the document is closed by
game:BindToClose
.
- This callback works even when the document is closed by
- Added APIs to set a document's
DataStoreKeyInfo:GetUserIds()
(#26)- Changed
Collection:load(key: string)
toCollection:load(key: string, defaultUserIds: {number}?)
defaultUserIds
only applies if it's the first time the document has ever been loaded.
- Added
Document:addUserId(userId: number)
- Added
Document:removeUserId(userId: number)
- Changed