> ## Documentation Index
> Fetch the complete documentation index at: https://docs.turso.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# DROP TYPE

> Remove a user-defined custom type from the database

# DROP TYPE

<Info>
  **Turso Extension**: DROP TYPE is a Turso-specific statement not available in standard SQLite. This feature is experimental and must be [enabled before use](/sql-reference/experimental-features).
</Info>

The DROP TYPE statement removes a user-defined custom type from the database. Once dropped, the type name can no longer be used in new column definitions.

## Syntax

```sql theme={null}
DROP TYPE [IF EXISTS] type-name;
```

## Description

DROP TYPE removes the named custom type from the database. The type must exist unless the `IF EXISTS` clause is specified.

### Clauses

| Clause      | Description                                                                                                            |
| ----------- | ---------------------------------------------------------------------------------------------------------------------- |
| `IF EXISTS` | Suppresses the error that would occur if the type does not exist. The statement is a no-op when the type is not found. |
| `type-name` | The name of the custom type to remove.                                                                                 |

### Restrictions

A type cannot be dropped while any table column uses it. All columns of that type must be removed or the table must be dropped before the type can be dropped.

```sql theme={null}
CREATE TYPE cents BASE integer ENCODE value * 100 DECODE value / 100;

CREATE TABLE prices (
    id INTEGER PRIMARY KEY,
    amount cents
) STRICT;

-- This fails because the 'prices' table has a column of type 'cents'
DROP TYPE cents;
-- Error: type 'cents' is in use

-- Drop the table first, then the type
DROP TABLE prices;
DROP TYPE cents;
```

## Examples

### Drop a Custom Type

```sql theme={null}
CREATE TYPE reversed_text BASE text
    ENCODE turso_reverse(value)
    DECODE turso_reverse(value);

DROP TYPE reversed_text;
```

### Drop a Type with IF EXISTS

```sql theme={null}
-- Safe to run even if the type does not exist
DROP TYPE IF EXISTS reversed_text;
```

## See Also

* [CREATE TYPE](/sql-reference/statements/create-type) for defining custom types
* [DROP DOMAIN](/sql-reference/statements/drop-domain) for removing domains
* [Data Types](/sql-reference/data-types) for an overview of the type system
