Databases

TAD can offload the definition of some properties that you set to an external database. Though theoretically speaking, TAD really does not have any restriction on the external database you use; it is strongly recommended that you use sqlite databases. So the documentation here assumes that you are also using Sqlite databases.

Sqlite stores the entire database inside a file – so it is quite useful to move it around, give it to others along with the TAD model file and so on. We are working on a method where the sqlite database that you create can be shared with others too – more on that later; once we finalize the complete route.

The excellent open source software called sqlitebrowser can be used to create and edit such sqlite database files. We strongly recommend that. But there are quite a few software that work with databases – and you could choose any of the others too. As noted earlier; TAD internally is not really strict about the database you use.

Internally, TAD assumes that the database file has the same name as the TAD file; along with the additional extension of .db

When you use the "has" editor you can set any number of properties affecting the object concerned (It can be done, like in other properties, through a class; instead of setting it at the object level itself) TAD uses the following convention:

If a line in the “has” editor describes a property called 'db' then it will assume that the actual data is present in a table in the file. The first value after 'db' is considered to be the table name. Usually you would give at least one MORE parameter; which describes the specific row in that table of the database. But there could be some situation where an object needs to be associated with ALL the data inside the table of a database

So here are some examples on what could be seen in the “has” editor:

db,Flooring,marble,,

The above line would indicate that the data is in the “Flooring” table in the database associated with the TAD model, and is described by the Row where the “name” field in that table is “marble”

db,Occupants,,

The above line indicates that ALL the data present in the table called Occupants should be associated with this particular object.

When you double-click on such a line in the "has" editor; TAD would magically open the database application you had configured in the application settings If you use the excellent open source sqlitebrowser from https://sqlitebrowser.org then TAD will browse to the correct table too!

Note that when NO database file has been created for a TAD model; and you do all this, sqlitebrowser will complain that the file is absent. You would need to create the database file the very first time with all the correct tables in the database. Creating and editing database is beyond the scope of this documentation. There is plenty of material about all that on the Internet