You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
)
How to get a Database Pool
Function
Arguments
Returns
CentralDatabase.GetPool
string poolName
returns the pool object for poolName
CentralDatabase.GetPool( String poolName )
Example
local db = nil
local function onDatabaseConnected()
db = CentralDatabase.GetPool("demoPool")
end
hook.Add("CentralDatabase::ConnectedPools", "TestOnDatabaseConnected", onDatabaseConnected)
How to use a Database Pool
db:Query( String sql, Function callback, Function errorCallback )