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
``django-postgres-extra`` aims to make all of PostgreSQL's awesome features available through the Django ORM. We do this by taking care of all the hassle. As opposed to the many small packages that are available to try to bring a single feature to Django with minimal effort. ``django-postgres-extra`` goes the extra mile, with well tested implementations, seamless migrations and much more.
17
27
@@ -21,6 +31,7 @@ With seamless we mean that any features we add will work truly seamlessly. You s
21
31
22
32
Major features
23
33
--------------
34
+
24
35
* Native upserts
25
36
* Single query
26
37
* Concurrency safe
@@ -49,15 +60,16 @@ Desired/future features
49
60
50
61
Installation
51
62
------------
63
+
52
64
1. Install the package from PyPi:
53
65
54
66
.. code-block:: bash
55
67
56
-
$ pip install django-postgres-extra
68
+
λ pip install django-postgres-extra
57
69
58
70
2. Add ``postgres_extra`` and ``django.contrib.postgres`` to your ``INSTALLED_APPS``:
1. Why do I need to change the database back-end/engine?
87
99
88
-
We utilize PostgreSQL's `hstore` data type, which allows you to store key-value pairs in a column. In order to create `UNIQUE` constraints on specific key, we need to create a special type of index. We could do this without a custom database back-end, but it would require everyone to manually write their migrations. By using a custom database back-end, we added support for this. When changing the `uniqueness` constraint on a `HStoreField`, our custom database back-end takes care of creating, updating and deleting these constraints/indexes in the database.
100
+
We utilize PostgreSQL's `hstore` data type, which allows you to store key-value pairs in a column. In order to create `UNIQUE` constraints on specific key, we need to create a special type of index. We could do this without a custom database back-end, but it would require everyone to manually write their migrations. By using a custom database back-end, we added support for this. When changing the `uniqueness` constraint on a `HStoreField`, our custom database back-end takes care of creating, updating and deleting these constraints/indexes in the database.
89
101
90
102
2. I am already using a custom database back-end, can I still use yours?
91
103
92
-
Yes. You can set the ``POSTGRES_EXTRA_DB_BACKEND_BASE`` setting to your current back-end. This will instruct our custom database back-end to inherit from the database back-end you specified. **Warning**: this will only work if the base you specified indirectly inherits from the standard PostgreSQL database back-end.
104
+
Yes. You can set the ``POSTGRES_EXTRA_DB_BACKEND_BASE`` setting to your current back-end. This will instruct our custom database back-end to inherit from the database back-end you specified. **Warning**: this will only work if the base you specified indirectly inherits from the standard PostgreSQL database back-end.
93
105
94
106
3. Does this package work with Python 2?
95
107
96
-
No. Only Python 3.5 or newer is supported. We're using type hints. These do not work well under older versions of Python.
108
+
No. Only Python 3.5 or newer is supported. We're using type hints. These do not work well under older versions of Python.
0 commit comments