Vital.sandbox
Database

self:table

Server

Creates a query builder targeting the specified table


Syntax

local query = self:table(name)

The target table must be previously defined and synced before calling this function. Refer self:define and self:sync to register and sync your schemas.

  • Registered and synced — a query builder instance is returned scoped to the given table
  • Not registered — the call will fail and return false

Parameters

TypeNameDescription
stringnameName of the table to be targetted

Returns

TypeNameDescription
db_query / boolqueryQuery builder instance on successful execution, or false on failure

Examples

local db = database.create("127.0.0.1", "root", "", "vital_sandbox")

--Create a query builder targeting the players table
local query = db:table("players")

On this page