|
Documentation Programming With Andromeda Defining a Database
|
Next: Columns and Tables
YAML Syntax PrimerAndromeda does not use commands like CREATE TABLE to build a database. Instead the Andromeda programmer creates a text file that is full of definitions. Some of these definitions are nested inside of other definitions. Andromeda uses a subset of the YAML syntax for its database definitions. This short primer introduces some of the details of the syntax. The more esoteric features are explained where necessary. Definitions and PropertiesEverything in the Andromeda database specification begins with a definition. A definition begins with a keyword, then an identifier, then a colon. Defining the same element more than once causes the 2nd definition to overwrite the first with no error or warning. Any defined item may have properties. For instance, a column will have the "type_id" property, among others. Properties always begin with the property name, a colon, and the value. Specifying the same property more than once causes the 2nd assignment to overwrite the first with no error or warning. The properties of an item are indented. It does not matter how much, so long as the same indentation is used for the properties of any given element. Do not use TAB to indent. You must use spaces or the YAML parser will spit out your file.Here is an example of a couple of definitions with property assignments: # a definition
group ar_mgrs:
# five property assignments
description: AR Managers
permsel: “Y”
permins: “Y”
permupd: “Y”
permdel: “Y”
# Another definition
module ar:
# A property assignment
description: Accounts Receivable
Nested DefinitionsSome definitions only make sense inside of other definitions, such as an index inside of a table. In those cases, you simply increase the indentation level: table orders:
description: Orders
# The following line is a nested definition
index special:
# ...and here is a nested nested definition
column date1:
column date:
Next: Columns and Tables
|
