Skip to content
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

README missing Database Port number in the example. #469

Open
trraghav opened this issue Jul 24, 2019 · 1 comment
Open

README missing Database Port number in the example. #469

trraghav opened this issue Jul 24, 2019 · 1 comment

Comments

@trraghav
Copy link

  • asyncpg version:
  • PostgreSQL version:
  • Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
    the issue with a local PostgreSQL install?
    :
  • Python version:
  • Platform:
  • Do you use pgbouncer?:
  • Did you install asyncpg with pip?:
  • If you built asyncpg locally, which version of Cython did you use?:
  • Can the issue be reproduced under both asyncio and
    uvloop?
    :

Not a bug or issue, I saw the example in the README section..

import asyncio
import asyncpg

async def run():
    conn = await asyncpg.connect(user='user', password='password',
                                 database='database', host='127.0.0.1')
    values = await conn.fetch('''SELECT * FROM mytable''')
    await conn.close()

loop = asyncio.get_event_loop()
loop.run_until_complete(run())

A database port number is missing in the example, I know Postgres default port is 5432, but in example if we give the details about the port it will be more clear to reader about the port parameter to use for different database instance.. Was it intentional to leave port number or its error ?

--Raghav

@vitaly-burovoy
Copy link
Contributor

Examples are not about possible keys, they are about how to use a code (with a minimum code/params).
Otherwise we'd end up showing all 16 params[1] of asyncpg.connect...

People who use non-standard port for DBMS usually know how to search in a documentation.
Personally I do not see anything should be added to this example.


[1] https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.connection.connect

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

No branches or pull requests

2 participants