Vital.sandbox
Database

self:is_connected

Server

Checks whether the database instance has an active connection


Syntax

local result = self:is_connected()

Parameters

TypeNameDescription

Returns

TypeNameDescription
boolresulttrue 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

On this page