Products Support Documentation Download
rdm-compile: Schema compiler tool
rdm-compile [OPTION]... dbname.sdl

rdm-compile is a command-line utility that compiles a database definition into a platform-agnostic binary catalog file. It can optionally generate C and C++ source and header files that can be included in an application. The generated files will always be written to the current working directory even though the input file was specified with a path. This behavior makes it possible to use the tool in an out-of-source build environment.

Option Description
-h, --help Display this usage information
--version Display the version information
-q, --quiet Quiet mode. No information will be displayed
-x, --cxx-api Generate C++ API source and header files. The generated files will be named dbname_api.cpp and dbname_api.h respectively. This option implies the --catalog and --c-structs options.
--locale=locale The string collation locale the database will use (See locale)
-a, --catalog Generate internal catalog source header files. The generated files will be named dbname_cat.c and dbname_cat.h respectively.
-s, --c-structs Generate database header file. The generated file will be named dbname_structs.h. The file is not necessary if an application only uses SQL to access the database.
--namespace=text Prefix text to dbname for all generated files
dbname.sdl Name of database definition file (.sdl)
The dbname is used as a part of the generated files names for C/C++ files. You should avoid using characters that may be invalid for these file names when naming the dbname.sdl file.
Usage Examples

The usage examples assume that bookshop.sdl contains the following table definition:

    last_name CHAR(13) PRIMARY KEY,
    full_name CHAR(25),
    gender    CHAR(1),
    yr_born   SMALLINT,
    yr_died   SMALLINT,
    short_bio VARCHAR(216),
    KEY yob_gender_key(yr_born, gender)
Compiling an RDM database catalog

You can run rdm-compile to compile a database definition file into an RDM database catalog file.

$ rdm-compile bookshop.sdl

An RDM database catalog file named will be created as the result.

Generating source and header files

Several command-line options are provided with rdm-compile to generate source and header files that can be included or embedded in an application.

$ rdm-compile --c-structs --catalog bookshop.sdl

The header file, bookshop_structs.h, will contain the structure definition of the database. The catalog source header files, bookshop_cat.c and bookshop_cat.h, will contain the text definition of the database catalog and its entry point.