SlashCo Wiki

SlashCo.SQLTableToLuaTable

 table SlashCo.SQLTableToLuaTable( table data, string keyName )

Description

Converts a sequential SQL result table into a keyed Lua table.
The value of the specified column is used as the key for each row.

Arguments

1table data

Sequential table of SQL result rows

2string keyName

Name of the column to use as the resulting table key

Returns

1table resultTable

Table containing the original rows indexed by the requested column value