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

fix: make get_pk_constraint adhere to SqlAlchemy specs #9

Merged
merged 1 commit into from
Mar 19, 2020

Conversation

villebro
Copy link

Currently get_pk_constraint() returns a dict that isn't in line with the SqlAlchemy specification. As stated in the documentation,

  • constrained_columns: a list of column names that make up the primary key
  • name: optional name of the primary key constraint.

I.e. the columns should be a list, and the name should be the name of the primary key if it exists.

This PR casts the list of columns into a list, and assigns the name based on the first non NULL value returned for the constraint name if defined.

@vinceatbluelabs
Copy link

Looks right to me! Thanks a ton, @villebro!

@vinceatbluelabs vinceatbluelabs merged commit 466faee into bluelabsio:master Mar 19, 2020
@villebro villebro deleted the get_pk_constraint branch March 19, 2020 19:38
@vinceatbluelabs
Copy link

@villebro
Copy link
Author

That's awesome, thanks @vinceatbluelabs !

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

Successfully merging this pull request may close these issues.

3 participants