header

AMGA data types

The AMGA metadata server supports a set of generic datatypes for all the possible backends. It is guaranteed that if you add an attribute of with one of these types that it is translated into a type supported by the database. AMGA also guarantees that a listattr command will return the same data type.

Other datatypes supported by a given back end can be used, however they will be not portable and it is not guaranteed that listattr will return the type you specified with addattr.

The following table lists the generic metadata data types supported by AMGA and their internal representation in the back ends:

PostgreSQL MySQL Oracle SQLite Python
intinteger int number(38) int int
floatdouble precision double precision float float float
varchar(n)character varying(n) character varying(n) varchar2(n) varchar(n) string
timestamptimestamp w/o TZ datetime timestamp(6) unsupported time (unsupp.)
texttext text long text string
numeric(p,s)numeric(p,s) numeric(p,s) numeric(p,s) numeric(p,s) float

The datatypes have the following properties:

Note that SQLite not really has a strong typing system. SQLite is in fact typeless, so you can try to store anything into a given column, although internally it distinguishes between text strings and 64 bit double precision values. A column is of type text if the column type contains any of the following substrings: BLOB, CHAR, CLOB, TEXT.

The pure Python back end distinguishes strings, floats (64 bit), integers (64 bit) and timestamps.

Both pure python and SQLite will accept any type and guarantee you that the same type is returned by listattr with the default datatypes being numeric and string respectively.


Generated on Mon Apr 16 13:59:18 2012 for AMGA by  doxygen 1.4.7