Since an LTPDA repository is just a MySQL database, you can query the database using standard SQL commands via any of the popular MySQL clients. In addition, the LTPDA toolbox provides a simplified command that can be used to execute simple queries with only basic SQL knowledge.

The command is called ltpda_dbquery and it can be used to perform various queries. It takes the following input arguments:
connA database connection object
tablenameThe name of a table to search
queryThe query string written in MySQL SQL syntax

Examples of usage are:

Searching particular tables

      >> info  = ltpda_dbquery(conn, 'select * from objmeta where id>1000 and id<2000');
      >> info  = ltpda_dbquery(conn, 'ao',           'id>1000 and id<2000');
      >> info  = ltpda_dbquery(conn, 'objmeta',      'name like "x12"');
      >> info  = ltpda_dbquery(conn, 'users',        'username="aouser"');
      >> info  = ltpda_dbquery(conn, 'collections',  'id=3');
      >> info  = ltpda_dbquery(conn, 'collections',  'obj_ids="1,2"');
      >> info  = ltpda_dbquery(conn, 'transactions', 'user_id=3');
      >> info  = ltpda_dbquery(conn, 'transactions', 'obj_id=56');
  

Retrieving a list of tables

You can retrieve a list of the tables in a database with the call:

      >> info  = ltpda_dbquery(conn)
  

High-level queries

Various standard queries are envisaged which ask typical questions, such as: "Give me data for a particular signal spanning a particular time-span".

Formulating this question as an SQL query requires a good knowledge of the SQL syntax used by MySQL. The query has to search across multiple tables in order to gather the IDs of the objects that fulfill the query. For these standard questions, high-level functions will be built which perform the query given some input information. This avoids the user having to formulate complicated SQL statements.

The following high-level queries currently exist in the toolbox:
ltpda_getAOsInTimeSpanRetrieve particular AOs in the given time-span