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

Add foreign key support for sqlite #94

Merged
merged 6 commits into from
Jul 14, 2016

Conversation

kitchoi
Copy link
Contributor

@kitchoi kitchoi commented Jul 13, 2016

Fix #56

@kitchoi kitchoi changed the title Add foreign key support for sqlite Add foreign key support for sqlite [WIP] Jul 13, 2016
@kitchoi
Copy link
Contributor Author

kitchoi commented Jul 13, 2016

WIP because its tests will break after #81 is merged.

@codecov-io
Copy link

codecov-io commented Jul 13, 2016

Current coverage is 79.64%

Merging #94 into master will increase coverage by 0.50%

@@             master        #94   diff @@
==========================================
  Files            27         27          
  Lines           906        958    +52   
  Methods           0          0          
  Messages          0          0          
  Branches         83         91     +8   
==========================================
+ Hits            717        763    +46   
- Misses          163        166     +3   
- Partials         26         29     +3   

Powered by Codecov. Last updated by fb1bf2c...5ad6c33

@kitchoi kitchoi changed the title Add foreign key support for sqlite [WIP] Add foreign key support for sqlite Jul 13, 2016
@kitchoi
Copy link
Contributor Author

kitchoi commented Jul 13, 2016

@sbo ready for review again

@@ -90,6 +93,14 @@ class Accounting(Base):
application_policy = relationship("ApplicationPolicy")


@event.listens_for(Engine, "connect")
def set_sqlite_pragma(dbapi_connection, connection_record):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import sqlite3 here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would call it _enable_foreign_keys()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the function name _set_sqlite_pragma so that sphinx would skip it. It is the place where future pragma can be added though so I kept the rest of the name

@stefanoborini
Copy link
Contributor

codecov irrelevant. merging

@stefanoborini stefanoborini merged commit cdd1677 into master Jul 14, 2016
@stefanoborini stefanoborini deleted the 56-foreign-key-support-for-sqlite branch July 14, 2016 10:34
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