Introducing Database Schema (DBS) Files

This article was originally written for Iguana 5 and may contain out of date references.

So this is something we’re keen to get some feedback on. You will need to have Iguana 5.6.8 or above installed to do this.

One of most awkward aspects of using vmds in the translator is for describing database table schemas for use in the db.tables and db.merge functions.

We’ve been thinking about some alternatives. One approach would be to build out an equivalent GUI tool to define, import and export table schema within the translator. But we thought we’d try a different approach using a custom grammar.

You can see an example of this format here in GitHub.

The dbs file can be used much in same manner that the current vmd format can be used. You can see it being used within the main lua module of the example to database channel using it within the Iguana community repository.

Now there are a few things that make this dbs format kind of cool. One of the first things is that it is easy to read with a plain text editor. That makes it easy to diff.

But where it really gets interesting is that it is easy to write scripts that can generate it.

And that’s where it get’s interesting. First of all it’s easy to write scripts in Lua which can import table schema into this format. But other fun stuff is possible like say iterating through an HL7 message schema and generating a bunch of tables based off the segments – quite doable. Only limit is your imagination…

You can get an example channel with this new format called “New DBS File Format Example” in the Iguana community repository and importing it with the Channel Manager (Iguana 5 documentation).

Couple of little disclaimers. There are some pieces we need to do more work on – if you get the format wrong the error messages are not that informative. We’ll probably add some wizards to generate dbs files from existing databases – although the format is so simple it’s not out of the question to write a Lua script that could do that if you felt like it. It’s a little tricky adding a dbs file to an existing translator project – that will become easier later on. Try it out and see what you think. Enjoy!

If you are interested in learning more and asking questions about where this is headed I would recommend subscribing to this forum:


Leave A Comment?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.