Skip to content

修复不使用`将sql的每一行包裹,导致原始sql有换行时生成的sql粘连问题 #586

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

JiaJIe6591
Copy link

例:

#pysql[("select user_id, user_name 
from user")]

生成的sql为 :

select user_id, user_namefrom user

修改后生成的sql为:

select user_id, user_name from user

before generate sql is :

select user_id, user_namefrom user

after generate sql is:

select user_id, user_name from user

select user_id, user_name \n from user

)], 生成的sql为 : select user_id, user_namefrom user,修改后生成的sql为:select user_id, user_name from user)
@zhuxiujia
Copy link
Member

有没有新增 更多场景的测试,貌似单元测试跑失败了

@Issues-translate-bot
Copy link
Collaborator

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Are there any new tests for more scenarios, it seems that the unit test failed

@Issues-translate-bot
Copy link
Collaborator

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I'll change it and run the test again

@JiaJIe6591
Copy link
Author

已更改实现方法,在自己的项目里进行了测试,保留了自定义的sql格式,同时粘连问题也得到了解决

@Issues-translate-bot
Copy link
Collaborator

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The implementation method has been changed, tested in my own project, retained the custom SQL format, and the sticking problem has also been solved

@JiaJIe6591 JiaJIe6591 closed this Jul 29, 2025
@Issues-translate-bot
Copy link
Collaborator

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


If you have any questions, close it first

@JiaJIe6591 JiaJIe6591 reopened this Jul 29, 2025
@JiaJIe6591
Copy link
Author

编译期的sql生成和运行时的动态拼接行为都已更改,动态sql的参数生成格式进行了更改,所以更改了一些测试用例,不影响语法执行

@Issues-translate-bot
Copy link
Collaborator

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The dynamic splicing behavior of SQL generation during the compilation period and the runtime have been changed. The parameter generation format of dynamic SQL has been changed, so some test cases have been changed, which does not affect syntax execution.

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