-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Allow new databases/keyspaces to run in foreignKeyMode=managed
by default (in vttestserver
)
#14661
Comments
I would think that after you have created a database, you can always run ApplyVschema command with a new Vschema that specifies the foreign key mode to |
That would be pretty cool. |
I just verified, it currently does't work with vttestserver, because of the hard-coded bind address it provides to vtcombo. I am working on fixing this. Work in progress PR - #14665 |
I was able to test my changes and make the required adjustments to get vtctdclient commands to work with vttestserver - #14665 |
@janpio once that PR is merged, I believe you will be able to use it. I have added all the steps I followed to create a new database in vttestserver and then change its foreign key mode to managed. Please follow those steps and it should work as intended. |
@janpio Please let me know if you have any other concerns, but I believe the recent changes should fix your use case. |
Feature Description
Currently one has to define all the keyspaces/databases for
vttestserver
before starting the container, as anyCREATE DATABASE
will just create aforeignKeyMode=unmanaged
keyspace/database, and there is no way to change it at runtime either.It would be great if one could configure
vttestserver
to default tomanaged
instead.Use Case(s)
We want to test our Prisma ORM against Vitess, with
foreignKeyMode=managed
. Our test suite works by creating a lot of databases for test isolation. That means we can unfortunately not gather or provide the list of all keyspaces/databases prior to starting the Docker container ofvttestserver
. (The list might even become too long for an env var, in our test setup.)(Related question on how to confirm the mode functionally, not via
SHOW KEYSPACES;
: #14660)The text was updated successfully, but these errors were encountered: