|
| 30 Dec 2015 07:56 PM |
| Is it possible to reset an entire datastore without knowing the key for each entry within the datastore? (Moving the place to another place isn't an option.) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 30 Dec 2015 07:59 PM |
@BFF
You can't just simply set a datastore to nil
Neither is there a way to retrieve the keys in a datastore.
So sorry OP, roblox datastores are horrible which is why I had to write this gigantic php/mysql web api. |
|
|
| Report Abuse |
|
|
rvox
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 5380 |
|
|
| 30 Dec 2015 07:59 PM |
Just switch datastores
before: local DS = service:GetDataStore("blah")
after: local DS = service:GetDataStore("blah2") |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2015 08:00 PM |
@rvox
That isn't actually resetting anything.... |
|
|
| Report Abuse |
|
|
rvox
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 5380 |
|
|
| 30 Dec 2015 08:01 PM |
| But for all purposes it works |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2015 08:02 PM |
@Protected
It actually is, and the added benefit is he can still recover old data. |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2015 08:02 PM |
@rvox
True, I've done that quite a few times.
Inefficient though.
Roblox just needs to up their game and make an actual DBMS |
|
|
| Report Abuse |
|
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
|
| 30 Dec 2015 08:07 PM |
| i wonder why there isn't more advanced methods of interacting with your datastores, the system in place is very primitive (atleast the interface is, anyways) |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2015 08:09 PM |
Normally, I would just change the name of the datastore, yeah. The thing is though, I reference that datastore plenty of times in a script and I'm trying to make the said script user-friendly so people don't have to know about datastores in order to use it correctly.
Well, that stinks that there's no methods to reset a data store. Hopefully ROBLOX will add some kind of function in the future to either retrieve all of the keys in a data store like :GetKeys() or a function to just immediately wipe it out like :ClearAllKeys(). |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2015 08:10 PM |
@TheBen
If you need to put the DataStore name in more than one place, you don't know basic efficiency. Just use a variable. |
|
|
| Report Abuse |
|
|
Chrapnel
|
  |
| Joined: 01 Feb 2014 |
| Total Posts: 951 |
|
| |
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
|
| 30 Dec 2015 08:12 PM |
@Ben
if it's a system for someone else, maybe you should generate the keys in a linear way so that the keys of the datastore can be discovered later.
kind of like how you would pop a stack |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2015 08:52 PM |
Just implemented that @Unstable, thanks for mentioning it. That should solve this issue I've been dealing with for now.
Anyways, I've created a thread in S&I to get some new features for the DataStores. Take a look if you'd like to do so. http://forum.roblox.com/Forum/ShowPost.aspx?PostID=180710928 |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2015 08:58 PM |
| S&I is pretty much a waste of time: all you'll get out of posting a suggestion there is a few idiots debating for weeks over some stupid detail. From what I know, suggesting something on the roblox developer forums is really the only way. |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2015 09:02 PM |
| Oh well. I'll just message the idea to someone that's in RBXDev and hopefully they'll post something about it on the developer forums then. |
|
|
| Report Abuse |
|
|