Skip to content

Commit 648c0be

Browse files
author
Kay Kasemir (ky9)
committed
Python example
1 parent 5c8ea23 commit 648c0be

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

services/archive-engine/doc/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,19 @@ To test access, try this from any user account on the same host::
120120
SELECT * FROM channel;
121121
\q
122122

123+
Example for python access::
124+
125+
pip install psycopg
126+
127+
python3
128+
129+
import psycopg
130+
with psycopg.connect("host=127.0.0.1 user=report password=$report dbname=archive") as conn:
131+
with conn.cursor() as cur:
132+
cur.execute("SELECT channel_id, name FROM channel")
133+
for row in cur:
134+
print("#%5d - %s" % (row[0], row[1]))
135+
123136

124137
View Archive Data
125138
-----------------

0 commit comments

Comments
 (0)