Jump to content
torndeco

extDB (arma3 extension linux/windows)

Recommended Posts

https://forums.bistudio.com/topic/169723-extdb-arma3-extension-linuxwindows/?p=3014213
https://forums.bistudio.com/topic/169723-extdb-arma3-extension-linuxwindows/?p=3017270

There are plenty of people that have extDB2 forked on github or have the binaries i.e
A3Wasteland Release Files / Exile Release Files and then all the github forks etc...

Also it really is not much work to recode SQF from extDB2->extDB3.
There is just a bit of work if you had SQL_CUSTOM_V2 before with custom inputs.

------------------------------------------------------
As for why a new extDB3
It had to be rewritten so i could change the license, plus it was something i been meaning todo for awhile.

Improvements include 
Its faster / less memory allocations / leaner / better error checking for SQL_CUSTOM / better support for Datatypes.
Actually now supports normal SQL, so you can call Procedures.
Plus the ability to unlock & reset the extension, makes testing / reloading SQL_CUSTOM in the editor possible.

------------------------------------------------------
As for linux i need to setup a linux machine, setup a build enviroment & compile & test.
Meant to start today but i got distracted with other stuff *shrugs*

Share this post


Link to post
Share on other sites

https://forums.bistudio.com/topic/169723-extdb-arma3-extension-linuxwindows/?p=3014213

https://forums.bistudio.com/topic/169723-extdb-arma3-extension-linuxwindows/?p=3017270

There are plenty of people that have extDB2 forked on github or have the binaries i.e

A3Wasteland Release Files / Exile Release Files and then all the github forks etc...

Also it really is not much work to recode SQF from extDB2->extDB3.

There is just a bit of work if you had SQL_CUSTOM_V2 before with custom inputs.

------------------------------------------------------

As for why a new extDB3

It had to be rewritten so i could change the license, plus it was something i been meaning todo for awhile.

Improvements include 

Its faster / less memory allocations / leaner / better error checking for SQL_CUSTOM / better support for Datatypes.

Actually now supports normal SQL, so you can call Procedures.

Plus the ability to unlock & reset the extension, makes testing / reloading SQL_CUSTOM in the editor possible.

------------------------------------------------------

As for linux i need to setup a linux machine, setup a build enviroment & compile & test.

Meant to start today but i got distracted with other stuff *shrugs*

 

Oh I see, didn't really realize that. But yea nice work, really love it. All though I'd love a bit better documentation for the plugin. But hey, let me know when you've got a linux build?

 

Cheers buddy!

Share this post


Link to post
Share on other sites

Hi ! I would like to use extdb for my mission but I don't understand how it works. I mean I created a .ini test file etc but it doesn't seem to work. Anybody could explain me how i could use it ? Sorry I'm not so good with mission making !

 

Thank's !

Share this post


Link to post
Share on other sites
Guest

How do i do that SQL statement?

SELECT name, id FROM players WHERE id IN (1,7,9,10,15) ORDER BY name ASC

The variable part is "(1,7,9,10,15)".
name is string.
id is integer
 
Thankyou in advance.
 
My try:
I had run it as a RAW SQL, the result was that:
[1,[[Aaron,5],[Clarck,7],[Duncan,3],[Jonathan,10]]]
Can i have a result like that?
[1,[["Aaron",5],["Clarck",7],["Duncan",3],["Jonathan",10]]]

 

SOLVED!

Thankyou! Found the solution:

Still using RAW SQL. I changed the field name from varchar(120) to tinytext and enabled TEXT in the RAW SQL Protocol!

Share this post


Link to post
Share on other sites

@Torndeco

 

You may wanna check "9:LOCK:<code>" cause im able to Unlock with it if i use the correct code.

This happens in 1.007 and maybe started atleast somewhere around 1.004 if not right after the UNLOCK fix.

 

Logfile (a bit shortend) created with Debug.dll:

