Skip to content

Commit

Permalink
Add schema structure description
Browse files Browse the repository at this point in the history
  • Loading branch information
jbecla committed May 29, 2015
1 parent 5742a16 commit a3694ac
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions ddlStructure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<h1>ASCII Schema Structure</h1>

To load database schema with additional information, such as units or ucds, you'd first need to create an ASCII file containing the schema with additional information as described below.

Each DBMS stores stores information about all databases it maintains. The structure of such information is typically fixed, and additional information (for example units) is hard to capture. To overcome this, our DDL loader recognizes special special tags. The tags need to be inserted in appropriate places inside comments. They are optional.

Currently supported tags:
<ul>
<li><b>&lt;descr&gt;</b>: the contents between &lt;descr&gt; and &lt;/descr&gt; will contain description (of a table or a column),
<li><b>&lt;unit&gt;</b>: the contents between &lt;unit&gt; and &lt;/unit&gt; will contain definition of a unit,
<li><b>&lt;ucd&gt;</b>: the contents between &lt;ucd&gt; and &lt;/ucd&gt; will contain ucd value.
</ul>

Multi-lines are allowed for &lt;descr&gt; Examples of a valid multi-line entries:

-- <descr>This is a valid entry.
-- </descr>

-- <descr>This is a
-- valid entry
-- as well.</descr>

-- <descr>
-- So is this.
-- </descr>


<h2>Table Description</h2>

To add a table description, use &lt;descr&gt;&lt;/descr&gt; right after table name, before the opening bracket. Example:

CREATE TABLE MyTable
-- <descr>This is my table.</descr>
(


<h2>Column Description, ucd, units</h2>

To add a column description, use &lt;descr&gt;&lt;/descr&gt;

To add a unit for a given column, use &lt;unit&gt;&lt;/unit&gt;

To add a ucd definition for a given column , use &lt;ucd&gt;&lt;/ucd&gt;

These values should appear right after the column definition, in any order. Example:

ra DOUBLE NOT NULL,
-- <descr>RA-coordinate of the center of this diaObject.</descr>
-- <ucd>stat.error;pos.eq.ra</ucd>
-- <unit>deg</unit>

0 comments on commit a3694ac

Please sign in to comment.