Skip to content

better sql creation#9

Closed
jue-cmd wants to merge 6 commits intoOakPlatinum:new-1.20.1from
jue-cmd:new-1.20.1
Closed

better sql creation#9
jue-cmd wants to merge 6 commits intoOakPlatinum:new-1.20.1from
jue-cmd:new-1.20.1

Conversation

@jue-cmd
Copy link

@jue-cmd jue-cmd commented Mar 4, 2025

Sql init only nessery functions

@OakPlatinum OakPlatinum self-requested a review March 4, 2025 10:47
Copy link
Owner

Choose a reason for hiding this comment

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

以后还会有别的sql,这个路径最好不要改

Copy link
Author

Choose a reason for hiding this comment

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

好的aaaaaaaaaaaaaawwwwwwwwwwwwwwwwwwwwwaaaaaaaaaa

JsonArray sql_list = JsonParser.parseString(loadSource("sql/index.sql")).getAsJsonObject().getAsJsonArray();

if (sql_list.getAsJsonArray().isEmpty()) {
throw new RuntimeException("no sql list");
Copy link
Owner

Choose a reason for hiding this comment

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

不要滥用RuntimeException,更好的做法是将捕获的SQLException用LOGGER打印出来,没有必要不要崩溃


//获取当前数据库的类型
if (!databaseExists) {
throw new RuntimeException("no sql list");
Copy link
Owner

Choose a reason for hiding this comment

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

说过了。。。


JsonObject sqlJson = JsonParser.parseString(loadSource("sql" + dataBaseName + "/index.json")).getAsJsonObject().getAsJsonObject();
if (!sqlJson.get("sql_name").getAsString().equalsIgnoreCase(dataBaseName)) {
throw new RuntimeException("sql name not match,may be the sql is bad");
Copy link
Owner

Choose a reason for hiding this comment

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

。。。


public boolean createTable(String name){

public boolean export_data(String path) {
Copy link
Owner

Choose a reason for hiding this comment

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

驼峰命名法能不能不要和蛇形混用?

jue-cmd and others added 5 commits March 12, 2025 17:01
Co-authored-by: Oak Platinum <oakplatinum@qq.com>
Co-authored-by: Oak Platinum <oakplatinum@qq.com>
Co-authored-by: Oak Platinum <oakplatinum@qq.com>
Co-authored-by: Oak Platinum <oakplatinum@qq.com>
Co-authored-by: Oak Platinum <oakplatinum@qq.com>
@jue-cmd
Copy link
Author

jue-cmd commented Mar 12, 2025

ok awa

@jue-cmd jue-cmd closed this Mar 12, 2025
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