# Conventions

Following a set of database conventions improves the readability of the database schema and related SQL. Every DBA has their own thoughts about which convention to follow. This is ours, tailored for SQLite.

> **Note**: While we typically recommend **PascalCase** naming for Linx development (e.g., `UpdateCustomer`), SQLite stores identifier names exactly as written but comparisons are case-insensitive for ASCII characters by default.\
> To ensure consistency across tools and queries, we encourage **snake\_case** naming in SQLite.

## Naming

* Names must clearly describe the object.
* Use `snake_case` for all object names in SQLite.
* Avoid Hungarian notation (e.g., `int_number`).
* Avoid abbreviations unless they are widely recognized.

| Applies To | Convention       | Example           |
| ---------- | ---------------- | ----------------- |
| Tables     | `noun`, singular | `customer`        |
| Views      | `noun`           | `customer_orders` |
| Fields     | `noun`           | `surname`         |

{% hint style="info" %}
**Note**

SQLite does not support stored procedures. Use **ExecuteSQL** to run any SQL statement, including DDL, within your workflow.
{% endhint %}

> You **can** use PascalCase object names in SQLite **if** you **quote** them consistently in every SQL statement (e.g., `"Customer"`).\
> However, this is discouraged as it leads to more verbose and error-prone SQL.

## SQL Queries

* Use consistent indentation.
* Use **UPPERCASE** for SQL keywords: `SELECT`, `FROM`, `WHERE`, `JOIN`, etc.
* Use meaningful aliases — avoid single-letter or cryptic abbreviations.
* Use **single quotes** (`'string'`) for string literals.
* Use **double quotes** (`"identifier"`) only when necessary to refer to case-sensitive or reserved identifiers.

## Links

* [SQL Formatter by SQLFormat.org](https://sqlformat.org/)
* [SQLite SQL Language Reference](https://www.sqlite.org/lang.html)


---

# 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://docs.linx.software/reference/plugins/sqlite/conventions.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.
