You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
INSERT INTO sample_table
(col1, col2)
VALUES
($1, $2)
ON CONFLICT ONCONSTRAINT sample_table_pkc DO
UPDATESET
col1=CASE WHEN $1 IS NULL'NULL' ELSE 'NOT NULL' END
,col2=$2
;
ケース2
INSERT INTO sample_table
(col1, col2)
VALUES
($1, $2)
ON CONFLICT ONCONSTRAINT sample_table_pkc DO
UPDATESET
col1=COALESCE($1, 'NULL')
,col2=$2
;
フォーマットできるケース
ケース1
SET句の項目が1つのみ
INSERT INTO sample_table
(col1)
VALUES
($1)
ON CONFLICT ONCONSTRAINT sample_table_pkc DO
UPDATESET
col1=CASE WHEN $1 IS NULL'NULL' ELSE 'NOT NULL' END
;
ケース2
SET句の項目が1つのみ
INSERT INTO sample_table
(col1, col2)
VALUES
($1, $2)
ON CONFLICT ONCONSTRAINT sample_table_pkc DO
UPDATESET
col1=CASE WHEN $1 IS NULL'NULL' ELSE 'NOT NULL' END
;
ケース3
SET句の項目は複数だが条件式はなし
INSERT INTO sample_table
(col1, col2)
VALUES
($1, $2)
ON CONFLICT ONCONSTRAINT sample_table_pkc DO
UPDATESET
col1=$1
,col2=$2
;
ケース4
UPSERTではなくUPDATEのみ
UPDATE sample_table
SET
col1=CASE WHEN $1 IS NULL'NULL' ELSE 'NOT NULL' END
,col2=$2
;
The text was updated successfully, but these errors were encountered:
/*Traceback (most recent call last):
File "uroborosqlfmt/exceptions.py", line 47, in wrap_try_except
File "sqlparse/filters.py", line 386, in _process
File "uroborosqlfmt/filters.py", line 1450, in _process_on
File "uroborosqlfmt/filters.py", line 1613, in _adjust_comparisons_indent
File "uroborosqlfmt/filters.py", line 352, in __init__
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "uroborosqlfmt/exceptions.py", line 47, in wrap_try_except
File "sqlparse/filters.py", line 386, in _process
File "uroborosqlfmt/filters.py", line 840, in _process_statement
File "sqlparse/filters.py", line 473, in _process_default
File "sqlparse/filters.py", line 473, in <listcomp>
File "uroborosqlfmt/filters.py", line 517, in _process
File "uroborosqlfmt/exceptions.py", line 50, in wrap_try_except
File "uroborosqlfmt/exceptions.py", line 20, in __init__
AttributeError: 'IndexError' object has no attribute 'message'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "uroborosqlfmt/api.py", line 39, in format_dir
File "uroborosqlfmt/__init__.py", line 104, in format_sql
File "sqlparse/engine/__init__.py", line 68, in run
File "sqlparse/engine/__init__.py", line 65, in _run1
File "uroborosqlfmt/filters.py", line 466, in process
File "sqlparse/filters.py", line 478, in process
File "uroborosqlfmt/filters.py", line 517, in _process
File "uroborosqlfmt/exceptions.py", line 50, in wrap_try_except
File "uroborosqlfmt/exceptions.py", line 20, in __init__
AttributeError: 'AttributeError' object has no attribute 'message'
*/
Version
フォーマットできないケース
ケース1
ケース2
フォーマットできるケース
ケース1
SET句の項目が1つのみ
ケース2
SET句の項目が1つのみ
ケース3
SET句の項目は複数だが条件式はなし
ケース4
UPSERTではなくUPDATEのみ
The text was updated successfully, but these errors were encountered: