Title:   Valid datatypes for GNUe Schema Definitions (gsd)
Status:  Current 
Created: 2004-02-18
Revised: 2004-02-24

This technote describes the preferred datatypes for use in GNUe Schema
Definitions (GSD). A GSD file must be UTF-8 encoded.

1. Valid Datatypes 
-------------------

1.1 string
----------
If no length is given, this datatype is meant to be without a restriction in
length. In most cases this would translate to a SQL type like 'text'.

1.1.1 Values
------------
String values must be UTF-8 encoded. This is an implicit rule, since the entire
file must follow this encoding.


1.2 date
--------
This datatype should be used to store only the datepart of a date/time.

1.2.1 Values
------------
A date value must be given in the form 'YYYY-MM-DD' where YYYY stands for the
year, MM for the month and DD for the day.


1.3 time
--------
This datatype should be used to store only the timepart of a date/time.

1.3.1 Values
------------
A time value must be given in the form 'HH:MM:SS' where HH stands for the hour,
MM for the minute and SS for the seconds.


1.4 datetime
------------
Use this datatype if you need both, date and time part of a date/time.

1.4.1 Values
------------
A datetime value must be given in the form 'YYYY-MM-DDTHH:MM:SS' where
YYYY-MM-DD means the 'date'-part and HH:MM:SS means the 'time'-part. Note: the
'T' between both parts is kind of a delimiter.


1.5 number
----------
Number is an alias for all kinds of numeric data. The datatype finally used
depends on the 'precision' and 'length' of the field definition. 

1.5.1 Values
------------
Values consist of numbers (0-9) and a period ('.') as decimal point (if
precision is greater than 0).
                

1.6 boolean
-----------
Use this datatype to store boolean values.

1.6.1 Values
------------
FALSE   False
TRUE    True


1.7 key
-------
This datatype is meant to be a database-independent "key" type, used mainly
for auto-populated primary key fields or their corresponding foreign key 
fields in related tables.  When used with a primary key, usually the field 
is also defined with a defaultwith="serial" attribute. 

1.7.1 Values
------------
Depends on the database.  With most databases, this is a sufficiently large 
integer to handle a large number of rows (e.g., 64 bit integer.)
