nanos world API Reference Unofficial documentation
Function Server

Database:Select

Selects a query synchronously

Syntax

Lua
my_database:Select(query, parameters... = nil)

Parameters

Name Type Default Description
query string Query to execute
parameters... optional any nil Sequence of parameters to escape into the Query

Returns

  • table[] rows fetched
  • string error (if any)

Examples

Selects from a table (SQLite)
local rows = my_database:Select("SELECT * FROM MyTable WHERE name = :0 AND title = :1", "Val", "AnotherVal")