hiro80 / minisqlparser Goto Github PK
View Code? Open in Web Editor NEWA simple SQL Parser, that can convert sql statements to an abstract syntax tree.
Home Page: https://www.minisqlparser.net
License: MIT License
A simple SQL Parser, that can convert sql statements to an abstract syntax tree.
Home Page: https://www.minisqlparser.net
License: MIT License
概要
不具合の簡単な概要を記述してください
SQL queries that contain "on conflict" clause produce errors in the parser (no support in grammar).
再現方法
不具合を再現させる手順を教えて下さい
Example query:
INSERT INTO users (id, level)
VALUES (1, 0)
ON CONFLICT (id) DO UPDATE
SET level = users.level + 1;
不具合が発生した環境
Thank you.
概要
不具合の簡単な概要を記述してください
Sql query that use MERGE (T-Sql) produce errors in the parser ("into" part is optional and not written in query).
再現方法
不具合を再現させる手順を教えて下さい
Example query:
MERGE
member_topic AS target
USING
someOtherTable AS source
ON
target.mt_member = source.mt_member
AND source.mt_member = 0
AND source.mt_topic = 110
WHEN MATCHED THEN
UPDATE SET mt_notes = 'test'
WHEN NOT MATCHED THEN
INSERT (mt_member, mt_topic, mt_notes) VALUES (0, 110, 'test')
不具合が発生した環境
Thank you.
Support DDL.
Currently library does not support DDL part of sql. I would like to try partially implement ddl functionality.
Grammar to implement in that issue:
// DDL
ddl_stmt
: create_stmt
| alter_stmt
| drop_stmt;
create_stmt
: create_table_stmt
| create_index_stmt
| create_sequence_stmt
| create_procedure_stmt
| create_view_stmt
| create_trigger_stmt
;
alter_stmt:
alter_table_stmt
;
drop_stmt
: drop_index_stmt
| drop_table_stmt
| drop_trigger_stmt
| drop_view_stmt
;
I think it would be great to start from that limited grammar.
概要
不具合の簡単な概要を記述してください
SQL queries that contain with (nolock)
produce errors in the parser. This happens with the assembly in C# and on your website.
再現方法
不具合を再現させる手順を教えて下さい
Example Query:
SELECT
i.itemnum AS [OBDocumentID],
i.datestored As [DateStored],
i.itemdate As [DocumentDate],
i.itemtypenum As [DocumentType],
kgd121.kg119 As [Department],
kgd121.kg128 As [Group],
kgd121.kg139 As [Nation],
kgd121.kg148 As [PurchaseDate],
ki150.keyvaluechar As [Region],
kgd121.kg152 As [RegistrationLicensePlate],
kgd121.kg157 As [SaleDate],
kgd121.kg161 As [SubDocType],
kgd121.kg166 As [Unit],
kgd121.kg169 As [WIN],
kgd121.kg137 As [Location]
FROM hsi.itemdata i WITH(NOLOCK)
INNER JOIN hsi.keygroupdata121 kgd121 WITH(NOLOCK) ON kgd121.itemnum = i.itemnum
INNER JOIN hsi.keyitem150 ki150 WITH(NOLOCK) ON ki150.itemnum = i.itemnum
WHERE i.itemdate BETWEEN '1/1/2019' AND '2/1/2019'
不具合が発生した環境
Thank you,
Darren
Hello, Do you have any plans to support DDL and other statements in parser?
Maybe you can give a few words on future plans for that project?
対策としてMergeStmtのConstraintプロパティをPredicate型からBracketedPredicate型に変更する方法がある。
MERGE INTO 退職社員マスタ T1
USING (SELECT
S1.社員コード
,S1.社員名
,S1.年齢
FROM 社員マスタ S1
WHERE S1.年齢 >= 30)
ON (
T1.社員コード = S1.社員コード
AND 社員コード = 2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
WHEN MATCHED THEN
UPDATE SET
T1.社員名 = S1.社員名
,T1.年齢 = S1.年齢
WHEN NOT MATCHED THEN
INSERT(
社員コード
,社員名
,年齢
)VALUES(
S1.社員コード
,S1.社員名
,S1.年齢
)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.