Skip to content

Commit eee677b

Browse files
committed
reorganize limitations in README
1 parent 3c5b3dd commit eee677b

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

README.md

+19-12
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,26 @@ DJANGO_WORKER_COUNT=1 DJANGO_WORKER_INDEX=0SPANNER_TEST_INSTANCE=django-tests ./
129129

130130
## Limitations
131131

132-
Limitation|Comment|Resolution
133-
---|---|---
134-
Lack of DEFAULT for columns|Cloud Spanner doesn't support using DEFAULT for columns thus the use of default values might have to enforced in your controller logic|
135-
Lack of FOREIGN KEY constraints|Cloud Spanner doesn't support foreign key constraints thus they have to be defined in code
136-
Lack of sequential and auto-assigned IDs|Cloud Spanner doesn't autogenerate IDs and this integration instead creates UUID4 to avoid [hotspotting](https://cloud.google.com/spanner/docs/schema-design#uuid_primary_key) so you SHOULD NOT rely on IDs being sorted|We generate UUID4s for each AutoField
137-
Numeric values are saved as FLOAT64|Cloud Spanner doesn't support the NUMERIC type thus we might have precision losses|Decimal and Numeric are translated to FLOAT64. If Cloud Spanner adds NUMERIC in the future, you might need to migrate your columns
138-
Optimistic transactions when running DDL and other statements|Cloud Spanner CANNOT run DDL (CREATE, DROP, ALTER) in a Transaction and CAN ONLY run them in the [DatabaseAdmin RPC]() so any mixes of DDL and other statements will make prior statements get run, DDL run, then following statements run separately|
139-
107 unexplored Django tests|We need to run every single test in the Django test suite for 100% certainty|Currently in progress to complete the [211 test cases](https://gist.github.com/odeke-em/d3476b6cb7c3485de6aa29956ed50a75#file-all_tests-txt)
140-
Table names CANNOT have spaces within them whether back-ticked or not|Cloud Spanner DOEST NOT support tables with spaces in them for example `Entity ID`|Ensure that your table names don't have spaces within them
141-
Table names CANNOT have punctuation marks and MUST contain valid UTF-8|Cloud Spanner DOEST NOT support punctuation marks e.g. periods ".", question marks "?" in table names|Ensure that your table names don't have punctuation marks
142-
Lack of stored procedures and triggers|Cloud Spanner DOES NOT support stored procedures nor triggers so if your code relies on them, you might need to move the logic into your application|Not supported
143-
Lack of VARIANCE, STDDEV database functions|Cloud Spanned doesn't yet implement these functions|
132+
### `AutoField` generates random IDs
133+
134+
Spanner doesn't have a way to auto-generate primary key values. Instead,
135+
django-spanner monkeypatches `AutoField` to generate a random UUID4.
136+
137+
To avoid [hotspotting](https://cloud.google.com/spanner/docs/schema-design#uuid_primary_key),
138+
these IDs are not monotonically increasing.
139+
140+
### `ForeignKey` constraints aren't created
141+
142+
django-spanner [doesn't create foreign key constraints](https://github.com/googleapis/python-spanner-django/issues/313).
143+
144+
### `DecimalField` isn't supported
145+
146+
Spanner doesn't support a NUMERIC data type that allows storing high precision
147+
decimal values without the possibility of data loss.
148+
149+
### `Variance` and `StdDev` database functions aren't supported
144150

151+
Spanner doesn't have these functions.
145152

146153
## How it works
147154

0 commit comments

Comments
 (0)