Skip to content

No constrained columns if no primary key#4

Closed
elconde wants to merge 1 commit intosqlanywhere:masterfrom
elconde:master
Closed

No constrained columns if no primary key#4
elconde wants to merge 1 commit intosqlanywhere:masterfrom
elconde:master

Conversation

@elconde
Copy link

@elconde elconde commented Apr 2, 2015

Hello,

We've been using this dialect for a few months on a project to read data from SQL Anywhere. The database is provided by a vendor, so we cannot modify it. They give us views which don't have primary keys. We found that, even though reflecting views is supported in SQLAlchemy, we could not reflect the database because of the lack of primary keys.

Adding this snippet seems to have fixed our issue. We've been running the integration for months now. I have no idea if this is correct, but it works! We're only reading, not writing to the database, so I couldn't say what implications this might have for writing.

I should also mention that we are using sqlalchemy.ext.declarative.DeferredReflection as our "base" class and adding primary keys to each class.

I hope it helps!

Regards,
Robert Conde

@saphinsperg
Copy link

We are working at getting a CLA in place to be able to accept pull requests.

@gperrow-SAP
Copy link
Contributor

This change has not been merged, but an equivalent change has been added to version 1.0.3.

@gperrow-SAP gperrow-SAP closed this May 7, 2018
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