7.3.40. object_exist Summary

New in version 5.0.6.

object_exist returns whether object with the specified name exists or not in database.

It’s a light operation. It just checks existence of the name in the database. It doesn’t load the specified object from disk.

object_exist doesn’t check object type. The existing object may be table, column, function and so on. Syntax

This command takes only one required parameter:

object_exist name Usage

You can check whether the name is already used in database:

Execution example:

object_exist Users
# [[0, 1337566253.89858, 0.000355720520019531], false]
table_create Users TABLE_HASH_KEY ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
object_exist Users
# [[0, 1337566253.89858, 0.000355720520019531], true]

The object_exist Users returns false before you create Users table.

The object_exist Users returns true after you create Users table. Parameters

This section describes all parameters. Required parameters

There is only one required parameter. name

Specifies the object name to be checked.

If you want to check existence of a column, use TABLE_NAME.COLUMN_NAME format like the following:

Execution example:

table_create Logs TABLE_NO_KEY
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Logs timestamp COLUMN_SCALAR Time
# [[0, 1337566253.89858, 0.000355720520019531], true]
object_exist Logs.timestamp
# [[0, 1337566253.89858, 0.000355720520019531], true]

Logs is table name and timestamp is column name in Logs.timestamp. Optional parameters

There is no optional parameter. Return value

The command returns true as body if object with the specified name exists in database such as:

[HEADER, true]

The command returns false otherwise such as:

[HEADER, false]

See Output format for HEADER.