Method Global:PlayerbotsDBQuery [-] [+]

Executes a SQL query on the playerbots database and returns an ALEQuery.

The query is always executed synchronously (i.e. execution halts until the query has finished and then results are returned). If you need to execute the query asynchronously, use Global:PlayerbotsDBQueryAsync instead.

local Q = PlayerbotsDBQuery("SELECT id, name, x, y, z FROM playerbots_travelnode WHERE map_id = 0 LIMIT 10")
if Q then
    repeat
        local id, name = Q:GetUInt32(0), Q:GetString(1)
        print(id, name)
    until not Q:NextRow()
end

Synopsis

results = PlayerbotsDBQuery( sql )

Arguments

string sql

Query to execute.

Returns

ALEQuery results
See method description.

Generated on
©2026 - ALE Lua Engine