Skip to content

Commit 93d8541

Browse files
committed
fix: Update README for alpha release
Cosmetic changes to the README for the upcoming alpha release. Supersedes googleapis#490.
1 parent 048566c commit 93d8541

File tree

1 file changed

+43
-55
lines changed

1 file changed

+43
-55
lines changed

README.rst

+43-55
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,50 @@
1-
django-spanner
2-
==============
1+
Cloud Spanner support for Django
2+
================================
33

4-
ORM plugin for using Cloud Spanner as a database for Django.
4+
ORM plugin for using Cloud Spanner as a `database backend
5+
<https://docs.djangoproject.com/en/2.2/ref/databases/#using-a-3rd-party-database-backend>`__
6+
for Django.
57

6-
🚨THIS CODE IS STILL UNDER DEVELOPMENT🚨
7-
========================================
88

9-
Table of contents
10-
-----------------
11-
12-
- `Installing it <#installing-it>`__
13-
- `Using it <#using-it>`__
14-
15-
- `Format <#format>`__
16-
- `Example <#example>`__
9+
Installation
10+
------------
1711

18-
- `Functional tests <#functional-tests>`__
19-
- `Django integration tests <#django-integration-tests>`__
12+
To use this library you'll need a Google Cloud Platform project with the Cloud
13+
Spanner API enabled. See the `Cloud Spanner Python client docs
14+
<https://github.com/googleapis/python-spanner/#quick-start>`__ for details.
2015

21-
- `django\_test\_suite.sh <#django_test_suitesh>`__
16+
Use the version of ``python-spanner-django`` that corresponds to your version
17+
of Django. For example, ``python-spanner-django`` 2.2.x works with Django
18+
2.2.y. (This is the only supported version at this time.)
2219

23-
- `Environment variables <#environment-variables>`__
24-
- `Example run <#example-run>`__
20+
The minor release number of Django doesn't correspond to the minor release
21+
number of ``python-spanner-django`` Use the latest minor release of each.
2522

26-
- `Parallelization script <#parallelization-script>`__
23+
To install from PyPI:
2724

28-
- `Environment variables <#environment-variables>`__
29-
- `Example run <#example-run>`__
25+
.. code:: shell
3026
31-
- `Limitations <#limitations>`__
32-
- `How it works <#how-it-works>`__
27+
pip3 install django-google-spanner
3328
34-
- `Overall design <#overall-design>`__
35-
- `Internals <#internals>`__
3629
37-
Installing it
38-
-------------
30+
To install from source:
3931

40-
Use the version of django-spanner that corresponds to your version of
41-
Django. For example, django-spanner 2.2.x works with Django 2.2.y. (This
42-
is the only supported version at this time.)
32+
.. code:: shell
4333
44-
The minor release number of Django doesn't correspond to the minor
45-
release number of django-spanner. Use the latest minor release of each.
34+
git clone [email protected]:googleapis/python-spanner-django.git
35+
cd python-spanner-django
36+
pip3 install -e .
4637
47-
.. code:: shell
4838
49-
pip3 install --user .
39+
Use
40+
---
5041

51-
Using it
52-
--------
42+
After `installing it <#Installation>`__, you'll need to edit your Django
43+
``settings.py`` file:
5344

54-
After `installing it <#installing-it>`__, you'll need to edit your
55-
Django ``settings.py`` file:
45+
- Add ``django_spanner`` as the very first entry in the ``INSTALLED_APPS``
46+
setting
5647

57-
- Add ``django_spanner`` as the very first entry in the
58-
``INSTALLED_APPS`` setting
5948

6049
.. code:: python
6150
@@ -107,18 +96,18 @@ Limitations
10796
Transaction management isn't supported
10897
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10998

110-
django-spanner always works in Django's default transaction behavior,
111-
``autocommit`` mode. Transactions cannot be controlled manually with
99+
``python-spanner-django`` always works in Django's default transaction
100+
behavior, ``autocommit`` mode. Transactions cannot be controlled manually with
112101
calls like ``django.db.transaction.atomic()``.
113102

114103
``AutoField`` generates random IDs
115104
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116105

117106
Spanner doesn't have support for auto-generating primary key values.
118-
Therefore, django-spanner monkey-patches ``AutoField`` to generate a
119-
random UUID4. It generates a default using ``Field``'s ``default``
120-
option which means ``AutoField``\ s will have a value when a model
121-
instance is created. For example:
107+
Therefore, ``python-spanner-django`` monkey-patches ``AutoField`` to generate a
108+
random UUID4. It generates a default using ``Field``'s ``default`` option which
109+
means ``AutoField``\ s will have a value when a model instance is created. For
110+
example:
122111

123112
::
124113

@@ -136,16 +125,18 @@ were created.
136125
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137126

138127
Spanner doesn't support ``ON DELETE CASCADE`` when creating foreign-key
139-
constraints so django-spanner `doesn't support foreign key
140-
constraints <https://github.com/googleapis/python-spanner-django/issues/313>`__.
128+
constraints so ``python-spanner-django`` `doesn't support foreign key
129+
constraints
130+
<https://github.com/googleapis/python-spanner-django/issues/313>`__.
141131

142132
Check constraints aren't supported
143133
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144134

145135
Spanner doesn't support ``CHECK`` constraints so one isn't created for
146-
```PositiveIntegerField`` <https://docs.djangoproject.com/en/stable/ref/models/fields/#positiveintegerfield>`__
147-
and
148-
```CheckConstraint`` <https://docs.djangoproject.com/en/stable/ref/models/constraints/#checkconstraint>`__
136+
`PositiveIntegerField
137+
<https://docs.djangoproject.com/en/stable/ref/models/fields/#positiveintegerfield>`__
138+
and `CheckConstraint
139+
<https://docs.djangoproject.com/en/stable/ref/models/constraints/#checkconstraint>`__
149140
can't be used.
150141

151142
``DecimalField`` isn't supported
@@ -185,7 +176,7 @@ Spanner has some limitations on schema changes which you must respect:
185176
- Renaming tables and columns isn't supported.
186177
- A column's type can't be changed.
187178
- A table's primary key can't be altered.
188-
- Migrations aren't atomic since django-spanner doesn't support
179+
- Migrations aren't atomic since ``python-spanner-django`` doesn't support
189180
transactions.
190181

191182
``DurationField`` arithmetic doesn't work with ``DateField`` values (`#253 <https://github.com/googleapis/python-spanner-django/issues/253>`__)
@@ -247,6 +238,3 @@ Internals
247238

248239
.. figure:: ./assets/internals.png
249240
:alt:
250-
251-
🚨🚨THIS CODE IS STILL UNDER DEVELOPMENT🚨🚨
252-
============================================

0 commit comments

Comments
 (0)