Skip to content

Other examples? #1

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

Closed
illume opened this issue Jul 20, 2016 · 4 comments
Closed

Other examples? #1

illume opened this issue Jul 20, 2016 · 4 comments
Labels

Comments

@illume
Copy link

illume commented Jul 20, 2016

Hello!

Are there any other examples or projects other than the tests? I searched for asyncpg on nulledge/SearchEngines and couldn't find anything.

Currently I'm interested in if you can stream results from/to pg?

Many thanks.

@1st1
Copy link
Member

1st1 commented Jul 20, 2016

Hi @illume,

We've only open sourced asyncpg yesterday, so I believe there aren't a lot of examples with it that you can find.

Currently I'm interested in if you can stream results from/to pg?

Postgres doesn't provide streaming capabilities. The closest thing you can get is to use cursors to efficiently iterate over huge result sets.

@1st1 1st1 added the question label Jul 20, 2016
@illume
Copy link
Author

illume commented Jul 20, 2016

Aha! Well that explains why I can't find anything on the internet about it.

If I have one row that is about 1MB (bytea https://www.postgresql.org/docs/9.5/static/datatype-binary.html), does that mean I have to wait until it is entirely written in a buffer before getting access to the full buffer? Or can I get access to the buffer with an index of where it is up to? I guess I will look through the source.

I will also be using LISTEN and NOTIFY ( https://www.postgresql.org/docs/9.5/static/sql-listen.html ).

Anyway... looking forward to playing with it some more.

@illume illume closed this as completed Jul 20, 2016
@1st1
Copy link
Member

1st1 commented Jul 20, 2016

I will also be using LISTEN and NOTIFY ( https://www.postgresql.org/docs/9.5/static/sql-listen.html ).

Yes, see issue #2. We'll implement this shortly.

@illume
Copy link
Author

illume commented Jul 21, 2016

Oh! Thank you very much :)

elprans added a commit that referenced this issue Nov 7, 2021
This adds a check that elements of sequence passed to `executemany()`
are proper sequences themselves and notes the offending sequence element
number in the exception message.  For example:

    await self.con.executemany(
        "INSERT INTO exmany (b) VALUES($1)"
        [(0,), ("bad",)],
    )

    DataError: invalid input for query argument $1 in element #1 of
               executemany() sequence: 'bad' ('str' object cannot be
	       interpreted as an integer)

Fixes: #807
elprans added a commit that referenced this issue Nov 16, 2021
This adds a check that elements of sequence passed to `executemany()`
are proper sequences themselves and notes the offending sequence element
number in the exception message.  For example:

    await self.con.executemany(
        "INSERT INTO exmany (b) VALUES($1)"
        [(0,), ("bad",)],
    )

    DataError: invalid input for query argument $1 in element #1 of
               executemany() sequence: 'bad' ('str' object cannot be
               interpreted as an integer)

Fixes: #807
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants