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;
The database property refers to the name of the database. The Cuneiform platform allows developers to create as many internal databases as they need.
The database query that is to be executed. This should be provided as a SQL query in the form of a string.
Makes a connection to the database after a value for database is provided.
Returns 1 if the database connection is successful, 0 is unsuccessful.
Disconnects from the database if a connection has been established earlier.
Returns 1 if the disconnection is successful, 0 is unsuccessful.
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.
The next part discusses the implementation of the External Database system operation.