entire contents to the clipboard.
If you've made some changes and want to save your work, here's what to do.
common/resources/erd.xml
in your favorite editor.erd.xml
and save it.common/resources/create_tables.sql
in your favorite editor.create_tables.sql
and save it.SQLite is an odd database in that it allows one to define columns that have datatypes of which SQLite knows nothing, like TIMESTAMP, BOOLEAN or BANANAS. The first two are particularly useful. Python's sqlite3
module (which we use) automatically converts the data in TIMESTAMP columns to DateTime
objects. Similarly, our db.py
code has two small functions that translate BOOLEAN column data into Python's True
or False
. Vespa relies on this behavior.
Vespa assumes that these columns will be translated into the appropriate objects, therefore it's important to declare these columns with the appropriate types. By default, WWW SQL Designer doesn't know about TIMESTAMP and BOOLEAN columns, but it's easy to add custom types.
WWW SQL Designer saves datatype information in the XML file it generates, so if you paste our erd.xml
into WWW SQL Designer, it will automatically know about TIMESTAMP and BOOLEAN.
Suppose you want to add the custom type BANANAS. All you'd have to do is open erd.xml
in a text editor and add the following line below all of the other <type>
elements.
<type label="Bananas" default="" length="0" sql="BANANAS" quote="'" color="yellow" />
Above I mentioned how WWW SQL Designer is similar to wxGlade in the way it affects what files one can and cannot hand edit. Well, they're dissimilar in that building GUIs like Vespa's by hand (without wxGlade) is pretty intimidating, but designing and edit a database without a GUI tool like WWW SQL Designer is not a big deal.
So If you don't want to use this tool at some point, that's fine. You can edit Vespa's .sql
files in a text editor. Just don't go back to using WWW SQL Designer without rebuilding your ERD from scratch!