primem0ver
Emperor
Database stuff is probably my biggest knowledge gap when it come to programming. So I am curious. The thing that worries me about using database stuff and queries is that the queries have to be translated and then functions called. Is it possible for standard queries to be inlined and exported to the executable during compilation?
Let's use AIAndy's example:
Let's assume for this example that this query is contained in a method in a C# class: ApplyBuildingEffectOnAllCities(THIS_ENTITY, E) (or whatever parameters are necessary)
Within this method is the code above. Assuming all the variables above are variables accessible from the C# code, can the resulting query algorithms be compiled directly into the ApplyBuildingEffectOnAllCities(...) method or does a running sql engine have process the script and then perform the necessary tasks?
Let's use AIAndy's example:
As an example a building effect that should apply to all cities of the team.
That can be expressed by an SQL query that looks somewhat like this:
SELECT E.city
FROM buildings A
INNER JOIN cities B ON A.city = B.city
INNER JOIN players C ON B.owner = C.player
INNER JOIN players D ON C.team = D.team
INNER JOIN cities E ON D.player = E.owner
WHERE A.building = THIS_ENTITY;
Let's assume for this example that this query is contained in a method in a C# class: ApplyBuildingEffectOnAllCities(THIS_ENTITY, E) (or whatever parameters are necessary)
Within this method is the code above. Assuming all the variables above are variables accessible from the C# code, can the resulting query algorithms be compiled directly into the ApplyBuildingEffectOnAllCities(...) method or does a running sql engine have process the script and then perform the necessary tasks?