InternalDatabase

Last updated: Mar 5th, 2018

Introduction

Cuneiform maintains an internal SQL database. Access to this database, and the ability to perform queries is supported by the programming language. A reference to the InternalDatabase system operation is assigned to a variable as shown below.

var database = new InternalDatabase; 

Properties

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 External Database system operation.