Skip to content

Releases: nezuo/lapis

0.3.3

24 Aug 19:14
Compare
Choose a tag to compare
  • 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 and beforeSave 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 return true.
  • DataStoreKeyInfo:GetMetadata() is now preserved. Before, it would be erased anytime a Document was saved or closed. (#67)

0.3.2

06 Aug 17:44
Compare
Choose a tag to compare
  • 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)

0.3.1

06 Jul 22:56
Compare
Choose a tag to compare
  • Added Document:keyInfo(). It returns the last updated DataStoreKeyInfo 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 in Collection: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

14 Apr 21:34
Compare
Choose a tag to compare

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

09 Apr 18:34
Compare
Choose a tag to compare
  • Fix infinite yield in game:BindToClose caused by a document failing to load. (#45)

0.2.10

26 Mar 00:53
Compare
Choose a tag to compare
  • Document:load now infinitely yields and doesn't load the document after game:BindToClose is called. If a document
    does load because UpdateAsync is called just before game close, it is automatically closed. (#43)

0.2.9

11 Jan 04:19
Compare
Choose a tag to compare
  • 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 if game:BindToClose happens to run first.

0.2.8

28 Dec 03:35
Compare
Choose a tag to compare
  • 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)

0.2.7

13 Nov 04:13
Compare
Choose a tag to compare
  • Add Document:beforeSave callback to make changes to a document before it saves (#29)

0.2.6

24 Oct 23:00
5acef53
Compare
Choose a tag to compare
  • 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.
  • Added APIs to set a document's DataStoreKeyInfo:GetUserIds() (#26)
    • Changed Collection:load(key: string) to Collection: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)