Skip to main content

The "info" Namespace

The info namespace is a special namespace that holds information regarding the structure of all other namespaces. It informs the user of other tables, columns, actions, and more that are available. The info namespace can only be queried, and it cannot be modified.

Tables in the "info" Namespace

"namespaces" Table

The namespaces table contains information about all the namespaces in the database.

ColumnData TypeDescription
nameTEXTThe name of the namespace
typeTEXTThe type of the namespace (one of 'USER', 'SYSTEM', or 'EXTENSION')

"tables" Table

The tables table contains information about all the tables in the database.

ColumnData TypeDescription
nameTEXTThe name of the table
namespaceTEXTThe namespace the table belongs to

"columns" Table

The columns table contains information about all the columns in the database.

ColumnData TypeDescription
namespaceTEXTThe namespace the column belongs to
table_nameTEXTThe table the column belongs to
nameTEXTThe name of the column
data_typeTEXTThe type of the column
is_nullableBOOLWhether the column can be null
default_valueTEXTThe default value of the column
is_primary_keyBOOLWhether the column is part of the primary key
ordinal_positionINT8The position of the column in the table

"indexes" Table

The indexes table contains information about all the indexes in the database.

ColumnData TypeDescription
namespaceTEXTThe namespace the index belongs to
table_nameTEXTThe table the index belongs to
nameTEXTThe name of the index
is_primary_keyBOOLWhether the index is a primary key
is_uniqueBOOLWhether the index is unique
columnsTEXT[]The columns the index is on

"constraints" Table

The constraints table contains information about all the constraints in the database. It does not include foreign key constraints.

ColumnData TypeDescription
namespaceTEXTThe namespace the constraint belongs to
table_nameTEXTThe table the constraint belongs to
nameTEXTThe name of the constraint
constraint_typeTEXTThe type of the constraint ('CHECK' or 'UNIQUE')
columnsTEXT[]The columns the constraint is on
expressionTEXTThe expression for the constraint, if it is a 'CHECK' constraint

"foreign_keys" Table

The foreign_keys table contains information about all the foreign key constraints in the database.

ColumnData TypeDescription
namespaceTEXTThe namespace the foreign key belongs to
table_nameTEXTThe table the foreign key belongs to
nameTEXTThe name of the foreign key
columnsTEXT[]The columns the foreign key is on
ref_tableTEXTThe table the foreign key references
ref_columnsTEXT[]The columns in the referenced table the foreign key references
on_updateTEXTThe action to take on update ('CASCADE', 'SET NULL', 'SET DEFAULT', 'RESTRICT', or 'NO ACTION')
on_deleteTEXTThe action to take on delete ('CASCADE', 'SET NULL', 'SET DEFAULT', 'RESTRICT', or 'NO ACTION')

"actions" Table

The actions table contains information about all the actions in the database.

ColumnData TypeDescription
namespaceTEXTThe namespace the action belongs to
nameTEXTThe name of the action
raw_statementTEXTThe text body of the action
access_modifiersTEXT[]The access modifiers of the action ('PUBLIC', 'SYSTEM', 'PRIVATE', 'OWNER', or 'VIEW')
parameter_namesTEXT[]The ordered names of the parameters of the action
parameter_typesTEXT[]The ordered types of the parameters of the action
return_namesTEXT[]The ordered names of the return values of the action, if they exist
return_typesTEXT[]The ordered types of the return values of the action, if they exist
returns_tableBOOLWhether the action returns a table
built_inBOOLWhether the action is built-in as a precompile

"roles" Table

The roles table contains information about all the roles in the database.

ColumnData TypeDescription
nameTEXTThe name of the role
built_inBOOLWhether the role is built-in or is user-define

"role_privileges" Table

The role_privileges table contains information about the privileges that each role has.

ColumnData TypeDescription
role_nameTEXTThe name of the role
privilegeTEXTThe privilege the role has ('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'CREATE', 'DROP', 'ALTER', 'CALL', 'ROLES', or 'USE')
namespaceTEXTThe namespace the privilege is on, if it is not global

"user_roles"

The user_roles table contains information about the roles that each user has.

ColumnData TypeDescription
role_nameTEXTThe name of the role
user_identifierTEXTThe identifier of the user (usually a wallet address or public key)

"extensions" Table

The extensions table contains information about the extensions currently being used.

ColumnData TypeDescription
namespaceTEXTThe namespace that the extension is registered under
extensionTEXTThe name of the extension
parametersTEXT[]The parameter keys that the extension was initialized with
valuesTEXT[]The parameter values that the extension was initialized with, ordered according to their corresponding parameter name