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

# stackshift database sleep

> Sleep when idle: pause a database nobody is using

> [!NOTE]
>
> This page is generated from the StackShift CLI command definitions.

Sleep when idle: pause a database nobody is using

### Synopsis

Sleep when idle pauses a PostgreSQL database after it has had no connections for the time you set, and wakes it on the next connection or with stackshift db wake. Turn it on with --after or off with --off.

```
stackshift database sleep DATABASE[/BRANCH] [flags]
```

### Examples

```
  stackshift db sleep shop-db --after 15m
  stackshift db sleep shop-db/fix-checkout --off
```

### Options

```
      --after duration   sleep after this much idle time, like 15m
  -h, --help             help for sleep
      --off              turn Sleep when idle off
```

### Options inherited from parent commands

```
      --api-url string       StackShift API URL
      --app string           application name or ID
      --color string         color output: auto, always, or never (default "auto")
      --debug                show request diagnostics
      --environment string   project environment
  -o, --output string        output format: table, json, yaml, or name (default "table")
      --profile string       configuration profile
      --project string       project name or ID
  -q, --quiet                suppress progress output
      --timeout duration     request timeout (default 30s)
      --token-file string    mode-0600 token file
      --token-stdin          read a CI token from stdin
  -y, --yes                  confirm risky operations
```

### SEE ALSO

* [stackshift database](https://docs.stackshift.cloud/cli-reference/stackshift_database.md)	 - Manage databases


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.