Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add getAllViews getAllTypes dropAllViews and dropAllTypes #124

Merged
merged 6 commits into from
Mar 8, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions content/reference/database/query-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,28 @@ console.log(tables)

---

### getAllViews
Returns an array of all the database views.

```ts
const views = await client.getAllViews()
console.log(views)
```

---

### getAllTypes
For Postgres/Redshift only
Julien-R44 marked this conversation as resolved.
Show resolved Hide resolved

Returns an array of all the database custom types.

```ts
const types = await client.getAllTypes()
console.log(types)
```

---

### columnsInfo
Returns a key-value pair of columns in a given database table.

Expand All @@ -124,6 +146,32 @@ console.log(columns)

---

### dropAllViews
Drop all views inside the database.

```ts
await client.dropAllViews()

// specify schemas ( for Postgres and Redshift )
await client.dropAllViews(['public'])
```

---

### dropAllTypes
For Postgres/Redshift only

Drop all types inside the database.

```ts
await client.dropAllTypes()

// specify schemas ( for Postgres and Redshift )
await client.dropAllTypes(['public'])
```

---

### truncate
Truncate a database table. Optionally you can also cascade foreign key references.

Expand Down