ReplitDB for Java!!
JeplDB - ReplitDB for Java
So I got tired of how annoying it is and how little support ReplitDB has in several languages, including Java. So I decided to make my own. It's still ReplitDB, but for Java, and it includes some booster functions. So here we go.
Just go ahead and fork this repl, and you're all set to go. Write your code in
Main.java (or if you know what you're doing, you can also write it in another file).
Let's create an object of Jepl:
Replit sets an env variable with your special link, so you shouldn't have to change any of the above code.
Now, you should have immediately have access to the status code:
status variable will be updated every time you perform something.
You can check out all the status codes and their meanings here.
Set an item:
This doesn't return any value, but you can get the HTTP response code after performing the task:
All successful operations should return status 200, except for operations regarding deleting, which returns 204 (no content).
Get an item:
Result will be the value of whatever you set.
Delete an item:
If succesful, the status code should be
List all keys:
Keys seperated by new line. If non, you will simply get a
More stuff coming soon
- Get everything
- Get prefixed
- Delete everything
- Other stuff
Problems and suggestions
You can do it on the Github repo.
Copyright 2021 codingjlu
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
You do not need to attribute me, but it would be appreciated.