Clone this database into a new temporary [`Pglite`] instance.
(&mut self)
| 418 | |
| 419 | /// Clone this database into a new temporary [`Pglite`] instance. |
| 420 | pub fn try_clone(&mut self) -> Result<Self> { |
| 421 | #[cfg(feature = "extensions")] |
| 422 | let extensions = self.bundled_extensions_in_database()?; |
| 423 | let archive = self.dump_data_dir_with_format(DataDirArchiveFormat::Tar)?; |
| 424 | let builder = Self::builder().temporary().load_data_dir_archive(archive); |
| 425 | #[cfg(feature = "extensions")] |
| 426 | let builder = builder.extensions(extensions); |
| 427 | builder.open() |
| 428 | } |
| 429 | |
| 430 | /// Run the bundled WASIX `pg_dump` against this database and return SQL text. |
| 431 | #[cfg(feature = "extensions")] |