Take up to the first 1000 lines in order to choose default style in toc
Taking account of @agouge advice:

This statement can take a long time to execute. On a file with 1.2 million MULTILINESTRINGS, it takes about 25 seconds. Instead of checking the dimension of every geometry in the table, I would vote for checking the dimension of just the first geometry:

In that case, the statement will take only a few milliseconds to execute. And this is the case we are in about 99.9% of the time.

On the other hand, if a column contains mixed geometries, some of them will probably not be displayed correctly. In this case, it will be up to the user to create a custom style. But this case is pretty rare.