Discussion of article "SQLite: Native handling of SQL databases in MQL5" - page 6

 
In which folder do you expect to find it? Look carefully at the opening flags
 
Rashid Umarov:
In which folder do you expect to find it? Look carefully at the opening flags

Here are the flags - int db=DatabaseOpen(filename, DATABASE_OPEN_READWRITE | DATABASE_OPEN_CREATE | DATABASE_OPEN_COMMON);

I expect to see it according to the help in the MQL5/Files package.

But there is nothing there

 
Rashid Umarov:
In which folder do you expect to find it? Take a close look at the opening flags

I made a video of me doing this. Maybe something's wrong....



 
Tango_X:

Here are the flags - int db=DatabaseOpen(filename, DATABASE_OPEN_READWRITE | DATABASE_OPEN_CREATE |DATABASE_OPEN_COMMON);

I expect to see according to the help in the MQL5/Files package

But there is nothing there

DATABASE_OPEN_COMMON is not where you are looking for it.


 
Alexey Viktorov:

DATABASE_OPEN_COMMON is not where you are looking for it.


thank you!

 

Dear developers, good day to all!

I VERY much like the use of SQLite in MT5, as I am penetrated by all the advantages of this innovation, I would like to add....p.1 ))))

1. It is possible to add support for JSON functions inside queries, from the side of SQLite this feature has been implemented for quite a long time and I actively use it in other programmes..., and I would like to use it in MT5, because:

1.1 It is very convenient, parsing and collecting JSON works out of the box very quickly

1.2 No need to use third-party libraries to build and disassemble responses

1.3 Ability to save data in batches and process on the base side by SQL query

1.4 If the server response has changed or in some other case, it is enough to change the SQL query and not to recompile the programme and

this is only part of the advantages...which are not present in the current implementation for MT5, I assume that an old version of SQLite is connected to MT5....

In general this gives a lot of opportunities for large projects to scale in multi-server systems where each data provider has its own structures, etc..



2. Read previous posts on the topic of one-time access for both writing and reading from the database....

I personally recommend and use: PRAGMA journal_mode = WAL;

this solves a lot of problems with database multi-access and increases the seriousness of SQLite...

2.1 It is better to create the database from a pre-prepared text file with SQL code attached to the project as a resource and use it as a variable string

2.2 It is also convenient to create all queries as resource files, and if you need to change data in a query, you can use StringFormat...


3. In each of my large projects I try to use the current mechanism of interaction between MT5 and SQLite, it became very convenient to work with data, a BIG THANK YOU!

 
Daniil Kurmyshev:

Dear developers, good day to all!

I VERY like the use of SQLite in MT5, as I am penetrated by all the advantages of this innovation, I would like to add....p.1 ))).

1. It is possible to add support for JSON functions inside queries, from the side of SQLite this feature has been implemented for quite a long time and I actively use it in other programmes..., and I would like to add it in MT5 as well:

1.1 It is very convenient, parsing and collecting JSON works out of the box very quickly

1.2 No need to use third-party libraries to build and disassemble responses

1.3 Ability to save data in batches and process on the base side by SQL query

1.4 If the server response has changed or in some other case, it is enough to change the SQL query and not recompile the programme and

this is only part of the advantages...which are not present in the current implementation for MT5, I assume that an old version of SQLite is connected to MT5....

In general it gives a lot of opportunities for large projects to scale them in multi-server systems where each data provider has its own structures, etc...



2. I have read previous posts on the topic of one-time access for both writing and reading from the database....

I personally recommend and use: PRAGMA journal_mode = WAL;

this solves a lot of problems with multi-access to the database and increases the seriousness of SQLite...

2.1 It is better to create a database from a pre-prepared text file with SQL code attached to the project as a resource and use it as a variable string

2.2 It is also convenient to create all queries as resource files, and if you need to change data in a query, you can use StringFormat...


3. In each of my large projects I try to use the current mechanism of interaction between MT5 and SQLite, it became very convenient to work with data, a BIG THANK YOU!

Of course, it would be nice to give the possibility of simultaneous access to the database to different scripts. The developers didn't think about it (((.

Apparently, they do not want to further develop MQL5 tools.

 
GEORGI ANIKIN:

It would be nice to give the possibility of simultaneous access to the database to different scripts. The developers didn't think about it ((

Apparently, they do not want to further develop MQL5 tools.

Of course they have thought about it.

You can access the same bases and tables from different scripts inside the terminal.

Here is an example of a simultaneous writer and reader. Run it on different charts.

Files:
 
Renat Fatkhullin:

Of course we did.

You can access the same databases and tables from different scripts inside the terminal.

Here's an example of a simultaneous writer and reader. Run it on different charts.

Renat, hello!

Can you tell me if the possibility of storing JSON in the database and working with it will be implemented, at least in the near future?

 
Daniil Kurmyshev:

Renat, hello!

Can you tell me if the ability to store JSON in the database and work with it will be implemented, at least in the near future?

It will be in beta 2840 tomorrow:

  • SQLite version 2.35.2

  • permanent WAL mode, allowing to work with the open database from different applications (previously MetaEditor could not work in parallel with the terminal)

  • extension of statistical functions
        mode - mode,
        median - median (50 th percentile),
        percentile_25 - 25 th percentile,
        percentile_75 - 75 th percentile,
        percentile_90 - 90 th percentile,
        percentile_95 - 95 th percentile,
        percentile_99 - 99 th percentile,
        stddev or stddev_samp - sample standard deviation,
        stddev_pop - population standard deviation,
        variance or var_samp - sample variance,
        var_pop - population variance.
    example:
    select
      count(*) as book_count,
      cast(avg(parent) as integer) as mean,
      cast(median(parent) as integer) as median,
      mode(parent) as mode,
      percentile_90(parent) as p90,
      percentile_95(parent) as p95,
      percentile_99(parent) as p99
    from bookmarks;
  • new maths functions
        acos(X)
        acosh(X)
        asin(X)
        asinh(X)
        atan(X)
        atan2(X,Y)
        atanh(X)
        ceil(X)
        ceiling(X)
        cos(X)
        cosh(X)
        degrees(X)
        exp(X)
        floor(X)
        ln(X)
        log(B,X)
        log(X)
        log10(X)
        log2(X)
        mod(X,Y)
        pi()
        pow(X,Y)
        power(X,Y)
        radians(X)
        sin(X)
        sinh(X)
        sqrt(X)
        tan(X)
        tanh(X)
        trunc(X)
    
    
  • JSON support is also included

    We will include new json type in the database creation wizard later.