DB.CreateQuery (Civ5 API)

From Civilization Modding Wiki
Revision as of 18:33, 19 September 2012 by DonQuich (talk | contribs) (Bot update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of DB.

This is a static method, invoke it with a dot.


Usage

void DB.CreateQuery(string sql)


Parameters

sql: No description available.


Source code samples

Redundant occurences have been removed.

CivilopediaScreen.lua (G&K)

DLC/Expansion/UI/Civilopedia/CivilopediaScreen.lua
0473
local UnitsByEra = DB.CreateQuery(sql);
0728
local BuildingsByEra = DB.CreateQuery(sql);


SelectCivilization.lua

UI/FrontEnd/GameSetup/SelectCivilization.lua
0152
local traitsQuery = DB.CreateQuery([[SELECT Description, ShortDescription FROM Traits inner join
0153
Leader_Traits ON Traits.Type = Leader_Traits.TraitType
0154
WHERE Leader_Traits.LeaderType = ? LIMIT 1]]);
0181
local scenarioCivQuery = DB.CreateQuery(sql);


UniqueBonuses.lua

UI/FrontEnd/GameSetup/UniqueBonuses.lua
0161
local uniqueUnitsQuery = DB.CreateQuery([[SELECT ID, Description, PortraitIndex, IconAtlas from Units INNER JOIN
0162
Civilization_UnitClassOverrides ON Units.Type = Civilization_UnitClassOverrides.UnitType
0163
WHERE Civilization_UnitClassOverrides.CivilizationType = ? AND
0164
Civilization_UnitClassOverrides.UnitType IS NOT NULL]]);
0166
local uniqueBuildingsQuery = DB.CreateQuery([[SELECT ID, Description, PortraitIndex, IconAtlas from Buildings INNER JOIN
0167
Civilization_BuildingClassOverrides ON Buildings.Type = Civilization_BuildingClassOverrides.BuildingType
0168
WHERE Civilization_BuildingClassOverrides.CivilizationType = ? AND
0169
Civilization_BuildingClassOverrides.BuildingType IS NOT NULL]]);
0171
local uniqueImprovementsQuery = DB.CreateQuery([[SELECT ID, Description, PortraitIndex, IconAtlas from Improvements where CivilizationType = ?]]);



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.