Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website demo for column completions #170

Draft
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

JackWang032
Copy link
Collaborator

新增内容

新增字段补全与已创建表的补全demo

修复内容

已有实体后输入空格不应该再补全实体

iShot_2025-01-08_14 26 10

关联Issues

#158

Preview地址

https://jackwang032.github.io/monaco-sql-languages/

交互方式

  1. 识别上下文中的语句,进行建表语句的补全
image
  1. 输入字段处提示FROM中的表与FROM中表的所有字段
image
  1. 输入表名后,约束只展示该表下的字段
image
  1. 支持通过表别名访问字段
image
  1. 来源多表出现重名字段时,加上表名区分
image

Copy link
Collaborator

@Cythia828 Cythia828 left a comment

Choose a reason for hiding this comment

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

+1

@JackWang032
Copy link
Collaborator Author

已知问题:
在收集table类型的entity时, 仅通过isContainCaret能拿到所有包含当前输入位置的 select statement, 但对于子查询,只想过滤出子查询对应的select statement下的entity时并没有好的实现方式, 如下面SQL在子查询中收集到的会有t1t2两个表,那么就没法只提示t2下的字段

SELECT id FROM t1
WHERE name IN (
  SELECT name FROM t2
)

@JackWang032
Copy link
Collaborator Author

已知问题: 在收集table类型的entity时, 仅通过isContainCaret能拿到所有包含当前输入位置的 select statement, 但对于子查询,只想过滤出子查询对应的select statement下的entity时并没有好的实现方式, 如下面SQL在子查询中收集到的会有t1t2两个表,那么就没法只提示t2下的字段

SELECT id FROM t1
WHERE name IN (
  SELECT name FROM t2
)

期望dt-sql-parser做实体收集时能添加标识:实体是否为当前输入位置的最小select stmt边界

@JackWang032
Copy link
Collaborator Author

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.

2 participants