COAPI Data Model
Overview
The fourQ content object API (COAPI) manages the content model by which content types and content instances are managed in the FarCry CMS platform.
FourQ Object Model
Data Access in Farcry is not restricted to one database type only. As connection objects are created via a Gateway Factory farcy should work with any type of db as long as the different gateway components are implemented and derived from Gateway.cfc. The picture below shows a collaboration of components.
Data Types
FourQ uses a series of generic data-types internally that map to specific column data-types depending on the database in question.
data type |
mysql |
mssql |
postgresql |
oracle |
Notes |
---|---|---|---|---|---|
boolean |
int |
[int] |
int |
number(1) |
|
date |
datetime |
[datetime] |
timestamp |
date |
|
integer |
int |
[int] |
integer |
integer |
Added in FarCry 4.x |
numeric |
numeric |
[numeric] |
numeric |
numeric |
|
string |
varchar(255) |
[varchar] (255) |
varchar(255) |
varchar2(255) |
|
nstring |
varchar(255) |
[nvarchar] (255) |
varchar(255) |
nvarchar2(255) |
|
uuid |
varchar(50) |
[varchar] (255) |
varchar(50) |
varchar2(50) |
|
variablename |
varchar(64) |
[varchar] (64) |
varchar(64) |
varchar2(64) |
|
color |
varchar(20) |
[varchar] (20) |
varchar(20) |
varchar2(20) |
|
varchar(255) |
[varchar] (255) |
varchar(255) |
varchar2(255) |
|
|
longchar |
longtext |
[ntext] |
text |
nclob |
|
Oracle Notes
boolean - There is not a boolean type used for table columns. Although, the boolean type can be used with Oracle's PL/SQL database programming language within packages, procedures, and functions, boolean types are not stored in the tables. I guess you would create a column type of number and store 1 or 0 or type char(1)/varchar2(1) with values 'T' or 'F'.
date - Oracle has two types for this, Date and Timestamp. The date type stores date and/or time values with precision in seconds. For example, the date type can store the following values:
2006-01-30 (YYYY-MM-DD)
2006-01-30 06:45:30 (YYYY-MM-DD HH:MI:SS)
The Timestamp type allows precision to fractional seconds as in the following example:
2006-05-11 09:26:50.124
Numeric - Number(p,s): Number having precision p and scale s. The precision p can range from 1 to 38. The scale s can range from -84 to 127 (Oracle docs).
String - varchar2(255)
Nstring - nvarchar2(255)
Uuid - varchar2(255)
Variable name - varchar2(64)
Color - varchar2(20)
Email - varchar2(255)
Longchar - clob or nclob (max size is 4 gigabytes)