Skip to content

Commit 7348077

Browse files
authored
Update README.md
Fix README markup
1 parent 1536537 commit 7348077

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

README.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,44 @@ Python DBAPI to `YDB`, which provides both sync and async drivers and complies w
66

77
## Installation
88

9-
**TBD after first release**
9+
```shell
10+
pip install ydb-dbapi
11+
```
1012

1113
## Usage
1214

1315
To establish a new DBAPI connection you should provide `host`, `port` and `database`:
1416

15-
```python
16-
import ydb_dbapi
17+
```python
18+
import ydb_dbapi
1719

18-
connection = ydb_dbapi.connect(
19-
host="localhost", port="2136", database="/local"
20-
) # sync connection
20+
connection = ydb_dbapi.connect(
21+
host="localhost", port="2136", database="/local"
22+
) # sync connection
2123

22-
async_connection = await ydb_dbapi.async_connect(
23-
host="localhost", port="2136", database="/local"
24-
) # async connection
25-
```
24+
async_connection = await ydb_dbapi.async_connect(
25+
host="localhost", port="2136", database="/local"
26+
) # async connection
27+
```
2628

2729
Usage of connection:
2830

29-
```python
30-
with connection.cursor() as cursor:
31-
cursor.execute("SELECT id, val FROM table")
31+
```python
32+
with connection.cursor() as cursor:
33+
cursor.execute("SELECT id, val FROM table")
3234

33-
row = cursor.fetchone()
34-
rows = cursor.fetchmany(size=5)
35-
rows = cursor.fetchall()
36-
```
35+
row = cursor.fetchone()
36+
rows = cursor.fetchmany(size=5)
37+
rows = cursor.fetchall()
38+
```
3739

3840
Usage of async connection:
3941

40-
```python
41-
async with async_connection.cursor() as cursor:
42-
await cursor.execute("SELECT id, val FROM table")
42+
```python
43+
async with async_connection.cursor() as cursor:
44+
await cursor.execute("SELECT id, val FROM table")
4345

44-
row = await cursor.fetchone()
45-
rows = await cursor.fetchmany(size=5)
46-
rows = await cursor.fetchall()
47-
```
46+
row = await cursor.fetchone()
47+
rows = await cursor.fetchmany(size=5)
48+
rows = await cursor.fetchall()
49+
```

0 commit comments

Comments
 (0)