Description updated 23-Feb-2022
The AIO SQLite3 for GMS contains multiple functions to work with SQLite3 DBs. The goal of this extension is to simplify the workflow on connecting to a SQLite3 DB and performing CRUD (Create, Read, Update, Delete) operations. Tested for the latest version of GMS.
MANUAL
You can see the manual for any of the published versions from this link
CURRENTLY SUPPORTED PLATFORMS
For additional support don't hesitate to contact me at [email protected] with the subject: "[AIO SQLite3 for GMS] your topic where you need help"
FUNCTIONS INCLUDED IN THE EXTENSION
The functions included in the extension are:
EXAMPLE CODE
A basic example to perform a SELECT statement to a database located at the directory "C:/Users/aleja/Desktop/DLLTest/test.db", to the table "PERSON" and print all its returned values to the output console of GMS can be seen below:
if(f_AIO_SQLite3_testExtConnection()){//If the extension loaded OK.
var _DBHandle=f_AIO_SQLite3_DBOpen("C:/Users/aleja/Desktop/DLLTest/test.db",true);//Open a DB in a path in read only mode.
if(_DBHandle>=0){//If connection with DB ok.
var _SQLString="SELECT * FROM PERSON ORDER BY ID;";//The SQL statement to be evaluated.
var _RSHandle=f_AIO_SQLite3_RSOpen(_DBHandle,_SQLString);//Get the RS.
if(is_struct(_RSHandle)){//A RS was returned.
if(_RSHandle.records>0){//If we have records in our RS.
//Get column names.
for(var i=0;i<_RSHandle.columns;i++){//Loop through all the columns of the RS.
show_debug_message("COLUMN "+string(i)+ ": "+string(_RSHandle.columnNames[i]));//Show a debug message of all column names in the recordset.
}
//Get RS data.
for(var i=0;i<_RSHandle.records;i++){//Loop through all the records of the RS.
f_AIO_SQLite3_RSMove(_RSHandle);//Move the recordset.
for(var j=0;j<_RSHandle.columns;j++){//Loop through all the columns of the RS.
show_debug_message("RS VAL [ROW "+string(i)+", COL "+string(j)+"]: "+string(f_AIO_SQLite3_ifNull(_RSHandle.columnData[j])));//Show a debug message of the value in the RS. If a value is '(NULL)' change it to '"'.
}
}
}
f_AIO_SQLite3_RSClose(_RSHandle);//Close the RS (and perform memory free operations).
}else{//There was some error getting the Recordset
show_debug_message("RS FAILED");//Show a debug message.
}
f_AIO_SQLite3_DBClose(_DBHandle);//Close the DB conn (and perform memory free operations).
}else{//Error connecting with the DB
show_debug_message("DB CONN FAILED");//Show a debug message.
}
}else{//The extension failed to load
show_debug_message("THE EXTENSION FAILED TO LOAD");//Show a debug message.
}
End User Licence Agreement (EULA).
Included manual. It can be seen from the included files.