extDB3: https://bitbucket.org/torndeco/extdb3/wiki/Home
extDB3: Version: 1.007
extDB3: Windows Debug Version
---
extDB3: Found extdb3-conf.ini
extDB3: Detected 8 Cores, Setting up 6 Worker Threads
extDB3: ...
extDB3: ...
extDB3: ...
extDB3: ...
extDB3: ...
extDB3: ...
---
[13:55:06:593743 +02:00] [Thread 1884] extDB3: Input from Server: 9:VERSION
[13:55:06:593743 +02:00] [Thread 1884] extDB3: Output to Server: 1.007
[13:56:04:369047 +02:00] [Thread 1884] extDB3: Input from Server: 9:VERSION
[13:56:04:369047 +02:00] [Thread 1884] extDB3: Output to Server: 1.007
[13:56:20:472968 +02:00] [Thread 1884] extDB3: Input from Server: 9:LOCK_STATUS
[13:56:20:472968 +02:00] [Thread 1884] extDB3: Output to Server: [0]
[13:56:20:472968 +02:00] [Thread 1884] extDB3: Input from Server: 9:ADD_DATABASE:DB_1:DBA_197_769_814
[13:56:20:477969 +02:00] [Thread 1884] extDB3: Output to Server: [1]
[13:56:20:478969 +02:00] [Thread 1884] extDB3: Input from Server: 9:ADD_DATABASE_PROTOCOL:DBA_197_769_814:SQL:SQL_451_707_278:TEXT
[13:56:20:478969 +02:00] [Thread 1884] extDB3: SQL: Initialized: Add Quotes around TEXT Datatypes mode: 1
[13:56:20:478969 +02:00] [Thread 1884] extDB3: SQL: Initialized: NULL = ""
[13:56:20:478969 +02:00] [Thread 1884] extDB3: Output to Server: [1]
[13:56:20:478969 +02:00] [Thread 1884] extDB3: Input from Server: 9:LOCK:ULC_883_308_344
[13:56:20:478969 +02:00] [Thread 1884] extDB3: Locked
[13:56:20:478969 +02:00] [Thread 1884] extDB3: Output to Server: [1]
[13:56:44:695354 +02:00] [Thread 1884] extDB3: Input from Server: 9:LOCK_STATUS
[13:56:44:695354 +02:00] [Thread 1884] extDB3: Output to Server: [1]
[13:57:03:629437 +02:00] [Thread 1884] extDB3: Input from Server: 9:LOCK:ULC_883_308_344
[13:57:03:629437 +02:00] [Thread 1884] extDB3: Output to Server: [1]
[13:57:12:216928 +02:00] [Thread 1884] extDB3: Input from Server: 9:LOCK_STATUS
[13:57:12:216928 +02:00] [Thread 1884] extDB3: Output to Server: [0]

 

(Sorry for not posting this on Bitbucket i will try to post issues over there in future.)

Share this post


Link to post
Share on other sites

New version uploaded at https://bitbucket.org/torndeco/extdb3/downloads

 

  • Updated mariadb-c-connector
  • Fixed:   9:RESET bug
  • Fixed:   SQL_Custom: BEGUID
  • Fixed:   SQL_Custom: Return InsertID
  • Fixed:   SQL_Custom: When re-using an input value


Outstanding Issue
SQL_CUSTOM: Multiple SQL Statements support isn't implemented yet (oversight)
i.e  

SQL1_1  Select ...... 
SQL2_1  Update .....

------------------------

If you encounter a bug please sent a database snapshot so i quickly re-create the bug  thanks.

  • Like 1

Share this post


Link to post
Share on other sites

Good morning,

 

sorry if my post is out of topic :-)

I'm looking for a simple step by step tutorial or example files for how to use extDB with SQF. I find a loot of stuff like "integrate gear safe in altis life" etc. but not a simple beginners tutorial. I'm a developer so i have no problem with SQL querys and other stuff  but i am completly new on scripting with SQF.

 

Thank you in advance for your response

Share this post


Link to post
Share on other sites

Good morning,

 

sorry if my post is out of topic :-)

I'm looking for a simple step by step tutorial or example files for how to use extDB with SQF. I find a loot of stuff like "integrate gear safe in altis life" etc. but not a simple beginners tutorial. I'm a developer so i have no problem with SQL querys and other stuff  but i am completly new on scripting with SQF.

 

Thank you in advance for your response

 

There isn't really a tutorial on how to use ExtDB3, but the best way of learning how to use ExtDB3 is looking at the Wiki provided by Torndeco here

 

Here is a list of the current ExtDB3 commands you can use when calling the ExtDB3 extension.

 

Most of the time ExtDB uses something called a protocol to send a pre-set query code to the database, these are stored in the sql_custom.ini or similar file, examples are located here.

 

