-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mysql): Add seed support in MySQL (#552)
Ref #541. New capability of "seeding" a db container using image's support for /docker-entrypoint-initdb.d/ folder. Using the "transferable" system, borrowed from Kafka. Updates DbContainer to have a new (NOOP-default) `_transfer_seed()` method, run after `_start()` and before `_connect()`, to allow the folder transfer. Currently implemented only in MySQL, but extensible to others that use the `/docker-entrypoint-initdb.d/` system. --------- Co-authored-by: Jb DOYON <[email protected]>
- Loading branch information
1 parent
f761b98
commit 396079a
Showing
5 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Sample SQL schema, no data | ||
CREATE TABLE `stuff` ( | ||
`id` mediumint NOT NULL AUTO_INCREMENT, | ||
`name` VARCHAR(63) NOT NULL, | ||
PRIMARY KEY (`id`) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- Sample data, to be loaded after the schema | ||
INSERT INTO stuff (name) | ||
VALUES ("foo"), ("bar"), ("qux"), ("frob"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters