Skip to content
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

support **kwargs for Column / add_column() / autogenerate #518

Closed
sqlalchemy-bot opened this issue Nov 27, 2018 · 7 comments
Closed

support **kwargs for Column / add_column() / autogenerate #518

sqlalchemy-bot opened this issue Nov 27, 2018 · 7 comments

Comments

@sqlalchemy-bot
Copy link

@sqlalchemy-bot sqlalchemy-bot commented Nov 27, 2018

Migrated issue, originally created by Michael Bayer (@zzzeek)

In SQLAlchemy zzzeek/sqlalchemy@de804d7 we added support for **kwargs in Column. op.alter_column() needs to support these and they should also autogen render in the same way as options for CreateIndexOp. The immediate need is for redshift-sqlalchemy to make use of this, as they use info now https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/blob/master/sqlalchemy_redshift/dialect.py#L238 but .info is too open-ended to render within autogenerate.

@sqlalchemy-bot sqlalchemy-bot added this to the fasttrack milestone Nov 27, 2018
@zzzeek zzzeek removed the task label Nov 30, 2018
@mikeywaites mikeywaites removed this from the fasttrack milestone Jan 11, 2019
@ParthS007
Copy link
Contributor

@ParthS007 ParthS007 commented Feb 13, 2019

@zzzeek @mikeywaites I want to work on this issue. How should I proceed?

@zzzeek
Copy link
Member

@zzzeek zzzeek commented Feb 13, 2019

for this one, we want add_column() (not alter_column, I think that's wrong) to support **kwargs. So I can put any key=value in add_column(). then these **kwargs would need to be propagated over to here: https://github.com/sqlalchemy/sqlalchemy/blob/master/lib/sqlalchemy/sql/schema.py#L1355 .

so it's adding the **kwargs, and also when we autogenereate op.create_table() or op.add_column(), those kwargs from the Column object need to render in the Python code.

So this issue requires some knowledge of autogenerate and such to implement. definitely doable but if you haven't worked w/ autogenerate it might take awhlie to familiarize.

@ParthS007
Copy link
Contributor

@ParthS007 ParthS007 commented Feb 13, 2019

okay @zzzeek , I will look into it. Is there any other issue which will be doable for me, you can provide the link to issues and I will go through them. Thanks for the help. :)

@ms32035
Copy link
Contributor

@ms32035 ms32035 commented Mar 18, 2019

@zzzeek, as discussed in Bitbucket, I submitted a PR to support this functionality for Redshift. sqlalchemy-redshift/sqlalchemy-redshift#161
Since Redshift does not support ALTER for columns it's only generation

@zzzeek
Copy link
Member

@zzzeek zzzeek commented Mar 21, 2019

OK we need things on this end now dont we

@zzzeek zzzeek changed the title support **kwargs for Column / alter_column() / autogenerate support **kwargs for Column / add_column() / autogenerate Sep 17, 2019
@zzzeek
Copy link
Member

@zzzeek zzzeek commented Sep 17, 2019

add_column supports kwargs already we just need autogenerate

@sqla-tester
Copy link
Collaborator

@sqla-tester sqla-tester commented Sep 17, 2019

Mike Bayer has proposed a fix for this issue in the master branch:

Support autogenerate for add_column kwargs https://gerrit.sqlalchemy.org/1467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants