devin-ai commited on
Commit
c234965
·
verified ·
1 Parent(s): 3365037

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -74,8 +74,11 @@ if uploaded_file is not None:
74
  # Read the contents of the uploaded database file in binary mode
75
  db_content = uploaded_file.read()
76
 
77
- # Execute the script directly with binary data
78
- cursor.executescript(db_content)
 
 
 
79
 
80
  # Display a success message after uploading the database file
81
  st.success("Database uploaded successfully.")
 
74
  # Read the contents of the uploaded database file in binary mode
75
  db_content = uploaded_file.read()
76
 
77
+ # Decode binary data into a Unicode string
78
+ db_content_str = db_content.decode("utf-8")
79
+
80
+ # Execute the script
81
+ cursor.executescript(db_content_str)
82
 
83
  # Display a success message after uploading the database file
84
  st.success("Database uploaded successfully.")