FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cql-python-driver/example.py at master · CovenantSQL/cql-python-driver · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
CovenantSQL
/
cql-python-driver
Public
Notifications
You must be signed in to change notification settings
Fork
5
Star
6
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cql-python-driver
/
example.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (26 loc) · 849 Bytes
Breadcrumbs
cql-python-driver
/
example.py
Copy path
File metadata and controls
33 lines (26 loc) · 849 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
from
__future__
import
print_function
import
pycovenantsql
print
(
pycovenantsql
.
get_client_info
())
conn
=
pycovenantsql
.
connect
(
dsn
=
'covenantsql://0a10b74439f2376d828c9a70fd538dac4b69e0f4065424feebc0f5dbc8b34872'
,
host
=
"adp00.cn.gridb.io"
,
port
=
7784
)
cur
=
conn
.
cursor
()
print
(
cur
.
description
)
cur
.
execute
(
'''create table if not exists test_python_driver(
name text not null,
primary key(name)
)'''
)
print
(
cur
.
description
)
cur
.
execute
(
"replace into test_python_driver values('test'), ('test2'), ('test3'), ('test4')"
)
print
(
cur
.
description
)
cur
.
execute
(
" SELECT * FROM test_python_driver"
)
print
(
cur
.
description
)
cur
.
execute
(
"desc test_python_driver"
)
print
(
cur
.
description
)
for
row
in
cur
:
print
(
row
)
cur
.
execute
(
"show tables"
)
for
row
in
cur
:
print
(
row
)
cur
.
close
()
conn
.
close
()
Back
|
FazBrowse Home
|
New Git URL