Coder Social home page Coder Social logo

T-SQL Alter Table about tree-sitter-sql HOT 5 CLOSED

derekstride avatar derekstride commented on August 29, 2024
T-SQL Alter Table

from tree-sitter-sql.

Comments (5)

esetnik avatar esetnik commented on August 29, 2024 1

Ok in that case we should probably reopen this one as well since there appear to be two separate issues in the same statement. The issue I originally reported was fixed in taozhi8833998/node-sql-parser#1372. Thanks for your help! Happy to test out a potential solution.

from tree-sitter-sql.

matthias-Q avatar matthias-Q commented on August 29, 2024

The SQL statement works fine for my:
image

Can you update the grammar on your machine?

from tree-sitter-sql.

esetnik avatar esetnik commented on August 29, 2024

Hmm. I am using the latest parser from nvim-treesitter. I believe it is nvim-treesitter/nvim-treesitter@411e771. I'm not too familiar with how to update grammar directly. Can you clarify how I should do that?

from tree-sitter-sql.

esetnik avatar esetnik commented on August 29, 2024

I apologize the error appears to be coming from https://github.com/fannheyward/coc-sql and not tree-sitter-sql

from tree-sitter-sql.

matthias-Q avatar matthias-Q commented on August 29, 2024

OK, no problem. Upon further investigation, T-SQL seems to support to add multiple columns in one alter table statement (like in your screenshot).
This parse aims to be permissive and we mostly consider MySQL, MariaDB, PostgreSQL and a some Hive statements. These dialect do not support this style of altering tables.

If you want you can reopen it. I definately get an error for statements like:

alter table classname 
add
col1 varchar(255) not null default('empty'),
col2 varchar(255) not null default('empty2');

The SQL in nvim-treesitter gets updated when you update the plugin. :TSUpdate should also work.

from tree-sitter-sql.

Related Issues (20)

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.