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.

Files for pgwebsocket, version 0.0.1b2
Filename, size File type Python version Upload date Hashes
Filename, size pgwebsocket-0.0.1b2-py3-none-any.whl (4.8 kB) File type Wheel Python version 3.5 Upload date Hashes View hashes
Filename, size pgwebsocket-0.0.1b2.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page