Fetch Row By ID (LCC.db.get)
Signature
row, err = LCC.db.get(name, id, timeout?)
Parameters
- name
String. Table name. Must be non-empty and no longer than 256 bytes. - id
Number. Rowidto retrieve. Must be an integer value greater than or equal to1. - timeout
Number, optional. Request timeout in seconds, default60.
Returns
- row
Table. Row that matches theid;nilwhen not found. - err
String ornil. Returns'not found'if the row is missing,'unknown table'when the table does not exist.
Notes
Retrieves a single row by
id, typically for editing forms.
User columns are returned as strings, whileidis returned as a number.
Anidthat is not an integer value greater than or equal to1triggers a Lua parameter validation error.
Example
local row, err = LCC.db.get("tasks", 42)
if row then
print("Task", row.Name, row.Status)
end