Created a new database Library
For a while my UI has been using my own database library, but now I have modified it for general use.
It has additional functionality compared to the standard AceDB that you might find interesting:
- You can append default values onto a defaults table.
- You can use database table inheritance (very useful):
This means that if a value cannot be found in the "aFrame" database table, then it will get it from the parent database table.
This allows you to make templates that many tables inherit from. This has many advantages compared to using the defaults
table; You can customise the template using your own config menu to apply changes to all objects that inherit from it, and
all the changes are persistent.
- The database framework uses metatables to automatically select and retrieve the appropriate values automatically for you using a three step pattern:
- Check if the key/value pair is located in the saved variable table.
- If not found, check if the key/value pair is located in the defaults table.
- If not found, check if the Observer has a parent. If it does, repeat step 1 using the parent Observer.
- You can parse and set database values using path addresses (stringns) to query values from the database:
value = db:ParsePathValue("global.core.settings["..moduleName.."]")
- You can remove and restore profiles in case users accidentally removed the wrong profiles.
It has proven to be very useful for my projects so if any of these features seem useful for your needs then
feel free to give it a go and let me know what you think:
EDIT: Just updated it to support many databases running simultaneously using db:CreateDatabase() method.
The new version requires a different way of setting it up and starting the database. Information is on the download page.
Updated this library to make it much more user friendly. Also, the documentation on the download page is much nicer to read and understand.
Functions have been renamed, an OnStart function has been added so that the database starts automatically after the AddOn using the database has been successfully loaded, and more helpful functions have been added.
|All times are GMT -6. The time now is 11:08 PM.
vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI