# `Electric.Replication.Eval.Env.ExplicitCasts`
[🔗](https://github.com/electric-sql/electric/tree/%40core/sync-service%401.6.2/packages/sync-service/lib/electric/replication/eval/env/explicit_casts.ex#L1)

Postgres has explicit casts, achievable via `::type` calls.
This module defines implementations for a subset of known ones.
"function name" column here is a function name in this module.

## List of explicit casts

| source    | target         | function name |
| --------- | -------------- | ------------- |
| bool      | int4           | bool_to_int4  |
| char      | int4           |               |
| int8      | bit            |               |
| int4      | bit            |               |
| int4      | bool           | int4_to_bool  |
| int4      | char           |               |
| text      | xml            |               |
| lseg      | point          |               |
| box       | point          |               |
| box       | lseg           |               |
| box       | circle         |               |
| polygon   | box            |               |
| polygon   | circle         |               |
| polygon   | point          |               |
| circle    | box            |               |
| circle    | point          |               |
| circle    | polygon        |               |
| bpchar    | xml            |               |
| varchar   | xml            |               |
| bit       | int4           |               |
| bit       | int8           |               |
| jsonb     | bool           |               |
| jsonb     | int8           |               |
| jsonb     | int2           |               |
| jsonb     | int4           |               |
| jsonb     | float4         |               |
| jsonb     | float8         |               |
| jsonb     | numeric        |               |
| int4range | int4multirange |               |
| numrange  | nummultirange  |               |
| tsrange   | tsmultirange   |               |
| tstzrange | tstzmultirange |               |
| daterange | datemultirange |               |
| int8range | int8multirange |               |
| xid8      | xid            |               |

# `bool_to_int4`

# `int4_to_bool`

# `known`

---

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