BaseGateway

BaseGateway

BaseGateway

This component provides generic database access for the fourq persistence layer of FarCry

Metadata

addIndex()

Deploys the index into a MySQL database.

Arguments

Name Type Required Default Options Description
schema struct Yes
indexname string Yes
logLocation string No

combineResults()

Merges two standard stResult struts (bSuccess,results)

Arguments

Name Type Required Default Options Description
firstResult struct Yes
secondResult struct Yes

createData()

Creates a new row in the db for the given properties

Arguments

Name Type Required Default Options Description
schema struct Yes Type metadata
stProperties struct Yes
logLocation string No

deleteData()

Delete the specified objectid and corresponding data, including array properties and refObjects.

Arguments

Name Type Required Default Options Description
schema struct Yes The type schema
logLocation string No

diffSchema()

Compares type metadata to the actual database schema

Arguments

Name Type Required Default Options Description
schema struct Yes The type schema

dropIndex()

Drops the index from a MySQL database.

Arguments

Name Type Required Default Options Description
schema struct Yes
indexname string Yes
logLocation string No

dropSchema()

Drops the table structure for a FarCry type

Arguments

Name Type Required Default Options Description
schema struct Yes
logLocation string No

getData()

Get data for a specific objectid and return as a structure, including array properties and typename.

Arguments

Name Type Required Default Options Description
schema struct Yes The type metadata
bDepth numeric No 1 0:Everything (with full structs for all array field elements),1:Everything (only extended array field as structs),2:No array fields,3:No array or longchar fields
fields string No Overrides the default fields returned. NOTE: the bDepth field may restrict the list further.

getValueFromDB()

Returns the FarCry value for the specified property metadata and value

Arguments

Name Type Required Default Options Description
schema struct Yes
value any Yes

init()

Initializes the instance data

Arguments

Name Type Required Default Options Description
dsn string Yes
dbowner string Yes
dbtype string Yes

isDeployed()

Returns True if the table is already deployed

Arguments

Name Type Required Default Options Description
schema struct Yes Table schema to check

isFieldAltered()

Returns true if there is a difference

Arguments

Name Type Required Default Options Description
expected struct Yes The expected schema
actual struct Yes The actual schema

logQuery()

Logs specified query result to the specified file

Arguments

Name Type Required Default Options Description
logfile string Yes Log file
queryresult struct Yes Query result variable

repairIndex()

Repairs the index in a MySQL database.

Arguments

Name Type Required Default Options Description
schema struct Yes
indexname string Yes
logLocation string No

setArrayData()

Arguments

Name Type Required Default Options Description
schema struct Yes Type metadata
aProperties array Yes
parentid uuid Yes The parentid of the array property
logLocation string No

setArrayTypenames()

Updates the typenames of a standard array property

Arguments

Name Type Required Default Options Description
tablename struct Yes The table of the array property
parentid uuid Yes The parentid of the array property
logLocation string No

setData()

Performs an UPDATE for the given schema and properties

Arguments

Name Type Required Default Options Description
schema struct Yes Type metadata
stProperties struct Yes
logLocation string No