# DSApi (Database APIs)

Some database APIs take a special parameter called **auditMsg.** It is optional. It is used to create an audit-log of database operations. When it is provided its behavior is as follows:

* If **auditMsg** is non-blank then the provided string is logged into a special table called **AuditLog\_tbl.**
* If **auditMsg** is provided buts its value in an empty string or a string with the value "true", the system generates the log message which corresponds to the operation. For example, "Deleted \<id of the record>.
* Each log message has a timestamp, user-id of the user if the operation is performed in the context of a user.

{% hint style="info" %}
Each database API is a static method of a special Java class called **DSApi.**
{% endhint %}

## Primary Key

Each table created using Trillo Workbench creates the following columns. Each column except the **id** column is optional (can be removed). The column **id** is required for all newly created tables. Its type is **BigInteger** and it is auto-assigned by the database.

The list of columns (attributes assigned to the class) automatically created for a table is as follows:

| **Name**  | **Type**   | **Description**                                                                                                                                                                                                                               |
| --------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id        | BigInteger | The primary key of record, auto-assigned                                                                                                                                                                                                      |
| createdAt | BigInteger | The time of the creation of the record in UTC (epoch)                                                                                                                                                                                         |
| updatedAt | BigInteger | The time the record was updated last.                                                                                                                                                                                                         |
| deleted   | Boolean    | Trillo APIs "**delete"** do not delete a record. They mark the record as deleted. APIs A flag to indicate this record is logically deleted. It will be opaque in all queries and API unless a special flag is used to included deleted items. |
| deletedAt | BigInteger | The time the record was deleted.                                                                                                                                                                                                              |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://trillo.gitbook.io/trillo-workbench-java-sdk/database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
