Skip to content
Snippets Groups Projects
Commit 4915e75b authored by Chieh Lin's avatar Chieh Lin
Browse files

multiple database

parent efc59f34
No related branches found
No related tags found
No related merge requests found
Pipeline #366576 failed
No preview for this file type
This diff is collapsed.
No preview for this file type
......@@ -15,10 +15,10 @@ class Theme:
self.penwidth = penwidth
class Table():
def __init__(self, name, comment):
class CustomTable():
def __init__(self, name, schema):
self.name = name
self.comment = comment if comment is not None and comment != 'None' else ''
self.schema = schema if schema is not None and schema != 'None' else '' # table schema
self.label = None
self.columns = [] # list of all columns
......@@ -34,7 +34,7 @@ class Table():
return name.upper() if useUpperCase else name.lower()
def getName(self, useUpperCase, withQuotes=True):
return Table.getClassName(self.name, useUpperCase, withQuotes)
return CustomTable.getClassName(self.name, useUpperCase, withQuotes)
def getColumn(self, name):
for column in self.columns:
......@@ -85,7 +85,7 @@ class Table():
return s
class Column:
class CustomColumn:
def __init__(self, table, name, comment):
self.table = table
self.name = name
......@@ -101,7 +101,7 @@ class Column:
def getName(self, useUpperCase, withQuotes=True):
return Table.getClassName(self.name, useUpperCase, withQuotes)
return CustomTable.getClassName(self.name, useUpperCase, withQuotes)
def setDataType(self, datatype):
......
......@@ -384,6 +384,12 @@
<!-- Add more items as needed -->
</ul>
<!-- set_database.html -->
<form method="post" action="/">
<input type="text" name="database_uri" placeholder="Enter Database URI">
<input type="submit" value="Set Database">
</form>
<div id="resize-handle-left" class="resize-handle-left"></div>
</div>
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Select Database</title>
<!-- Add some CSS for styling -->
</head>
<body>
<div>
<!-- <h3>Current Database: {{ current_db }}</h3> -->
<h3>Select a Database</h3>
<ul>
{% for db in databases %}
<li>{{ db }}</li>
{% endfor %}
</ul>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Set Database</title>
</head>
<body>
<form method="POST" action="/set-database">
<label for="database_uri">Database URI:</label>
<input type="text" name="database_uri" id="database_uri">
<input type="submit" value="Set Database">
</form>
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment