rdm-convert
RDM Legacy DDL/DBD conversion tool
Synopsis
rdm-convert [OPTION]... dbname[.ddl|.dbd]
Description
rdm-convert
is a command-line utility that converts a database definition file (.ddl) or a compiled dictionary file (.dbd) for a legacy RDM database.
If the legacy file includes features that aren't supported by RDM 14, rdm-convert
will terminate with an error or ignore them with warnings.
Options
-h, --help |
Display this usage information |
--version | Display the version information |
-q, --quiet | Quiet mode. No information will be displayed |
-B, --no-banner | Do not display the banner |
--stdout=filespec | Redirect stdout to the specified filespec |
--stderr=filespec | Redirect stderr to the specified filespec |
-p, --preprocess | Evaluate preprocessor directives |
--sed | Generate a SED conversion script. Use this script to modify legacy RDM source code to use the new struct definitions for RDM. |
--sed-d | Generate a SED conversion script with the DDLP -d option. Use this script to modify legacy RDM source code to use the new struct definitions for RDM. |
dbname[.ddl | .dbd] | Legacy database definition file (.ddl) or legacy dictionary file (.dbd). If no extension is specified, a dictionary file with an extension of '.ddl' will be used. |
Usage Examples
The usage example assumes that bookshop.ddl
contains the following database definition.
database bookshop { data file "bookshop.d0x" contains author; key file "bookshop.k0x" contains last_name; key file "bookshop.k1x" contains yob_gender_key; vardata file "bookshop.v0x" contains short_bio; record author { unique key char last_name[14]; char full_name[26]; char gender[2]; int16_t yr_born; int16_t yr_died; varchar short_bio[217]; compound key yob_gender_key { yr_born; gender; } } }
Generating an RDM 14 database definition file
You can generate an RDM 14 database definition file (.sdl) from a legacy database definition file (.ddl) by running rdm-convert
as follows:
$ rdm-convert bookshop.ddl
The RDM 14 database definition file named bookshop.sdl
will be created and place in the current working directory. The definition looks like this.
CREATE TABLE author ( last_name CHAR(13) UNIQUE KEY NOT NULL, full_name CHAR(25) DEFAULT "" NOT NULL, gender CHAR(1) DEFAULT "" NOT NULL, yr_born INT16 DEFAULT 0 NOT NULL, yr_died INT16 DEFAULT 0 NOT NULL, short_bio CHAR(216) DEFAULT "" NOT NULL, CONSTRAINT yob_gender_key KEY ( yr_born ASC, gender ASC ) );
Modify legacy RDM source code to use the new struct definitions
If you have sed installed, you can modify a legacy RDM source file 'mySource.c' to use the new struct definitions for bookshop.ddl
as follows:
$ rdm-convert --sed bookshop.ddl $ sed -I -f bookshop.sed mySource.c