-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Trying to get node-postgres working with a streaming database that uses the postgres protocol. From the docs I cut a section and added it below. Having trouble getting it to work. Does this driver support something like cursor.copy_expert("TAIL some_materialized_view", sys.stdout)?
In terms of the pgwire protocol, TAIL is handled as a non-standard COPY TO statement. As long as your driver lets you send your own COPY statement to the running Materialize node, you can TAIL updates from Materialize anywhere you’d like.
#!/usr/bin/env python3
import sys
import psycopg2
def main():
dsn = 'postgresql://localhost:6875/materialize?sslmode=disable'
conn = psycopg2.connect(dsn)
with conn.cursor() as cursor:
cursor.copy_expert("TAIL some_materialized_view", sys.stdout)
if __name__ == '__main__':
main()
Metadata
Metadata
Assignees
Labels
No labels