Skip to content

Commit

Permalink
[新增]正则文本
Browse files Browse the repository at this point in the history
  • Loading branch information
longfengpili committed Jun 6, 2024
1 parent baff51d commit fcd2deb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pydbapi/sql/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# @Author: longfengpili
# @Date: 2023-06-02 15:27:41
# @Last Modified by: longfengpili
# @Last Modified time: 2024-06-06 16:34:25
# @Last Modified time: 2024-06-06 19:11:40
# @github: https://github.com/longfengpili


Expand Down Expand Up @@ -94,7 +94,7 @@ def deal_value(dtypes: list, value: list):
elif d.startswith('varchar') or d.startswith('str'):
v = v.replace("'", "''") if isinstance(v, str) else v
v = f"'{v}'"
elif d in ('date', 'datetime', 'timestamp') and re.match('\d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d{2})?', v):
elif d in ('date', 'datetime', 'timestamp') and re.match(r'\d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d{2})?', v):
v = f"'{v}'"
else:
v = f'{v}'
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# @Author: longfengpili
# @Date: 2023-06-02 15:27:41
# @Last Modified by: longfengpili
# @Last Modified time: 2024-04-08 13:54:17
# @Last Modified time: 2024-06-06 19:12:00
# @github: https://github.com/longfengpili


import setuptools

VERSION = '0.0.122'
VERSION = '0.0.123'
PROJECT_NAME = 'pydbapi'

with open('README.md', 'r', encoding='utf-8') as f:
Expand Down

0 comments on commit fcd2deb

Please sign in to comment.