# `Arex.Sql`
[🔗](https://github.com/m/exarcade/blob/v0.1.0/lib/arex/sql.ex#L1)

Lower-level SQL validation and query-building helpers.

Most application code should prefer `Arex.Record`, `Arex.Query`,
`Arex.Schema`, and the graph helpers. `Arex.Sql` is useful when extending
Arex or building custom wrappers on top of the same validation and boundary
rules.

This module is where Arex centralizes reusable SQL-oriented behavior such as:

- identifier and RID validation
- boundary stamping for inserts
- boundary-aware filter construction
- protection of system-managed or boundary-managed fields

Keeping those rules here lets higher-level modules stay small while still
sharing one consistent definition of tenant/scope behavior.

# `build_assignment_clause`

Builds a parameterized `set` clause from an attribute map.

# `build_filter_clause`

Builds a parameterized `where` clause from filters and the active boundary.

# `content_from_insert_attrs`

Drops system fields and stamps boundaries for insert content payloads.

# `drop_system_and_boundary_keys`

Drops system-managed and boundary keys before merge-style updates.

# `json_map`

JSON-encodes a map for inline SQL `content` and `merge` clauses.

# `matches_boundary?`

Returns whether a record matches the active `tenant` and `scope` boundary.

# `normalize_map`

Normalizes a map so all keys are strings.

# `reject_protected_attrs`

Rejects attribute maps that attempt to mutate protected or system-managed keys.

# `reject_protected_property`

Rejects protected property names that helper APIs must not mutate directly.

# `stamp_boundaries`

Stamps active `tenant` and `scope` values onto an attribute map.

# `type_from_attrs`

Resolves the effective type from record attrs and the resolved `type` option.

# `validate_identifier`

Validates a type, property, or other generated SQL identifier.

# `validate_index_name`

Validates an ArcadeDB index name, including bracketed names such as `Customer[field]`.

# `validate_rid`

Validates an ArcadeDB RID such as `#12:0`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
