- 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)
- Added
Collection:read
to view a document's data without editing or session locking it. (#59) - IMPORTANT: Fixed bug that resets a saved migration version that is ahead of the server's version and is backwards compatible. (#60)
- 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)
- 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)
- Fix infinite yield in
game:BindToClose
caused by a document failing to load. (#45)
Document:load
now infinitely yields and doesn't load the document aftergame:BindToClose
is called. If a document does load because UpdateAsync is called just before game close, it is automatically closed. (#43)
Document:close
no longer errors when called again and instead returns the original promise. (#35)- This is so it won't error when called from
PlayerRemoving
ifgame:BindToClose
happens to run first.
- This is so it won't error when called from
- Removed internal compression code since compression is no longer planned (#31)
- Data is no longer loaded if it doesn't pass the
validate
function. This means it won't be session locked and migrated. (#32)
- Add
Document:beforeSave
callback to make changes to a document before it saves (#29)
- 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
- Fix existing data not being frozen on load (#20)
- Fix
game:BindToClose
not waiting for documents to close
- Fix silly mistake where I don't return the collection from
createCollection
- Remove write cooldown throttling since write cooldowns were removed (#11)
- Fix save merging algorithm (#13)
- Added new throttle queue which allows load/save/close requests from different keys to be processed at the same time (#15)
- Move TestEZ and DataStoreServiceMock to dev dependencies
- Remove unused files from published package
- Renamed
Collection:openDocument
toCollection:load
- Renamed
retryAttempts
config setting tosaveAttempts
- Renamed
acquireLockAttempts
config setting toloadAttempts
- Renamed
acquireLockDelay
config setting toloadRetryDelay
- Fixed edge case that allowed documents to load even when their migration version exceeded the server's latest migration