qaspen-python / psqlpy Goto Github PK
View Code? Open in Web Editor NEWAsynchronous Python PostgreSQL driver written in Rust
Home Page: https://qaspen-python.github.io/
License: MIT License
Asynchronous Python PostgreSQL driver written in Rust
Home Page: https://qaspen-python.github.io/
License: MIT License
Hello, thank you for great job.
I added your driver to pgbeanch from MagicStack team. And result super different then your.
Full report https://public.jmarkin.ru/pgbeanch.html
Example result
psqlpy slower than all of other driver: aiopg, psycopg, asyncpg, etc.
Can you help me understand why your beanchmark give better results?
I'm trying to connect using ConnectonPool and getting an error
psqlpy.exceptions.RustPSQLDriverPyBaseError: Database engine pool exception: Error occurred while creating a new object: db error: ERROR: odyssey: c1fc39c4c6d6c: SSL is required
My connection string works for all of the other existing drivers
Do you have any workaround?
ATM to use connection we need to write the following code:
connection_pool = psqlpy.ConnectionPool()
conn = await connection_pool.connection()
conn.execute("SELECT * from users")
But it would be more pythonic to use context manager here like:
connection_pool = psqlpy.ConnectionPool()
async with connection_pool.connection() as conn:
conn.execute("SELECT * from users")
Need to make chainable Connection Pool builder like in rust library.
Need to make PSQLPool.connection()
method sync and add async context manager to it.
Main idea:
connection
method will create new Connection
(1) object with structure connection: None, db_pool: . And when user will call any method on connection(1), we need to acquire db pool for read, retrieve new connection(2), put it in our Connection
(1) object and then use only connection(2) for querying.
Add async context manager like in Transaction
.
Try to add close() method for connection(1) to use Drop
trait.
By default, rust closes connection pool automatically when pool is dropped. But some people may want to close connection pool manually.
So, it's necessary to add close
method.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.