esp32_arduino_sqlite3_lib icon indicating copy to clipboard operation
esp32_arduino_sqlite3_lib copied to clipboard

UNION or JOINS in views

Open tomthemod opened this issue 4 years ago • 3 comments

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.

tomthemod avatar Nov 20 '20 18:11 tomthemod

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.

siara-cc avatar Nov 21 '20 11:11 siara-cc

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

tomthemod avatar Nov 22 '20 07:11 tomthemod

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.

MantaRayDeeJay avatar May 19 '23 12:05 MantaRayDeeJay