This Addon was created by SeaLife
Hook Name | Action |
---|---|
CentralDatabase::ConnectedPools | Will be called if all Pools are connected |
DatabasePool.new(
"demoPool", -- Name of Pool (for Internal Usage)
"db.host.com", -- Host of Database
3306, -- Port of Database
"demouser", -- User for Authentication
"password", -- Password for Authentication
"demodb" -- Database Name
)
Function | Arguments | Returns |
---|---|---|
CentralDatabase.GetPool | string poolName | returns the pool object for poolName |
CentralDatabase.GetPool( String poolName )
local db = nil
local function onDatabaseConnected()
db = CentralDatabase.GetPool("demoPool")
end
hook.Add("CentralDatabase::ConnectedPools", "TestOnDatabaseConnected", onDatabaseConnected)
db:Query( String sql, Function callback, Function errorCallback )