-
Notifications
You must be signed in to change notification settings - Fork 251
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
Embed quaint into prisma-engines #3905
Conversation
- Postgres BYTEA - SQLite datetime text format - deserialize_bytes in serde module
All macros now test both versions. The tag for 5.7 is `mysql` and for 8 `mysql8`.
Adds support of Common Table Expressions (CTE). The starting point is the `with` method of `Select`, allowing the user to add expressions to the queries `WITH` block. Additionally, on MSSQL queries if certain conditions apply, the query is converted to use the CTEs: - If comparing a tuple (a,b) against a selection of (SELECT x, y ..) - ... and both sides have as many variables, more than one Then a query where we do ```sql SELECT * FROM X WHERE (a, b) IN (SELECT x, y FROM ..) ``` converts into the following on SQL Server. ```sql WITH cte_0 AS (SELECT x, y FROM ..) WHERE a IN (SELECT x FROM cte_0 WHERE b = y) ``` This should work in every position of the query. The CTE is created to the first selection when going up the tree, adding multiple CTEs if having more than one tuple against select comparision, upping the index of the `cte` by one. Additionally, when comparing tuples, e.g. in a join context, we can do in the open source database the following: ```sql ON (a,b) = (x,y) ``` ... but in MSSQL we convert it to: ```sql ON a = x AND b = y ``` The same conversion applies to all tuple conversions in every position, either when comparing equals `=` or not `<>`.
Deal with it by actually having a compatibility function in the visiors.
- Defaults to `dbo` - Added to every query as an identifier
* Test and fix raw_cmd() on MySQL The previous behaviour was to return errors only for the first statement, without giving feedback on the success or failure of subsequent statements. This would also leave the connection in an invalid state for the next queries. We now consume all result sets from the server response in `raw_cmd()` on MySQL. This commit also includes as part of the fix an upgrade to mysql_async 0.24. * Use temporary tables in new tests * rustfmt * Move tests * Run raw_cmd test on all connectors
This does not fix everything, far from it, but this is a start.
This allows referring to possibly-nonexistent tables with their unqualified names in raw commands. Co-authored-by: Lily Chung <[email protected]>
* Ingores conditional docs generation as it cannot be applied to the value! macro. * Updates to docs to omit warnings * Uses upstream mobc * Updates connection-string dependencies
CodSpeed Performance ReportMerging #3905 Summary
|
2464cfd
to
f907d17
Compare
* quaint/main: (800 commits) chore: move all files into quaint subdir fix: set search path via query when pgbouncer is on (#453) Revert "Back to mainline mysql-async: (#450)" (#451) feat(pg): optimize search_path network roundtrip (#448) Back to mainline mysql-async: (#450) tech-debt: use upstream mobc + small fixes (#438) Add to_vec to a value (#446) Revert search_path and client-encoding optimization (#445) fix(pg): quote schema path (#443) Revert "Cargo.toml: connection-string 0.10.0 -> 0.14.0 (#437)" (#442) perf(pg): remove one roundtrip on connection (#441) Move rust-postgres fork to Prisma (#440) Cargo.toml: connection-string 0.10.0 -> 0.14.0 (#437) Revert "Updating to the latest mysql_async (#433)" (#435) We don't need to use our fork of mysql anymore (#434) Updating to the latest mysql_async (#433) chore: bump tiberius to 0.11.6 (#432) Emit query log in quaint:query span, rather than in its parent (#431) feat(PostgreSQL): support channel_binding query param (#424) added missing #[cfg(feature = "uuid")] (#420) ...
From: https://doc.rust-lang.org/cargo/reference/workspaces.html#the-members-and-exclude-fields > All path dependencies residing in the workspace directory automatically become members. [...] The moment we embedded quaint in prisma-engines, their crates became workspace members, and thus compiled as part of the build of the workspace. Because one of the crates in quaint (test-macros) had a circular dependency with quaint, this time enabling the `serde_support` flag, cargo tried to compile quaint with that feature enabled as part of the workspace, causing the compilation error in the `sql-query-connector` crate that assumed the `serde_support` feature was not enabled.
8ab1f8a
to
2e5c453
Compare
5589009
to
3c7284f
Compare
ef524ca
to
3c7284f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
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.
Very nicely executed!
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.
Is this on quaint main too? That looks like something that was potentially committed by mistake. We can merge and delete later too.
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.
It is, I don't know if by mistake also in quain yet. Will investigate and remove if that's the case!
This PR:
/quaint
path, preserving quaint's history/quaint/**
or the PR is merged into mainNotes for reviewers:
/quaint
is pulled from the git repository's main branch. You only need to focus on files outside that directory.