Database
self:is_connected
Server
Checks whether the database instance has an active connection
Syntax
local result = self:is_connected()Parameters
| Type | Name | Description |
|---|
Returns
| Type | Name | Description |
|---|---|---|
bool | result | true if the connection is active, false otherwise |
Examples
local db = database.create("127.0.0.1", "root", "", "vital_sandbox")
engine.print("info", db:is_connected()) --true