Releases: nezuo/lapis
Releases · nezuo/lapis
0.3.3
- Files now use the
.luauextension instead of.lua. (#61) - Switched wally realm to
shared. This means Lapis can be used as a shared or server dependency. (#62) beforeCloseandbeforeSavenow throw an error if they yield. For more information, see the PR. (#64)- Added
Collection:removeto remove the data from a document. (#65) - Session locks will now be removed from documents if
Document:closefails for the following reasons: (#66)beforeSave/beforeClosethrew an error.validatethrew an error.validatedidn't returntrue.
DataStoreKeyInfo:GetMetadata()is now preserved. Before, it would be erased anytime aDocumentwas saved or closed. (#67)
0.3.2
0.3.1
- Added
Document:keyInfo(). It returns the last updatedDataStoreKeyInforeturned 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
validatethrowing an error inCollection:load. Before it would keep retrying the load and spam the console with confusing errors. (#52) - Allow
defaultDatato 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
validateoption for collections is now optional. (#56) - Add
freezeDataoption 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:loadno 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:beforeClosecallback 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}?)defaultUserIdsonly applies if it's the first time the document has ever been loaded.
- Added
Document:addUserId(userId: number) - Added
Document:removeUserId(userId: number)
- Changed