Code Monkey home page Code Monkey logo

psqlpy's People

Contributors

chandr-andr avatar insani7y avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

psqlpy's Issues

Benchmarking..

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
image
psqlpy slower than all of other driver: aiopg, psycopg, asyncpg, etc.

Can you help me understand why your beanchmark give better results?

SSL is required

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?

Context manager for ConnectionPool#connection method

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")

Change PSQLPool connection method to sync and add async context manager

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.

Add `close` method for `PSQLPool`

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.