Repository navigation
Replies: 3 comments 7 replies
Yes, the Microsoft SQL Server image does not support configuring a database name by default. To create a custom database, you can follow the steps mentioned here. You need to copy the scripts via WithResourceMapping to the container before it starts. Or use as mentioned EF or a client library. |
|
I'm also interested to know why this is not supported. Also, the link you're referring to, to "create a custom database" talks about building a whole new image. I want to use the standard sqlserver 2022 image (which is perfectly possible with the "WithImage" method), simply with another database name (which was perfectly possible with TestContainers 2.3.0 with the "WithDatabase" method). Having to build a whole new docker image, just for that, seems like a bit overkill. |
|
Yes, @fretje is right. It is possible to rename. I think it will be change to public and support database naming. |
Uh oh!
There was an error while loading. Please reload this page.
Is there a reason why WithDatabase is declared private on the MsSqlBuilder?
I would like to work in a self named database instead of master to execute my EF Core migrations.
Thanks in advance!
All reactions