Type Locking
Type locking lets you lock the data types of your connection's columns in the destination. Once type locking is enabled for a connection, during every sync, Fivetran determines if the data type of incoming data differs from the locked type. Fivetran then converts values of the changed types to the locked types, preventing unexpected type changes that could disrupt your data workflows.
See the Type Locking Matrix for details on how Fivetran maps data types when using type locking.
How to enable and disable type locking
To enable or disable type locking for a connection, follow these steps:
- In the Fivetran dashboard, navigate to the Connections page and click the desired connection.
- On the connection details page, go to the Schema tab.
- Click the Schema change settings button.
- Toggle the Lock source data type option to enable or disable it.
How type locking works
For existing connections, as soon as you enable type locking, Fivetran determines the data types of all existing columns in the destination. For new connections, Fivetran determines the data types of all existing column once the connection's initial sync completes. These data types are then locked, and any incoming data is converted to these locked types.
The following rules apply to type locking:
- A full re-sync with type locking enabled does not affect data types. If types were already locked, they remain locked during and after the full re-sync.
- Type locking does not affect key columns (primary key, pricing key, delete key). Data in these columns behaves the same as without type locking.
- Type locking does not prevent column hashing or encryption. If encryption or hashing is enabled, the column type changes to STRING, and type locking allows this change. However, if encryption or hashing is later disabled, the column type remains STRING.
- Type locking does not affect type dimensions. When type locking is active, string length or numeric precision and scale may still change (for example, string(50) > string(250), numeric(5,2) > numeric(20,5)), and type locking allows these updates.
New connections
When you enable type locking for a new connection:
- Type locking doesn't work until the initial sync is complete.
- Next, type locking locks the data types that were determined at the end of the initial sync.
- After the initial sync, type locking is applied to incoming columns during every sync as soon as Fivetran determines the data types of incoming columns.
Existing connections
When you enable type locking for an existing connections that has already completed its initial sync:
- Type locking takes effect during the next sync, locking the data types that exist at the time of activation.
- After the type locking activation, type locking is applied to incoming columns during every sync as soon as Fivetran determines the data types of incoming columns.