class JsonTable

This class provides static functions to update the definition of tables in a JsonSQL database

Methods

static void
create(Engine $engine, string $table, stdClass $columns, array $required, array $foreignkeys, bool $ifnotexists = false)

Creates a table in the database

static void
drop(Engine $engine, string $table, bool $ifexists = false)

Drops a table

static void
rename(Engine $engine, string $table, string $newname)

Renames a table

static void
setTitle(Engine $engine, string $table, string|bool $title = false)

Set or remove the title of a table.

static void
setDescription(Engine $engine, string $table, string|bool $description = false)

Set or remove the description of a table.

Details

at line 51
static void create(Engine $engine, string $table, stdClass $columns, array $required, array $foreignkeys, bool $ifnotexists = false)

Creates a table in the database

Parameters

Engine $engine The engine using this function
string $table The table name
stdClass $columns The columns definition
array $required The list of required columns
array $foreignkeys The list of foreign keys definition
bool $ifnotexists if true, don't throw an error if the table already exists

Return Value

void

Exceptions

JsonSQLException

at line 97
static void drop(Engine $engine, string $table, bool $ifexists = false)

Drops a table

Parameters

Engine $engine The engine using this function
string $table The table name
bool $ifexists if true, don't throw an error if the table doesn't exists

Return Value

void

Exceptions

JsonSQLException

at line 121
static void rename(Engine $engine, string $table, string $newname)

Renames a table

Parameters

Engine $engine The engine using this function
string $table The table name
string $newname The new name of the table

Return Value

void

Exceptions

JsonSQLException

at line 147
static void setTitle(Engine $engine, string $table, string|bool $title = false)

Set or remove the title of a table.

Parameters

Engine $engine The engine using this function
string $table The table name
string|bool $title The title content. If false, remove the title

Return Value

void

Exceptions

JsonSQLException

at line 178
static void setDescription(Engine $engine, string $table, string|bool $description = false)

Set or remove the description of a table.

Parameters

Engine $engine The engine using this function
string $table The table name
string|bool $description The description content. If false, remove the description

Return Value

void

Exceptions

JsonSQLException