-
Notifications
You must be signed in to change notification settings - Fork 470
Document an async version of the Python client #7507
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
Comments
cc @cockroachdb/review-my-python |
That's not true in this example; it's only executing one statement at a time. Instead, it's running in to this incompatibility between CRDB and asyncpg.
Asynchronous python is for our purposes almost like a separate language from regular python - the drivers, orms, etc are all different so it'd be a parallel set of docs with hardly any overlap with the other python docs. It's fairly low priority for now - maybe a hello world example but I wouldn't invest in anything further. |
Hey there. I'm the engineer referenced in the OP. This doesn't sound strictly like a CRDB issue, but I did notice that using two different query variants from I was curious if this was because asyncpg issues different statements, but I re-ran the samples against postgres with more aggressive logging, and postgres showed the exact same logs. Perhaps my log settings weren't aggressive enough or maybe it's at the protocol level (?). In any case, just adding some some more context just in case any other people run into the same issue. |
The AppDev team will plan to get to this (and give a closer look at asyncpg in general) after we finish up some work on Java and .NET tooling. |
Notes for using
However, it uses the system CA certificates, so this is optional if we're using a trusted certificate. |
Eagerly awaiting developments on this topic as I'm looking to move a substantial project to cockroach on async python away from aiomysql. @bdarnell |
Wanted to mention, you can add your user cert/key and ca cert using this: ssl_context = ssl.create_default_context()
ssl_context.load_cert_chain(certfile="./certs/client.root.crt", keyfile="./certs/client.root.key")
ssl_context.load_verify_locations(cafile="./certs/ca.crt")
conn = await asyncpg.create_pool(
user='root',
# ...
ssl=ssl_context
) Setting these directly as connection parameters ( |
Not a showstopper but this issue regarding enums and prepared statements resulting in |
Version 21.2 of CockroachDB will support correlated CTEs (cockroachdb/cockroach#63956) -- hopefully that will help. |
@rafiss Thanks, your comment made my day. When is 21.2 expected to release? Looking forward to it! |
It is scheduled to be released in November. |
Jesse Seldess (jseldess) commented: |
Eric Harmeling (ericharmeling) commented: |
Raphael ‘kena’ Poss (knz) commented:
A customer came to us with the following story (paraphrased)
I advised the customer that their addition of async/await is causing their Python to issue multiple concurrent statements on the same connection object, which nternally uses multiple concurrent portals, which are not supported in crdb.
However this is not easy to understand, and we do not warn for it inside our tutorials.
I think our Python tutorials should cover uses of async/await and provide an example that works with it.
Jira Issue: DOC-535
The text was updated successfully, but these errors were encountered: