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
| Type | Name | Description |
|---|---|---|
string | name | Name of the table to be targetted |
Returns
| Type | Name | Description |
|---|---|---|
db_query / bool | query | Query 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")