Skip to content

Conversation

git-hulk
Copy link
Member

The sample can refer to:

INSERT INTO TABLE test_with_typed_columns (id, created_at) VALUES ({id:Int32}, {created_at:DateTime64(6)});

The sample can refer to:

```SQL
INSERT INTO TABLE test_with_typed_columns (id, created_at) VALUES ({id:Int32}, {created_at:DateTime64(6)});
```
@coveralls
Copy link

coveralls commented Apr 23, 2025

Pull Request Test Coverage Report for Build 14612383552

Details

  • 35 of 57 (61.4%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.007%) to 62.785%

Changes Missing Coverage Covered Lines Changed/Added Lines %
parser/ast_visitor.go 3 5 60.0%
parser/ast.go 15 25 60.0%
parser/parser_table.go 17 27 62.96%
Totals Coverage Status
Change from base Build 14586084570: -0.007%
Covered Lines: 6934
Relevant Lines: 11044

💛 - Coveralls

@git-hulk git-hulk requested a review from Copilot April 23, 2025 07:15
Copilot

This comment was marked as outdated.

@git-hulk git-hulk requested a review from Lance726 April 23, 2025 07:16
@git-hulk git-hulk requested a review from Copilot April 23, 2025 07:17
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for typed placeholder parameters within INSERT statements by introducing parsing and AST node support for expressions like {id:Int32} and {created_at:DateTime64(6)}.

  • Implements a new parseTypedPlaceholder function in the parser.
  • Adds a new AST node type (TypedPlaceholder) and corresponding visitor support.

Reviewed Changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.

File Description
parser/parser_table.go Introduces a new parser function for typed placeholders.
parser/ast_visitor.go Adds a new visitor method for the TypedPlaceholder AST node.
parser/ast.go Implements the TypedPlaceholder AST node and its behaviors.
Files not reviewed (3)
  • parser/testdata/dml/format/insert_with_placeholder.sql: Language not supported
  • parser/testdata/dml/insert_with_placeholder.sql: Language not supported
  • parser/testdata/dml/output/insert_with_placeholder.sql.golden.json: Language not supported
Comments suppressed due to low confidence (1)

parser/parser_table.go:1205

  • Consider adding tests that cover the new typed placeholder parsing functionality to ensure its robustness in different SQL scenarios.
func (p *Parser) parseTypedPlaceholder(pos Pos) (Expr, error) {

Copy link
Collaborator

@Lance726 Lance726 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@git-hulk git-hulk merged commit 4955a88 into AfterShip:master Apr 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants