更新本地运行相关。

This commit is contained in:
chenxudong 2025-07-23 12:04:22 +08:00
parent 00107a3756
commit dfde3d3387
4 changed files with 712 additions and 2 deletions

Binary file not shown.

690
src/datas/init.sql Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,22 @@
sql_path = rf"E:\workspace\szsd\database-win-pkg\src\datas\init.sql"
def set_replace():
with open(sql_path, 'r', encoding='utf-8') as file:
lines = file.readlines()
modified = False
new_lines = []
for line in lines:
if 'CREATE TABLE' in line and 'IF NOT EXISTS' not in line:
new_line = line.replace('CREATE TABLE', 'CREATE TABLE IF NOT EXISTS ')
new_lines.append(new_line)
modified = True
else:
new_lines.append(line)
# 如果有修改,则写回文件
if modified:
with open(sql_path, 'w', encoding='utf-8') as file:
file.writelines(new_lines)
if __name__ == '__main__':
set_replace()

View File

@ -1,5 +1,3 @@
import os
import shutil
import subprocess
import time
import tkinter as tk