Client APIs
Usage
In addition to connecting to a database when opening the CLI, a new database connection can be made by using the `.open` command. If no additional parameters are supplied, a new in-memory database connection is created. This database will not be persisted when the CLI connection is closed.  
```text
.open
```  
The `.open` command optionally accepts several options, but the final parameter can be used to indicate a path to a persistent database (or where one should be created). The special string `:memory:` can also be used to open a temporary in-memory database.  
```text
.open persistent.duckdb
```  
> **Warning.  ** `.open` closes the current database.
> To keep the current database, while adding a new database, use the [`ATTACH` statement](#docs:sql:statements:attach).  
One important option accepted by `.open` is the `--readonly` flag. This disallows any editing of the database. To open in read only mode, the database must already exist. This also means that a new in-memory database can't be opened in read only mode since in-memory databases are created upon connection.  
```text
.open --readonly preexisting.duckdb
```