Introduction | db-dumper-rust | Spatie       

 SPATIE  

db-dumper-rust
==============

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Db-dumper-rust](https://spatie.be/docs/db-dumper-rust/v1)  Introduction

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/db-dumper-rust/v1) 

  Introduction    
- [ Introduction ](https://spatie.be/docs/db-dumper-rust/v1/introduction)
- [ Support us ](https://spatie.be/docs/db-dumper-rust/v1/support-us)
- [ Requirements ](https://spatie.be/docs/db-dumper-rust/v1/requirements)
- [ Installation ](https://spatie.be/docs/db-dumper-rust/v1/installation)
- [ Usage ](https://spatie.be/docs/db-dumper-rust/v1/usage)
- [ Testing ](https://spatie.be/docs/db-dumper-rust/v1/testing)
- [ Changelog ](https://spatie.be/docs/db-dumper-rust/v1/changelog)
- [ Contributing ](https://spatie.be/docs/db-dumper-rust/v1/contributing)
- [ Security Vulnerabilities ](https://spatie.be/docs/db-dumper-rust/v1/security-vulnerabilities)
- [ Credits ](https://spatie.be/docs/db-dumper-rust/v1/credits)
- [ License ](https://spatie.be/docs/db-dumper-rust/v1/license)
- [ PHP parity ](https://spatie.be/docs/db-dumper-rust/v1/parity)

  Db-dumper-rust 
================

 Dump the contents of a database 

### Useful links

- [Repository](https://github.com/spatie/db-dumper-rust)
- [Discussions](https://github.com/spatie/db-dumper-rust/discussions)

Introduction
------------

This repo contains an easy to use crate to dump a database using Rust. Currently MySQL, MariaDB, PostgreSQL, SQLite and MongoDB are supported. Behind the scenes `mysqldump`, `mariadb-dump`, `pg_dump`, `sqlite3` and `mongodump` are used.

Here are simple examples of how to create a database dump with different drivers:

**MySQL**

```
use spatie_db_dumper::{MySql};

MySql::create()
    .set_db_name(database_name)
    .set_user_name(user_name)
    .set_password(password)
    .dump_to_file("dump.sql")?;
```

**MariaDB**

```
use spatie_db_dumper::{MariaDb};

MariaDb::create()
    .set_db_name(database_name)
    .set_user_name(user_name)
    .set_password(password)
    .dump_to_file("dump.sql")?;
```

**PostgreSQL**

```
use spatie_db_dumper::{PostgreSql};

PostgreSql::create()
    .set_db_name(database_name)
    .set_user_name(user_name)
    .set_password(password)
    .dump_to_file("dump.sql")?;
```

**SQLite**

```
use spatie_db_dumper::{Sqlite};

Sqlite::create()
    .set_db_name(path_to_database_file)
    .dump_to_file("dump.sql")?;
```

**MongoDB**

```
use spatie_db_dumper::{MongoDb};

MongoDb::create()
    .set_db_name(database_name)
    .set_user_name(user_name)
    .set_password(password)
    .dump_to_file("dump.gz")?;
```

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
