File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -122,20 +122,20 @@ def process(value):
122122 self .logger .debug (statement )
123123
124124 # if SELECT (or INSERT with RETURNING), return result set as list of dict objects
125- if re .search (r"^\s*SELECT\s+ " , statement , re .I ):
125+ if re .search (r"^\s*SELECT" , statement , re .I ):
126126 rows = result .fetchall ()
127127 return [dict (row ) for row in rows ]
128128
129129 # if INSERT, return primary key value for a newly inserted row
130- elif re .search (r"^\s*INSERT\s+ " , statement , re .I ):
130+ elif re .search (r"^\s*INSERT" , statement , re .I ):
131131 if self .engine .url .get_backend_name () in ["postgres" , "postgresql" ]:
132132 result = self .engine .execute (sqlalchemy .text ("SELECT LASTVAL()" ))
133133 return result .first ()[0 ]
134134 else :
135135 return result .lastrowid
136136
137137 # if DELETE or UPDATE, return number of rows matched
138- elif re .search (r"^\s*(?:DELETE|UPDATE)\s+ " , statement , re .I ):
138+ elif re .search (r"^\s*(?:DELETE|UPDATE)" , statement , re .I ):
139139 return result .rowcount
140140
141141 # if some other statement, return True unless exception
You can’t perform that action at this time.
0 commit comments