-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_test_db.py
39 lines (30 loc) · 935 Bytes
/
create_test_db.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import os
import interbase
# Get the current working directory
current_dir = os.getcwd()
# Define the relative path and construct the full DSN
relative_path = 'TEST.DB'
dsn = f'localhost/3050:{os.path.join(current_dir, relative_path)}'
# Define the connection parameters
user = 'sysdba'
password = 'masterkey'
charset = 'WIN1252' # Specify the default charset
# Create the database
# connection = interbase.create_database(
# dsn=dsn,
# user=user,
# password=password,
# page_size=4096, # Optional parameter
# charset=charset, # Set the default charset
# )
# Connect database
connection = interbase.connect(
dsn=dsn,
user=user,
password=password,
charset=charset, # Set the default charset
)
print('Database created successfully at', dsn)
# Close the connection
connection.close()
# Computer\HKEY_CURRENT_USER\Software\Corel\PCU\installedsoftware\{D0FED3BB-6786-45EA-B5AF-5A17EE0A6E66}