-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can be a bit more defensive here i.e. do next / iter only if it is a list / iterator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not needed. It is test specific and can be in test_schema_discovery.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to give schema discovery as an option i.e. set it as following parameters
schema=None, schema_file=None, schema_inspect=False
If schema_inspect is true, none of the other two should be passed or it raises an error. Otherwise, one of schema_file or schema string should be passed.
Gives more flexibility to the developer (user) of the library that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the hardcoding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this removal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this addition of fixtures?
@anshum4n-git
anshum4n-git
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I missed submitting this review. Take a look at the comments. Also, if we can separate out this PR and #10 for Multiple database support, they can be merged separately.
Summary
This PR implements support for schema lookup directly from the connected database when generating SQL queries, addressing think41/foundation-sql#8. Previously, a
schema.sqlfile or a hardcoded schema string was required for schema understanding. With this change, the system can now retrieve schema information dynamically from the database.Related Issue
Closes #8
Changes
schema.sqlor schema is not present.Additional Notes