ExternalDatabase

Last updated: Mar 5th, 2018

Introduction

The ExternalDatabase system operation provides the developer the option of connecting to an external SQL database, and obtaining data.

var database = new ExternalDatabase;

Properties

host

Type: string

The host IP address of the external SQL database.

port

Type: integer

The port of the external SQL database.

username

Type: string

The username of the user that has proper authorization access to the external SQL database.

password

Type: string

The password of the user that has proper authorization access to the external SQL database.

database

Type: string

The database property refers to the name of the database. The Cuneiform platform allows developers to create as many internal databases as they need.

query

Type: string

The database query that is to be executed. This should be provided as a SQL query in the form of a string.

Operations

connect

Return type: integer

Makes a connection to the database after a value for database is provided.

Returns 1 if the database connection is successful, 0 is unsuccessful.

disconnect

Return type: integer

Disconnects from the database if a connection has been established earlier.

Returns 1 if the disconnection is successful, 0 is unsuccessful.

executeQuery

Return type: nested array

Obtains the query value provided for the query property and executes the SQL query.

Each element in the parent array corresponds to a row obtained from the query. Each of these elements (child array) correspond to a column in the row. Returns an empty array if no results are found.

What's next?

The next part discusses the implementation of the HTTP system operation.