Skip to content

Conversation

k2idev
Copy link
Contributor

@k2idev k2idev commented Mar 6, 2021

Hi,

I have added two new features.

  1. Ability to exclude a table from the export:

Sometimes you might not want to include all tables in the export. You can achieve this with:

return [
    'default' => DumpSchema::define()
                    ->allTables()
                    ->exclude('password_resets')
                    ->exclude('migrations');
];
  1. Ability to create INSERTs with multiple rows

When you have a table with many rows (1000+) creating INSERT statements for each row results in a very slow import process. For these cases it is better to create INSERT statements with multiple rows.

You can achieved this with ->outputInChunksOf($n).

return [
    'default' => DumpSchema::define()
        ->allTables(),
        ->table('users', function($table) { 
                return $table->outputInChunksOf(25); 
            });
];

Tests

  • I have fixed the existing tests (they used artisan db:dump instead of db:masked-dump)
  • I have added a test for exclude()
  • I have added a test for outputInChunksOf()

Documentation

I have added two sections describing the features in the Readme.md file.

Liebe Grüße
Alex

PS: It's my first pull request ever for an open source project ... so I hope I didn't miss anything :)
PPS: Thank you for all the great work and stuff you are providing!

k2idev added 7 commits March 5, 2021 08:13
Added test for exclude()
Added new test snapshot
Fixed all existing tests (-> wrong artisan command name)
to allow for generation of chunked INSERT statements
Added test for outputInChunksOf()
Added snapshot
Modified LaravelMaskedDump::dumpTableData() to check for chunked output generation
mechelon added a commit that referenced this pull request Sep 26, 2024
mechelon added a commit that referenced this pull request Sep 26, 2024
@mechelon
Copy link
Member

Integrated with modifications in #20, so I'm closing this. Thanks!

@mechelon mechelon closed this Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants