Skip to content

Commit 81454e3

Browse files
gabor-borosAdam Grandquist
authored andcommitted
Helping developers to upgrade to 2.4.x easier (#102)
* Helping developers to upgrade to 2.4.x easier Description Those developers who has a lot of reference to the old import has hard times migrating to the new package. To help them, we are introducing a shortcut for `from rethinkdb import Retinkdb; r = Rethinkdb()`, so they can import the it as `from rethinkdb import r`. Now they can easily find-and-replace the imports. Note The import in 2.3 looked like `import rethinkdb as r`. * Extend README
1 parent 590965b commit 81454e3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ main().addCallback(lambda d: print("stopping") or reactor.stop())
218218
reactor.run()
219219
```
220220

221+
## 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`.
223+
221224
## Run tests
222225
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.
223226

rethinkdb/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,6 @@ def set_loop_type(self, library=None):
8383

8484
def connect(self, *args, **kwargs):
8585
return self.make_connection(self.connection_type, *args, **kwargs)
86+
87+
88+
r = RethinkDB()

0 commit comments

Comments
 (0)