Giter Club home page Giter Club logo

minisqlparser's People

Contributors

hiro80 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minisqlparser's Issues

Add support for "on conflict" clause

概要
不具合の簡単な概要を記述してください
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;

不具合が発生した環境

  • OS: Windows7
  • Browser firefox quantum 67.0 (64-bit)

Thank you.

MERGE statement error.

概要
不具合の簡単な概要を記述してください
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')

不具合が発生した環境

  • OS: Windows7
  • Browser firefox quantum 67.0 (64-bit)

Thank you.

DDL Support

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.

WITH (NOLOCK) Errors

概要
不具合の簡単な概要を記述してください
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

Project roadmap and future plans

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?

MERGE文をBeautifulStringifierオブジェクトで整形出力するとON句で崩れる

対策として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.年齢
  )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.