I found and reposted an archived copy of MetalBase, a C database management system, while researching old DBMSs for dbdb.io. I am not its author, and I do not know what the original license should be.
The MetalBase GitHub repository is described as C, 6 stars, 2 forks; its history is started 2018-05, last updated 2018-05.
I found the source code from 1994 while researching old DBMSs for dbdb.io. I couldn't find it anywhere else so I downloaded a copy of it and am posting it here. I am not the author of this system. I do not know what the original license should be for this code.
MetalBase 5.0 is described as having queries at the same speed as 4.1a, while adds/updates/deletes are always at least twice as fast, and often over three times as fast.
The README attributes the write-operation improvement to internal caching of index pointers. It presents 5.0 as hopefully the final relation format. MBCONV converts older relations, but users should preserve enough free space to make essentially a copy and heed the build instructions’ warning that conversion is irreversible.
MBCONV converts 4.0 and 4.1a relations to 5.0; it requires enough free space to essentially make a copy.
The README says problems could occur if a program shut down during a change unless compiled with -DUNIX_LOCKS on a *nix machine.
For MetalBase 5.0, all indices are written at once; chances of corruption are much smaller.
After a shutdown leaves a system-placed lock in place, the next process detects and removes the lock and decrements the number of users.
The request queue is intended to ensure that processes will always get equal timeshares.
rel = mb_new();
mb_addfield (rel, "Customer's last name", T_CHAR, 15);
mb_addfield (rel, "Customer's first name", T_CHAR, 10);
mb_addfield (rel, "Customer's number", T_SERIAL, 40);
mb_addindex (rel, "ix_name", 1, "0,1");
mb_addindex (rel, "ix_number", 1, "2");
mb_create (rel, "/usr/joe/simple.rel", 0);
The example relation uses fields Customer's last name T_CHAR 15, Customer's first name T_CHAR 10, and Customer's number T_SERIAL 40; it creates indices ix_name on 0,1 and ix_number on 2, then creates /usr/joe/simple.rel.
BUILD and MBCONV both use run-time relation creation.
The schema type "phone" (C typedef == "mb_phone") has been added to 5.0
Phone values accept area codes and extensions up to x99999. The README points to scn_phone() and fmt_phone() for handling phone numbers, analogous to the date and time routines.
Encryption is now working for everyone, even MS-DOS users.
A bad encryption key passed to VR under DOS will usually make you reboot your machine; under *nix it'll usually cause a seg violation.
The documentation covers general, author, schema/compiler/build, encryption, AVL-tree algorithms, relation format, locking, C structure interface, report writer, troubleshooting.
The README says the documentation is still not perfect; it is more up to date than the 4.0 release.
The report-writer documentation is explicitly incomplete. The release does not include debugging trails; the author jokes that he is only allowed to make that mistake once a year.
To build, go to SRC. On *nix, type MAKE; with Microsoft C, use NMAKE -f makefile.dos; for another compiler or platform, choose a makefile and modify it. Compilation runs STRUCT (or STRUCT.EXE), which reports what to change for the compiler. Check the makefile destinations for headers, library, and executables, then run MAKE INSTALL or NMAKE -f makefile.dos INSTALL for Microsoft C.
The build workflow says: Go to the SRC directory.
BLAST removes locks accidentally left on a relation and sets the internal number of users to zero. BUILD compiles relations from schema files and erases all records in a relation. FORM builds header files from data-entry templates. MBCONV converts pre-5.0 relations to 5.0 format. REPORT generates reports from template files interpreted at run time. VR means View Relation.
The DE interface is really, really easy to program.
For 4.0 users, NON-VI emulation is now the default; it's much, MUCH easier to add and change records.
VR keys: CTRL-A and CTRL-return accept a transaction; CTRL-Q and CTRL-C abort a transaction; CTRL-U undoes a change within a field.
SAMPLE is meant to be example code for connecting the suggested data-entry interface and adding, deleting, or changing records; BENCH is a benchmark utility.
In SAMPLE, -DSTRUCT_ is not needed; -DNEED_USHORT is needed if the compiler lacks ushort.
The README says the build uses a makefile selected and edited for the platform. For SAMPLE, the README points to sample/readme for BENCH and advises choosing and editing a makefile. The README describes release behavior and safety claims; it does not establish independent verification of those claims.