-
Notifications
You must be signed in to change notification settings - Fork 320
Add a decorator for creating table via class-style. #823
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
base: master
Are you sure you want to change the base?
Conversation
README.rst
Outdated
| customers = Table('customers') | ||
| q = Query.from_(customers).select(customers.id, customers.fname, customers.lname, customers.phone) | ||
| The table also can create via class-style: |
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.
| The table also can create via class-style: | |
| The table can also be created via class-style: |
pypika/tests/test_table_class.py
Outdated
| self.assertEqual('"f"', T.f.get_sql(with_alias=True, quote_char='"')) | ||
| self.assertEqual(id(T), id(T.f.table)) | ||
|
|
||
| def test_table_with_field_and_ailas(self): |
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.
| def test_table_with_field_and_ailas(self): | |
| def test_table_with_field_and_alias(self): |
AzisK
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.
It looks good. Thanks for your work. Could you resolve the conflicts and updater with master branch?
2187289 to
1eb4ecb
Compare
This feature add a decorator to create table via class-style, it's friendly to type hint.
The decorator's parameters are same as
Table.__init__.