aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md15
-rw-r--r--tests/dbTestFiller.py5
2 files changed, 19 insertions, 1 deletions
diff --git a/README.md b/README.md
index 334bc54..daff6b8 100644
--- a/README.md
+++ b/README.md
@@ -122,7 +122,20 @@ Once you have the `COLLADA2GLTF-bin` file, copy the file:
cp COLLADA2GLTF-bin /usr/local/bin/collada2gltf
```
-## 4. Running
+## 4. Setting up the Database
+
+You will first need to create a database and grant all priviliges to a user. Make sure you have correctly configured the `config.ini` file.
+
+After tha simply run the following commands. This will create the table(s) and check if the backend is working or not.
+
+```
+cd tests
+python3 dbTestFiller.py
+python3 backendTest.py
+python3 removeSample.py
+```
+
+## 5. Running
### Without FastAPI
diff --git a/tests/dbTestFiller.py b/tests/dbTestFiller.py
index 02d51de..6971553 100644
--- a/tests/dbTestFiller.py
+++ b/tests/dbTestFiller.py
@@ -10,6 +10,11 @@ mycon = con.connect(host=config['DATABASE']['HOST'],user=config['DATABASE']['USE
mycursor = mycon.cursor()
done = 1
+try:
+ mycursor.execute("create table curieweb ( id varchar(16) primary key, email nvarchar(255) NOT NULL, protein LONGBLOB NOT NULL, protein_name VARCHAR(255), ligand_pdbqt LONGBLOB, ligand_smile VARCHAR(255), ligand_name VARCHAR(255), config LONGBLOB NOT NULL, date DATE, description VARCHAR(255), done TINYINT DEFAULT 0, pdb VARCHAR(4),csv longblob)")
+except con.ProgrammingError:
+ print("Table Already Exists!")
+
def convertToBinaryData(filename):
with open(filename, 'rb') as file:
binaryData = file.read()