You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the current behavior may be a problem on a project who use two different dependencies who depends of sqlparse. Project foo use two dependencies, A ask for the default configuration, B clear the entire lexer as written the configuration, the dependency A is likely to be broken due of an external dependencies as both A and B use the same singleton.
My suggestion is to be able to send a lexer parameter, if it's empty, we may use the default lexer who is the current singleton and if not, we use the lexer who was send as a parameter.
If needed I can contribute so let me know if my suggestion make sense.
The text was updated successfully, but these errors were encountered:
YiuRULE
changed the title
Add a lexer as an argument on public function
Add a lexer as an argument on public functions
Apr 19, 2023
An use case that I think about it when I work on a project who depends of sqlparse.
We can currently extend the lexer with using a singleton, as described on the documentation there: https://github.com/andialbrecht/sqlparse/blob/907fb496f90f2719095a1f01fe24db1e5c0e15a8/docs/source/extending.rst
I think the current behavior may be a problem on a project who use two different dependencies who depends of sqlparse. Project
foo
use two dependencies, A ask for the default configuration, B clear the entire lexer as written the configuration, the dependency A is likely to be broken due of an external dependencies as both A and B use the same singleton.My suggestion is to be able to send a
lexer
parameter, if it's empty, we may use the default lexer who is the current singleton and if not, we use the lexer who was send as a parameter.If needed I can contribute so let me know if my suggestion make sense.
The text was updated successfully, but these errors were encountered: