Thread Tools Display Modes
02-14-18, 10:54 AM   #1
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I think you're laboring under a misapprehension... Ace3 is a family of standalone libraries. Each Ace(whatever)-3.0 library is totally independent of any of the others, with a few obvious exceptions (e.g. AceDBOptions doesn't do anything without both AceDB and one of the AceConfig* libraries to consume the options table it generates).

You can absolutely use just AceDB-3.0.

If you're using the CurseForge packager to pull in your libraries, rather than referencing the whole Ace3 repository in your .pgkmeta file, just list the sub-paths to the individual libraries you want to use:

Code:
externals:
   Libs/AceDB-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDB-3.0
   Libs/CallbackHandler-1.0: svn://svn.wowace.com/wow/callbackhandler/mainline/tags/1.0.6/CallbackHandler-1.0
   Libs/LibStub: svn://svn.wowace.com/wow/libstub/mainline/tags/1.0
(Note that this technique only works with SVN repos, not Git or Hg. Really, the Ace3 project should be split up so that each library has its own repo and project page, but that's not up to me!)
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
02-14-18, 12:11 PM   #2
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
Originally Posted by Phanx View Post
Code:
externals:
   Libs/AceDB-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDB-3.0
   Libs/CallbackHandler-1.0: svn://svn.wowace.com/wow/callbackhandler/mainline/tags/1.0.6/CallbackHandler-1.0
   Libs/LibStub: svn://svn.wowace.com/wow/libstub/mainline/tags/1.0
(Note that this technique only works with SVN repos, not Git or Hg. Really, the Ace3 project should be split up so that each library has its own repo and project page, but that's not up to me!)
It definitely works for both git and svn, don't know about hg though. And curse switched to a new repo system. The proper URL for AceDB3 would be
  Reply With Quote
02-14-18, 05:47 PM   #3
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by Phanx View Post
I think you're laboring under a misapprehension... Ace3 is a family of standalone libraries. Each Ace(whatever)-3.0 library is totally independent of any of the others, with a few obvious exceptions (e.g. AceDBOptions doesn't do anything without both AceDB and one of the AceConfig* libraries to consume the options table it generates).

You can absolutely use just AceDB-3.0.

If you're using the CurseForge packager to pull in your libraries, rather than referencing the whole Ace3 repository in your .pgkmeta file, just list the sub-paths to the individual libraries you want to use:

Code:
externals:
   Libs/AceDB-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDB-3.0
   Libs/CallbackHandler-1.0: svn://svn.wowace.com/wow/callbackhandler/mainline/tags/1.0.6/CallbackHandler-1.0
   Libs/LibStub: svn://svn.wowace.com/wow/libstub/mainline/tags/1.0
(Note that this technique only works with SVN repos, not Git or Hg. Really, the Ace3 project should be split up so that each library has its own repo and project page, but that's not up to me!)
Wait...

So, AceDB object doesn't necessarily be initialized via AceAddon's OnInitialize method?

That's a good news!
  Reply With Quote
02-14-18, 11:10 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Layback_ View Post
So, AceDB object doesn't necessarily be initialized via AceAddon's OnInitialize method?
Nope!

Here's how you would adapt the example from the AceDB-3.0 documentation page to use it without AceAddon-3.0. Yellow parts are copied from the documentation:

Code:
-- declare defaults to be used in the DB
local defaults = {
  profile = {
    setting = true,
  }
}

-- Here we set up event handling, which as a happy coincidence,
-- replicates 99% of what anyone uses AceEvent for in just 3 lines of code:
local MyAddon = CreateFrame("Frame", ADDON_NAME)
MyAddon:SetScript("OnEvent", function(self, event, ...)
  return self[event](self, ...)
end)

-- Now we replicate the functionality of the OnInitialize method from
-- AceAddon-3.0 by registering for an event and declaring a function to handle it:
MyAddon:RegisterEvent("PLAYER_LOGIN")
function MyAddon:PLAYER_LOGIN()
  -- Assuming the .toc says ## SavedVariables: MyAddonDB
  self.db = LibStub("AceDB-3.0"):New("MyAddonDB", defaults, true)
end
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 02-14-18 at 11:15 PM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Standalone Database Library?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off