You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-15Lines changed: 8 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,8 @@ $ pip install rethinkdb
16
16
The main difference with the previous driver (except the name of the package) is we are **not** importing RethinkDB as `r`. If you would like to use `RethinkDB`'s python driver as a drop in replacement, you should do the following:
17
17
18
18
```python
19
-
from rethinkdb importRethinkDB
19
+
from rethinkdb importr
20
20
21
-
r = RethinkDB()
22
21
connection = r.connect(db='test')
23
22
```
24
23
@@ -40,9 +39,8 @@ sockets. This example shows how to create a table, populate with data, and get e
40
39
document.
41
40
42
41
```python
43
-
from rethinkdb importRethinkDB
42
+
from rethinkdb importr
44
43
45
-
r = RethinkDB()
46
44
connection = r.connect(db='test')
47
45
48
46
r.table_create('marvel').run(connection)
@@ -64,13 +62,12 @@ introduced into the standard library.
64
62
65
63
```python
66
64
import asyncio
67
-
from rethinkdb importRethinkDB
65
+
from rethinkdb importr
68
66
69
67
# Native coroutines are supported in Python ≥ 3.5. In Python 3.4, you should
70
68
# use the @asyncio.couroutine decorator instead of "async def", and "yield from"
asyncwith r.open(db='test', nursery=nursery) as conn:
@@ -191,12 +185,11 @@ await db_pool.close()
191
185
### Twisted mode
192
186
193
187
```python
194
-
from rethinkdb importRethinkDB
188
+
from rethinkdb importr
195
189
from twisted.internet import reactor, defer
196
190
197
191
@defer.inlineCallbacks
198
192
defmain():
199
-
r = RethinkDB()
200
193
r.set_loop_type('twisted')
201
194
connection =yield r.connect(db='test')
202
195
@@ -219,7 +212,7 @@ reactor.run()
219
212
```
220
213
221
214
## Misc
222
-
Although we recommend to use the import used in the examples, to help the migration from rethinkdb<2.4 we introduced a shortcut which can easily replace the old `import rethinkdb as r` import with `from rethinkdb import r`.
215
+
To help the migration from rethinkdb<2.4 we introduced a shortcut which can easily replace the old `import rethinkdb as r` import with `from rethinkdb import r`.
223
216
224
217
## Run tests
225
218
In the `Makefile` you can find three different test commands: `test-unit`, `test-integration` and `test-remote`. As RethinkDB has dropped the support of Windows, we would like to ensure that those of us who are using Windows for development can still contribute. Because of this, we support running integration tests against Digital Ocean Droplets as well.
0 commit comments