# Tables

`Xmf\Database\Tables` is a class to simplify creating and modifying database tables. When a module is first installed, there is an automatic mechanism to create the module related tables. For migrations, changes to the schema after installations, there has been no standard solution.

This class is used to build and execute a work queue of [DDL](https://en.wikipedia.org/wiki/Data_definition_language) statements to modify database tables. The current schema is loaded for each referenced table, and creation of the work queue considers that current state while determining the work to be done (i.e. it will not attempt a CREATE of an existing table.)

All methods with create or alter tables, columns, indexes or data require a table that is already established using `addTable()` or `useTable()`.

No alterations are made to the database until the work queue is executed by invoking `executeQueue()`.

* [Getting Started](/xmf-cookbook/reference/database/tables/getting-started.md)
* [Table Operations](/xmf-cookbook/reference/database/tables/table-operations.md)
* [Working with Columns](/xmf-cookbook/reference/database/tables/working-with-columns.md)
* [Working with Indexes](/xmf-cookbook/reference/database/tables/working-with-indexes.md)
* [Changing Table Data](/xmf-cookbook/reference/database/tables/changing-table-data.md)
* [Interacting with the Work Queue](/xmf-cookbook/reference/database/tables/interacting-with-the-work-queue.md)
* [Error Info and Debugging](/xmf-cookbook/reference/database/tables/error-info-and-debugging.md)


---

# 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://xoops.gitbook.io/xmf-cookbook/reference/database/tables.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.
