buildthomas / mockdatastoreservice Goto Github PK
View Code? Open in Web Editor NEWEmulation of Roblox's DataStoreService for seamless offline development & testing
License: Apache License 2.0
Emulation of Roblox's DataStoreService for seamless offline development & testing
License: Apache License 2.0
I want to get MockDataStoreService working so I can test DataStore2 (and possibly push this upstream into Lemur as the default DataStoreService implementation), I'll try and add as much as necessary until my local copy stops erroring, then push upstream.
Issues that need figuring out:
UpdateAsync only yields if the transform function returns nil which isn't accurate behavior.
Might require an extra class that acts as the master of all data/interfaces and that MockDataStoreService/MockGlobalDataStore/MockOrderedDataStore accesses this instead of owning the data itself, otherwise it requires adding extra methods to these classes which would clash with the design principle of sticking to the Roblox API.
Have an option to have every transaction of MockDataStoreService be logged in some shape or form.
Right now it clashes with the purpose of the module, because ImportFromJSON/ExportToJSON are not part of the default Roblox API for datastores.
My code:
local MockDataStoreService = require(script.DataStoreService)
local ods = MockDataStoreService:GetOrderedDataStore("myDataStore")
print(ods:ExportToJSON())
Yes, the myDataStore
OrderedDataStore does actually have keys in it. But this code just prints []
With this recent update to the datastoreservice, I believe the mockdatastoreservice should reflect this change and remove the write lock.
Currently, as of v1.0.2
, 37 tests are failing on the master
branch.
To reproduce, simply checkout this repository @ the tag v1.0.2
, generate a place file from place.project.json
, and run the tests:
This was mentioned in #23.
MockDataStoreService should support Wally
I refer to a :UpdateAsync
request which tries to write to the DataStore, not when it returns nil.
I don't know about other requests / scenarios.
So when I was testing it a while back I noticed :UpdateAsync
calls are unrealistically fast.
In my testing, yield times for a simple table with some small contents when using actual datastores is something like this:
But when I used this module it took WAYY less than that, something like .02 seconds or close.
This might be what this person referenced here:
But I'm not sure.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.