Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

Database Dictionary

A database must have a database dictionary; this file is named with the database name and an extension of .fdd. It is created with ctdbCreateDatabase(), and must exist for the user to connect to the database. Each database dictionary maintains information about the tables associated with the database. When a database is connected to the session, it is considered "active".

Database Dictionary Layout

Field

Type

Length

Description

TYPE

CT_INT4

4

Record type: 1-database 2-table 3-index

STATUS

CT_INT4

4

Record status: 0-status ok 1-reserved

LOGICAL_NAME

CT_FSTRING

128

Logical (database) name of database or table or index

PHYSICAL_NAME

CT_FSTRING

128

Physical name of database or table or index

LINK

CT_FSTRING

128

Name of table if record type is 3-index

LINKNBR

CT_INT4

4

Table UID if record type is 3-index

PATH

CT_FSTRING

256

Path of database dictionary, data or index

SUPEXT

CT_FSTRING

16

Super file extension (if super file is used)

DATEXT

CT_FSTRING

16

Data file extension (usually .DAT)

IDXEXT

CT_FSTRING

16

Index file extension (usually .IDX)

VERSION

CT_INT4

4

Record version: 0x00010000 (version 1.0)

COUNTER

CT_INT4

4

Deprecated.

UID

CT_INT4

4

UID for database or table or index

OWNER

CT_FSTRING

128

Name of owner - used by the FairCom DB SQL server

MIRROR_NAME

CT_FSTRING

128

Name of mirrored file.

MIRROR_PATH

CT_FSTRING

128

Path of mirrored file.

RESERVED

CT_ARRAY

3000

Reserved for future use

This information is included for general information on the database dictionary structure. c-treeDB API has appropriate functions to retrieve any needed information from the database dictionary, such as the table UID or path.

A database dictionary file has several different record types:

  • Table records (the field Type set to 2) holds information about a data file (table).
  • Index records (the field Type set to 3) holds information about an index file.
  • A special type four record which maintained the COUNTER field has been been deprecated as of FairCom DB V9.0.

TOCIndex