[feat] a new syntatx of default value#29
Open
lanbinleo wants to merge 14 commits intoBernieHuang2008:mainfrom
Open
[feat] a new syntatx of default value#29lanbinleo wants to merge 14 commits intoBernieHuang2008:mainfrom
lanbinleo wants to merge 14 commits intoBernieHuang2008:mainfrom
Conversation
BernieHuang2008
approved these changes
Jul 23, 2024
Owner
BernieHuang2008
left a comment
There was a problem hiding this comment.
approve some changes, some pending.
BernieHuang2008
requested changes
Jul 23, 2024
| default_value = None | ||
|
|
||
|
|
||
| # 支持 type_ 为 [str, "默认值"] 的写法 |
Owner
There was a problem hiding this comment.
I suggest that to use tuple instead of list, since there's already a usage:
tb['col_name'] = str, "hello"The code is as below
https://github.com/BernieHuang2008/MercurySQL/blob/ffc6e463bec44a94546b2438ab5c5474a5698d4b/MercurySQL/gensql/table.py#L148C1-L152C29
Python will parse the situation above as tuple, so it's recommend to have the same form as the one already implemented in table.__setitem__().
|
|
||
| if name in self.columns: | ||
| if type_.lower() != self.columnsType[name].lower(): | ||
| if rebuild: |
Owner
There was a problem hiding this comment.
currently deciding whether i will use this ...
| return str(data).lower() | ||
| elif isinstance(data, (int, float)): | ||
| return str(data) | ||
| elif isinstance(data, bytes): |
Owner
|
@lanbinleo 这次改的有点多,我要先理解一下 (>_<) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.