# tables/

This guide was generated by `xuda-cli`.

You can remove all generated folder guides later with:

~~~bash
npm run clean:readmes
~~~

Use this folder for table resources.

## File rules

- file type: `.table.json5`
- each file compiles to a Xuda `table` resource

## What belongs here

- table field definitions
- table indexes
- data model metadata used by the database plugin and datasource units

## Important rules

- keep fields explicit and predictable
- define indexes for access patterns you use often
- reference table ids from `get_data` and `set_data` units

## Example

~~~json5
{
  id: "student_profiles_table",
  menuTitle: "Student Profiles Table",
  fields: [
    { field_id: "student_id", type: "string" },
    { field_id: "full_name", type: "string" },
    { field_id: "email", type: "string" },
    { field_id: "campus", type: "string" }
  ],
  indexes: [
    { id: "campus_idx", name: "Campus", keys: ["campus"] }
  ]
}
~~~
