siara-cc / esp32_arduino_sqlite3_lib

Sqlite3 Arduino library for ESP32
Apache License 2.0
350 stars 66 forks source link

UNION or JOINS in views #37

Open tomthemod opened 3 years ago

tomthemod commented 3 years ago

This library is very very helpfull for my projects. But i need to create views with UNION, or LEFT JOIN. When i create a view like "CREATE VIEW view1 AS SELECT id, data AS tbl1 UNION SELECT id, data AS tbl2;" directly from the sqlite3_console example with a database with 2 tables, i've this error : SQL error: 1 parser stack overflow

I've the same error if i create the view in the database from my computer, succesfully test it, and try to use the database from the ESP (esp32)

Is there an option to activate, to do this ?

Thnaks.

siara-cc commented 3 years ago

You could try changing the stack settings in the config file of this library. But I don't this they would work seamlessly given the limited memory available to operate.

tomthemod commented 3 years ago

thanks for your support, you've really made a good job. I've finally reloved my issue with increasing YYSTACKDEPTH in config_ext.h, from 20 to 50. With this value, i can do UNION, LEFT JOINS, etc in my views, not only in a query

MantaRayDeeJay commented 1 year ago

I met the same issue. I found the following link YYSTACKDEPTH — Maximum parser stack depth It says that a value of 25 for the YYSTACKDEPTH param should be enough on common usages. I have tested with a value of 25 and it seems being enough to work.