# TYPEOF

> TYPEOF function in StackQL: the storage type of a value, one of null, integer, real, text or blob.

Source: https://stackql.io/language-spec/functions/general/typeof

Returns the storage type of a value: `null`, `integer`, `real`, `text` or `blob`.  Object and array fields from provider responses are stored as JSON text, so they report `text`.

See also:  
[[` SELECT `]](/language-spec/select) [[ Data Types ]](/language-spec/data-types) [[` JSON_TYPE `]](/language-spec/functions/json/json_type)

* * * 

## Syntax

```sql
SELECT TYPEOF(expression) FROM <multipartIdentifier>;
```

## Arguments

__*expression*__  
Any expression.

## Return Value(s)
Returns a string.

* * *

## Examples

### Types of literal values

Each literal reports its own type:

```sql
SELECT TYPEOF(42) AS i, TYPEOF(4.2) AS r, TYPEOF('42') AS t, TYPEOF(NULL) AS n, TYPEOF(x'00') AS b;
```

```
|------|---------|------|------|------|
|  b   |    i    |  n   |  r   |  t   |
|------|---------|------|------|------|
| blob | integer | null | real | text |
|------|---------|------|------|------|
```

### Types of provider fields

The following query shows the types of an integer field, an array field and an object field that is sometimes missing in GitHub repository rows:

```sql
SELECT name,
TYPEOF(stargazers_count) AS stars_type,
TYPEOF(topics) AS topics_type,
TYPEOF(license) AS license_type
FROM github.repos.repos
WHERE org = 'stackql-labs';
```

For more information, see [https://www.sqlite.org/lang_corefunc.html#typeof](https://www.sqlite.org/lang_corefunc.html#typeof)
