STANDARD FUNCTIONS
(MySQL crypto functions)
ConnectToMySQL(Address, Port, Dartabase, User, Password)
- Address – String;
- Port – Integer as string;
- Database – Srting;
- User – String;
- Password – String.
Note: In this function, the address and port are the address (IP address or URL) and port of the MySQL server.
Example:
REST Crypto Server (RCS)
- IP address or URL - 192.168.1.2
- REST Server port - 8080
- DS Context - eoquant
- REST Context - rest
- Server methods - TMaster
- Server function - ConnectToMySQL
MySQL Server
- My SQL server IP address - 100.100.100.100
- MySQL server port - 3306
- Database name - MyDB
- MySQL Username - UserName
- MySQL Password - MyPassword
IMPORTANT!
REST server and MySQL server parameters are conditional.
When working with REST Crypto Server (RCS), it is necessary to replace them with real ones. Otherwise, the expected results will not be obtained.
Query:
192.168.1.2:8080/eoquant/rest/TMaster/ConnectToMySQL/100.100.100.100/3306/MyDB/UserName/MyPassword
Result:
{"result":[true]}

DisconnectFromMySQLDatabase(UserName, Password)
- UserName – String;
- Password – String.
Example:
192.168.1.2:8080/eoquant/rest/TMaster/DisconnectFromMySQLDatabase/UserName/MyPassword
Result:
{"result":[true]}
SetCryptoMode(EncryptionId)
EncryptionId's code is of Word type. Depending on the set REST, the server activates the execution of the following cryptographic functions as follows:
- StrongDecryption - EncryptionId = 1;
- StrongEncryption - EncryptionId = 2;
- Encryption and decryption (default) - EncryptionId = 3.
Note: It is recommended to use the default encryption method. In a number of cases, this function is used when encryption is done using Database Encryption System (DES), and the user works only with an encrypted database.
Example:
EncryptionId = 3.
192.168.1.2:8080/eoquant/rest/TMaster/SetCryptoMode/3
Result:

ExecuteQuery(Query)
Query – String.
Example:
Input data:
- IP address or URL - 192.168.1.2
- REST Server port - 8080
- DS Context - eoquant
- REST Context - rest
- Server methods - TMaster
- Server function - ExecuteQuery
- Query - SELECT * FROM cargus_cities LIMIT 20
Result query string:
192.168.1.2:8080/eoquant/rest/TMaster/ExecuteQuery/SELECT * FROM cargus_cities LIMIT 20
Result:

ResultAsJSON(Query)
Example:
192.168.1.2:8080/eoquant/rest/TMaster/ResultAsJSON/SELECT * FROM cargus_cities LIMIT 20
Result:

ResultAsText(Query)
Example:
192.168.1.2:8080/eoquant/rest/TMaster/ResultAsText/SELECT * FROM cargus_cities LIMIT 20
Result:

ResultAsHTM(Query)
Example:
192.168.1.2:8080/eoquant/rest/TMaster/ResultAsHTM/SELECT * FROM cargus_cities LIMIT 20
Result:

ResultAsTextTable (Query)
- Query – String;
- ColumnsWidth - Integer.
Example:
192.168.1.2:8080/eoquant/rest/TMaster/ResultAsHTM/SELECT * FROM cargus_cities LIMIT 20/50

ResultAsCSV (Query)
- Query – String.
- Delimiter - String;
- Enclosure - String;
- Header - Boolean.
Example:
Input data:
- IP address or URL - 192.168.1.2
- REST Server port - 8080
- DS Context - eoquant
- REST Context - rest
- Server methods - TMaster
- Server function - ResultAsCSV
- Query - SELECT * FROM cargus_cities LIMIT 20
- Delimiter - |;
- Enclosure - -;
- Header - TRUE.
Result query string:
192.168.1.2:8080/eoquant/rest/TMaster/ResultAsCSV/SELECT * FROM cargus_cities LIMIT 20/|/-/TRUE
Result:

In addition to the standard functions, there is also a large set of specialized ones.
You can find more information about them in the official documentation.
Example:
ResultAsJSONExt (Query, EncodingType, Format, DecodeStatus)
Specifies what code table will be used when displaying the content of the result of the query execution. For example:
Content Type: text/plain; charset=utf-8
or
Content Type: application/json; charset=utf-8
Result query string:
192.168.1.2:8080/eoquant/rest/TMaster/ResultAsJSONExt/SELECT * FROM cargus_cities LIMIT 20/0/1/2