Skip to main content

Async websocket to PostgreSQL proxy

Project description

from pgwebsocket import PgWebsocket

app = PgWebsocket(
    "postgresql://"
)

@app.on_connect
async def on_connect(ctx):
    """"""
    ctx.subscribed = []
    await ctx.execute("LISTEN all;")

@app.on_disconnect
async def on_disconnect(ctx):
    """"""
    await ctx.execute("UNLISTEN all;")

if __name__ == '__main__':
    app.run()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pgwebsocket-0.0.1b2.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

pgwebsocket-0.0.1b2-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page