When using ExtDB you need to also make sure, whatever you're executing is running via the correct call type, which can be located in this section of Torndeco's post here

 

Sorry I couldn't be much of a help, again, there isn't much of a tutorial on coding for ExtDB3, just look around at examples (Exile, Altis Life, Epoch etc)

Share this post


Link to post
Share on other sites
Guest

You can get some mod that use extDB and take a look in it as a working example. Not only this, but this is one more help.

Share this post


Link to post
Share on other sites

Want to upgrade my framework from extDB2, any compatibility issues or changes I need to be aware of? (or would you advice sticking with v2 for a bit still?)

 

As always, thanks for taking time to maintain this!

Share this post


Link to post
Share on other sites

Outstanding issues are

  • Multiline support  SQL1_1  SQL2_1 SQL3_1  etc
  • Linux Builds
  • Check calling Procedures works


Been busy with other things lately, hopefully will get the first 2 issues listed done this week
 

  • Like 2

Share this post


Link to post
Share on other sites

Outstanding issues are

  • Multiline support  SQL1_1  SQL2_1 SQL3_1  etc
  • Linux Builds
  • Check calling Procedures works

Been busy with other things lately, hopefully will get the first 2 issues listed done this week

 

 

Legend! No pressure though :)

Share this post


Link to post
Share on other sites

Outstanding issues are

  • Multiline support  SQL1_1  SQL2_1 SQL3_1  etc
  • Linux Builds
  • Check calling Procedures works

Been busy with other things lately, hopefully will get the first 2 issues listed done this week

 

 

Getting my hands on the Linux build would be great!

Thank you for your time and effort.

Share this post


Link to post
Share on other sites

Is it possible to setup extDB3 in the eden editor? cause when i try to get the version with "extDB3" callExtension "9:VERSION" i only get an "" as result....

Also i want to ask if its better to have the sql database scripts in the mission (for all) or in an extra mod / addon only for the server?

Share this post


Link to post
Share on other sites

New version uploaded at https://bitbucket.org/torndeco/extdb3/downloads

 

  • Updated mariadb-c-connector
  • Fixed:   SQL_Custom: BEGUID
  • Fixed:   SQL_Custom: mysql_escape (only used for RAW SQL)
  • Fixed:   SQL_Custom: Multi-line Support i.e SQL1_1 SQL2_1
  • Improved: SQL_Custom Performance

Outstanding Issue
SQL_CUSTOM: Raw SQL Missing Support for Output Options (Input Options are working)

------------------------

No Linux Builds Yet, will look at starting work on it tomorrow if i get time. Only got a really slow laptop atm to test linux builds on. 
So its kinda a pain to test / compile on atm

If you encounter a bug please sent a database snapshot so i quickly re-create the bug  thanks.

  • Like 3

Share this post


Link to post
Share on other sites

Version 1.010
https://bitbucket.org/torndeco/extdb3/downloads

 

Changelog

  • SQL_CUSTOM: Non Prepared Statements
          Fixed $CUSTOM_x$
          Fixed Input/Output Options
          Added Exception Handling
  • MariaDB C Connector Updated: Performance Increase

 

Note:
If you are using Procedures in SQL_CUSTOM, remember to use Prepared Statement = false

 

extDB3 should now is on par or better than extDB2 support for MariaDB/MySQL Database Queries etc...
Plus it has cleaner SQL_CUSTOM file and better error catching when parsing the .ini file aswell.
Linux Builds might have done later / tomorrow.

If you encounter a bug please sent a database snapshot so it is alot quicker for me to recreate the bug  thanks.

Share this post


Link to post
Share on other sites

Hello and thanks for this addon!

 

I have been trying alot of things to make this work but no matter what i try i get this in my rpt log:

 8:37:20 "---------------------------------------------------------------------"
 8:37:20 "---------------------------------------------------------------------"
 8:37:20 "extDB3 Failed to Load, Check Requirements @ https://bitbucket.org/torndeco/extdb3/wiki/Installation"
 8:37:20 ""
 8:37:20 "If you are running this on a client, Battleye will random block extensions. Try Disable Battleye"
 8:37:20 "---------------------------------------------------------------------"
 8:37:20 "---------------------------------------------------------------------"

What i am been doing:
Placed the @extDB3 folder in my Arma 3 directory (In my case: D:\Games\Steam\SteamApps\common\Arma 3\@extDB3) with extdb3-conf.ini and the .dll and 3 folders inside. (4 files and 6 folders) and i editted the config to my needs and loaded the mod when starting up. In my rpt i can see the mod is loaded with the other mods arma loads when starting. Running it from windows.

 

I have a running and working mariadb server running to connect to, it runs other databases so its confirmed working - I have no logs in the @extdb3/logs directory either.

 

 

extdb3-conf.ini:

[Main]
Version = 1

Randomize Config File = false
;; Randomizes Config File after loading.
;;   Recommend to turn on, if you have enabled filepatching on arma.

Allow Reset = false
;; Allows 9:RESET, usefull for development work

Thread = 2;
;; Option to force number of worker threads for extDB3.
;;   Min = 2, Max = 6

[Log]
Flush = true;
;; Flush logfile after each update.
;;    Option really only usefull if running DEBUG BUILD


[Database]
IP = 37.139.21.232
Port = 3306
Username = arma3
Password =  ******
Database = arma3

Am i doing something totally wrong?

Share this post


Link to post
Share on other sites

You either have dlls blocks / or didn't copy the tbbmalloc.dll to your arma3 root directory.
Or you have BattlEye turned on & its blocking the extension.
Or you didn't install the ---------> 32bit <------- version of vc2015 redist.

There really is no otherway you could have messed up.
 

Share this post


Link to post
Share on other sites

Battleye was blocking it, sorry.. Must admit i can find too little information about using extdb3 around, so i'll give it a try sometime over the winter i guess :-)

 

You either have dlls blocks / or didn't copy the tbbmalloc.dll to your arma3 root directory.
Or you have BattlEye turned on & its blocking the extension.
Or you didn't install the ---------> 32bit <------- version of vc2015 redist.

There really is no otherway you could have messed up.
 

 

Share this post


Link to post
Share on other sites

@DeeJay86
You wont find much inregards how to use extDB3 specfically.
Mainly because its made to be flexible, there are multiple ways you can implement / use it in SQF.

But it does help if you have some previous knowledge of SQL Queries.

You can look at other implements like
https://forums.bistudio.com/topic/184027-spmc-supremacy-framework-v052-august-20th-2016-multiplayer-sandbox-framework/
or other implements using extDB2 (very similiar) like Altis Life / A3Wasteland / Exile etc

Share this post


Link to post
Share on other sites

@torndeco

I can't seem to be able to download any compiled versions, none of them, only the source.

Is this an issue for anyone else or am I just missing something obvious?

 

All I'm getting is this, no matter which .7z:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>E9280C7CD7241620</RequestId>
<HostId>
S6+T9SkIshRogk384XjwvzFj9oc026DL/kMR6nFCo3OraLCr7qsJVXcUqjblh77HDJd3Lho5Gnc=
</HostId>
</Error>

 

Edit: Got a friend to try it, no go for him too. Tried with both Chrome and Edge.

 

Edit 2: Disregard, it's working again.

Edited by mrcurry
  • Like 1

Share this post


Link to post
Share on other sites

Version 1.013
https://bitbucket.org/torndeco/extdb3/downloads

 

Changelog

  • Improved Handling when Database Connection is lost
  • Added 9:UPTIME:HOURS / 9:UPTIME:MINUTES / 9:UPTIME:SECONDS
  • MariaDB C Connector Updated

 

Changelog SQL_CUSTOM

  • Added: add_escape_quotes
  • Added: remove_escape_quotes
  • Removed: string_escape_quotes
  • Removed: string_escape_quotes2

----------------------------------------------------------------------

Arma 1.64 will now escape quotations automatically ;)
I have added & removed some options to SQL_CUSTOM.
So people can add/remove these escape quotations.

Note: extDB3 will complain on trying to load sql_custom ini file if there any unknown options :)

Short version you just need any change any occurances of

string_escape_quotes -> string-add_escape_quotes
string_escape_quotes2 -> string2-add_escape_quotes

More Info of sql_custom ini options @ https://bitbucket.org/torndeco/extdb3/wiki/extDB3%20-%20sql_custom.ini

 

 

Note:
If you are compiling from source, use https://github.com/MariaDB/mariadb-connector-c/tree/fbf6fd1598914801414b0b0a7f2a169b0506dc4c 
Later versions are broken due to shared memory changes on windows, haven't had time to look into it.

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×