-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
test(integration): run integration test for TiDB #14631
Conversation
If it is possible, I would like to add this set of tests to GitHub Action. |
Hi @Mini256 Thanks for your interest in adding tests for a new database (TiDB)! I'm also curious about it, though let me explain the situation about new databases: Prisma is currently focusing on the existing supported database providers (PostgreSQL, MySQL, MariaDB, CockroachDB, SQLite & MongoDB), and we do not plan to add or put effort to support new databases at the moment. About adding support to a new database, from our experience, it requires a lot of effort and often additional code even when a database claims to be "fully wire compatible with X". It would be helpful for us if you could open a feature request issue here about adding support for TiDB to Prisma, so we can collect all the interest from different people in one place. Feel free to add context about this, it really helps to understand why this would be important, for example. |
Note @Mini256 So, this would only be merged if we decide that
If, for example, tests would all pass, and this is essentially the same as a currently supported provider like MySQL/MariaDB, that might change our opinion, and we might be much more open to talk about it for getting a product decision 👍🏼 |
Thanks for your PR @Mini256, exciting. The most important thing that Joel wrote is our wish for a feature request issue for TiDB support. That is where everything starts in our process. Still, this PR is great as it just shows what is working, and what is not. To give you some more input:
We actually already support PlanetScale/Vitess that also does not support foreign keys (you can read more about this here: https://www.prisma.io/docs/guides/database/using-prisma-with-planetscale), but are not explicitly testing that here in this repository. In |
Hello Jan and Joel, Thank you for your detailed responses. We have filed a feature request to support TiDB to Prisma: #14639. We are also completing part of the monorepo tests. We will try the tests on prisma-engines next and keep you guys posted. I totally understand your need to prioritize your support for databases. However, we are an open source database trying to get traction in the marketplace. We need support from great software like Prisma to get going, so we have somewhat of a chicken and egg thing here - to get more customers we need Prisma, but to get into Prisma, we need more customers. If we are willing to put in engineering resources to help with the tests, integration and anything else, would you be more open to adding TiDB to your list of supported databases? Ghim |
Thanks @ghimsim for that context. Disclaimer: I can only speak for the Engineering org side of Prisma, not the Product one (but their concerns would probably be similar). As you certainly know, even if you help us develop this initially, there is a long tail of follow on costs that Prisma will have to carry. Random examples: Longer test runtimes, additional complexity in developing new features, additional things to keep in mind when debugging or making changes. Those are all real costs that can not be prevented even if you promise to help us with this "forever". So currently this PR and discussion is mostly figuring out the current state of Prisma + TiDB:
So for now, figuring out exactly what is happening here and seeing what happens in |
@Mini256 took this suggestion, and prisma/prisma-engines#3308 now exists <3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update image to v7.0.0
CodSpeed Performance ReportMerging #14631 Summary
Benchmarks breakdown
|
Unblocks testing forks Example: #14631 [skip ci]
Note: I noticed tests were not running and fixed that in 82a1154 |
Thank you for submitting this PR, @Mini256! We mentioned in our documentation that TiDB has a community-maintained driver adapter. This driver adapter already allows users to effortlessly query TiDB databases. Thus, we currently do not plan to merge this PR and prisma/prisma-engines#3308. |
What does this PR do?
In this PR, I will replicate the MySQL integration test case to test TiDB.
part of #14639
About TiDB
Test steps
cd packages/integration-tests cp -r ./src/__tests__/integration/mysql ./src/__tests__/integration/tidb
tiup playground
Found issues
In the first running of test, 4 test cases failed:
posts_ibfk_1
, but in TiDB isfk_1
)orderBy: { job: 'asc' }
for the testcase)The first running result
Finally, after some minor changes mentioned above, all test cases can be passed by TiDB.