# oauth_clients

## Description

<details>
<summary><strong>Table Definition</strong></summary>

```sql
CREATE TABLE "oauth_clients" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar(255) NOT NULL, "redirectUris" text NOT NULL, "grantTypes" text NOT NULL, "clientSecret" varchar(255), "clientSecretExpiresAt" bigint, "tokenEndpointAuthMethod" varchar(255) NOT NULL DEFAULT ('none'), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')))
```

</details>

## Columns

| Name | Type | Default | Nullable | Children | Parents | Comment |
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
| id | varchar |  | false | [oauth_access_tokens](oauth_access_tokens.md) [oauth_user_consents](oauth_user_consents.md) [oauth_authorization_codes](oauth_authorization_codes.md) [oauth_refresh_tokens](oauth_refresh_tokens.md) |  |  |
| name | varchar(255) |  | false |  |  |  |
| redirectUris | TEXT |  | false |  |  |  |
| grantTypes | TEXT |  | false |  |  |  |
| clientSecret | varchar(255) |  | true |  |  |  |
| clientSecretExpiresAt | bigint |  | true |  |  |  |
| tokenEndpointAuthMethod | varchar(255) | 'none' | false |  |  |  |
| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false |  |  |  |
| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false |  |  |  |

## Constraints

| Name | Type | Definition |
| ---- | ---- | ---------- |
| id | PRIMARY KEY | PRIMARY KEY (id) |
| sqlite_autoindex_oauth_clients_1 | PRIMARY KEY | PRIMARY KEY (id) |

## Indexes

| Name | Definition |
| ---- | ---------- |
| sqlite_autoindex_oauth_clients_1 | PRIMARY KEY (id) |

## Relations

```mermaid
erDiagram

"oauth_access_tokens" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
"oauth_user_consents" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
"oauth_authorization_codes" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
"oauth_refresh_tokens" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"

"oauth_clients" {
  varchar id PK
  varchar_255_ name
  TEXT redirectUris
  TEXT grantTypes
  varchar_255_ clientSecret
  bigint clientSecretExpiresAt
  varchar_255_ tokenEndpointAuthMethod
  datetime_3_ createdAt
  datetime_3_ updatedAt
}
"oauth_access_tokens" {
  varchar token PK
  varchar clientId FK
  varchar userId FK
}
"oauth_user_consents" {
  INTEGER id
  varchar userId FK
  varchar clientId FK
  bigint grantedAt
}
"oauth_authorization_codes" {
  varchar_255_ code PK
  varchar clientId FK
  varchar userId FK
  varchar redirectUri
  varchar codeChallenge
  varchar_255_ codeChallengeMethod
  bigint expiresAt
  varchar state
  boolean used
  datetime_3_ createdAt
  datetime_3_ updatedAt
  varchar resource
  TEXT scope
}
"oauth_refresh_tokens" {
  varchar_255_ token PK
  varchar clientId FK
  varchar userId FK
  bigint expiresAt
  datetime_3_ createdAt
  datetime_3_ updatedAt
  TEXT scope
}
```

---

> Generated by [tbls](https://github.com/k1LoW/tbls)
