> For the complete documentation index, see [llms.txt](https://fivesobes.gitbook.io/nexorm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fivesobes.gitbook.io/nexorm/schema/decorators.md).

# Decorator's

### <mark style="color:yellow;">`@Schema`</mark>

*The* <mark style="color:yellow;">**`@Schema`**</mark> *program processes the schema and makes it ready for saving to the table, it is mandatory<mark style="color:red;">**\***</mark> to use it when creating a model.*

<mark style="color:purple;">**`@Timestamps`**</mark>

*The* <mark style="color:purple;">**`@Timestamps`**</mark> *decorator automatically adds* **`createdAt`** *and* **`updatedAt`** *columns to the model. These columns store the creation and last update timestamps, with the* **`updatedAt`** *column being automatically updated on every change. Using* <mark style="color:purple;">**`@Timestamps`**</mark> *is optional and can be included as needed to simplify timestamp management in your models.*

<mark style="color:purple;">**`@Paranoid`**</mark>

*The* <mark style="color:purple;">**`@Paranoid`**</mark> *decorator enables soft deletion for the model by adding a* **`deletedAt`** *column. Instead of permanently removing a record, it sets a timestamp in the* **`deletedAt`** *column when the record is deleted. This allows the data to be retained and queried if needed.* *Using* <mark style="color:purple;">**`@Paranoid`**</mark> *is optional and can be implemented when soft delete functionality is required.*

<mark style="color:purple;">**`@Force`**</mark>

*The* <mark style="color:purple;">**`@Force`**</mark> *option in sync is used to drop and recreate the table in the database. When* <mark style="color:purple;">**`@Force`**</mark> *is set to true, it completely removes the existing table, including all its data, and creates a new table based on the current model definition. This is useful for development purposes to quickly apply model changes,* *<mark style="color:red;">**`but it should be used with caution in production environments as it results in data loss.`**</mark>*

<mark style="color:purple;">**`@Debug`**</mark>

*The* <mark style="color:purple;">**`@Debug`**</mark> *decorator logs all operations performed on the schema where it is used. It provides detailed information about actions such as creation, updates, deletions, and queries, making it easier to debug and monitor database interactions. Using* <mark style="color:purple;">**`@Debug`**</mark> *is optional and can be enabled when you need better insight into schema-level operations.*

<mark style="color:purple;">**`@Provider`**</mark><mark style="color:orange;">**`(`**</mark>**`providerName:`**<mark style="color:blue;">**`string`**</mark><mark style="color:red;">**`)`**</mark>

*The* <mark style="color:purple;">**`@Provider`**</mark> *decorator specifies which model the schema will be associated with, particularly in scenarios involving multiple connections or databases. It should be placed above the class structure and below other schema decorators. By default, the* <mark style="color:purple;">**`@Provider`**</mark> *decorator uses* **`'nexorm'`** *as the default connection. This makes it easier to manage and organize schemas across various database setups when working with multiple data sources.*

## *For Example*

```typescript
import { 
  Schema, 
  Timestamps, 
  Paranoid,
  Force,
  Debug,
  Provider
} from 'nexorm/decorators';


@Schema
@Timestamps
@Paranoid
@Force
@Debug
@Provider('nexorm')
class anySchemaInterface {
/*
......
.....
*/
};
```
