-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add a function with an " text[] default array['text', 'text2']"? #106
Comments
There isn't currently a good solution for this. The clearest path forward would be to improve the parameter parser at the line you referenced above If you have bandwidth to submit a PR I'd be very happy to see this improve |
Hi, are there any updates on this issue? I encountered the same problem where Alembic interprets a comma in the default definition as the beginning of a new parameter, instead of recognizing it as part of the content within "[" and "]". I also unsuccessfully tried using a string formatted as '{1,2,3}' and casting it, hoping that the parser might handle commas within a string differently than in a standard array declaration. Unfortunately, it behaved the same way. If there have been no updates on this issue, I might find some time to take a look at the code myself. Could you kindly point out where you think I should start, particularly in the pg_function parser? I briefly reviewed the code in pg_function.py and replaceable_entity.py, but it wasn't immediately clear to me where the parser that processes the signature is involved. |
Sure, this would be a good place to start alembic_utils/src/alembic_utils/pg_function.py Lines 90 to 94 in 3711ec7
|
I've a functions which looks like this:
The resulting error during
alembic revision --autogenerate -m "Add diff functions"
ishttps://github.com/olirice/alembic_utils/blob/master/src/alembic_utils/pg_function.py#L90
For now I have a workaround to set the default to NULL and use
coalesce( ignore_columns, array ['branch_id', 'commit_id_from', 'commit_id_to'])
later, but it would have been nice to actually to use the regular default value.The text was updated successfully, but these errors were encountered: