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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Yes, @fretje is right. It is possible to rename. I think it will be change to public and support database naming. |
Beta Was this translation helpful? Give feedback.
-
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!
Beta Was this translation helpful? Give feedback.
All reactions