Releases: intercept/intercept-database
1.5.2
Update Intercept again for compatibility with 2.13/2.14 game update.
Update Mariadb connector version
Fix missing mariadb plugins from last update
Edit: !!! I did a stoopy and put intercept_x64.dll into the zip. Don't use that, use https://steamcommunity.com/workshop/filedetails/?id=1645973522 instead, which contains the latest dll and is being kept up-to-date.
1.5.1
1.5
Fixed binding null values on async query not working
Fixed handling of null values in result (would show the previous value of same column in a row where value is null)
Better handling and error reporting for bindValues (Throws error if invalid type was passed, and automatically converts array to string internally)
Added dbNull type (https://intercept-database.readthedocs.io/en/latest/api/results.html#dbnull)
1.4
Added blob support for dbToParsedArray
Added ability to bind null values (nil/objNull/ctrlNull/whateverNull binds to null SQL value)
Fixed ToParsedArray not properly parsing quoted strings
Added parseDateType config option
Added parseTinyintAsBool config option
Added ability to specify per-statement config options
Added dbGetBoundValues command
1.3
1.2
Fixed crash if number of provided bind values doesn't match expected number (now throws script error)
Fixed crash on race condition in async queries (async queries randomly crashed arma)
Fixed TEXT types being ignored in results
Fixed crash on DATETIME with null value (in general null values will now be better supported, return "NULL" now)
1.1
Fixed dbPing crashing the game (soooorry that it took so long :D)
Added error handling in lots of places, some invalid things now throw script errors like normal SQF commands would do too.
Added config option to disable creating queries in scripts, meaning you can only load statements from config if it's enabled
Added dbLoadSchema command which executes a sql file which can be defined in config.
1.0
Fixed force crash on failed query
If a async query failed the code would debugbreak instead of logging the error
RC4
New stuff:
dbCreateConnection "configname"
dbPrepareQueryConfig "configname"
dbPrepareQueryConfig ["configname", [binding1, binding2, ...]]
dbPrepareQuery ["INSERT ....", [binding1, binding2, ...]]
dbReloadConfig
accounts:
maindb: #production db, don't break things here!
ip: 127.0.0.1
username: root
password: lulz
database: production
port: 3306 #optional
testdb: #testserver
ip: 127.0.0.2
username: root
password: lulz
database: production
port: 3306 #optional
statements:
insertStuff: INSERT INTO table (a,b,c) VALUES (?,?,?)
deleteStuff: DELETE FROM table WHERE a=?
_connection = dbCreateConnection "testdb";
_query = dbPrepareQueryConfig ["deleteStuff", [15]];
_connection dbExecuteAsync _query;
All commands renamed from db_stuff to dbStuff
db_query renamed to dbExecute
DB_Connection = dbCreateConnection ["ip", 3306, "user", "password", "db"];
_query = dbPrepareQuery 'SELECT intel_missionen.`name` FROM intel_missionen WHERE intel_missionen.id > ?';
_query dbBindValue 400;
_result = DB_Connection dbExecuteAsync _query;
_result db_bindCallback [{
params ["_result", "_args"];
DB_RES = [dbResultToArray _result, _args];
systemChat "got result!";
}, 1];
DB_Connection = dbCeateConnection ["ip", 3306, "user", "password", "db"];
[] spawn {
Sleep 5;
_query = dbPrepareQuery 'SELECT intel_missionen.`name` FROM intel_missionen WHERE intel_missionen.id > ?';
_query dbBindValue 400;
_start = diag_tickTime;
_result = DB_Connection dbExecute _query;
systemChat str ["got result!", diag_tickTime - _start];
DB_RES = [dbResultToArray _result];
};