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: samples/nodejs/prisma-sample-app/README.md
+16-19Lines changed: 16 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ The following limitations are currently known:
121
121
| Migrations | Cloud Spanner does not support the full PostgreSQL DDL dialect, and also not all `pg_catalog` tables and functions. PGAdapter contains translations for the most commonly used features that are not supported. It is possible to use Prisma Migrations with PGAdapter, but some migrations are likely to require manual modifications. |
122
122
| Shadow Database | Cloud Spanner cannot be used as a shadow database. Instead, you need to set up a real PostgreSQL database and use that as the shadow database. See https://www.prisma.io/docs/concepts/components/prisma-migrate/shadow-database#cloud-hosted-shadow-databases-must-be-created-manually|
123
123
| Advisory locks | Advisory locks are not supported. Prisma will try to use this during migrations. These commands will be ignored by PGAdapter. |
124
-
| Generated primary keys | Auto-generated primary keys are not supported. Do not add the `@default(autoincrement())` annotation to your model definitions. |
124
+
| Generated primary keys | Auto-generated primary keys are supported, but do not generate a monotonically increasing value. The `@default(autoincrement())` annotation in combination with the `serial` data type will generate bit-reversed sequential values that are safe from causing hotspots in your database.|
125
125
| Upsert | Upsert is not supported. |
126
126
127
127
### Migrations
@@ -158,25 +158,22 @@ Cloud Spanner and PGAdapter do not support advisory locks. The advisory lock sta
158
158
therefore be ignored and have no effect.
159
159
160
160
### Generated Primary Keys
161
-
Generated primary keys are not supported and should be replaced with primary key definitions that
162
-
are manually assigned. See https://cloud.google.com/spanner/docs/schema-design#primary-key-prevent-hotspots
163
-
for more information on choosing a good primary key. This sample uses UUIDs that are generated by the
164
-
application for primary keys.
161
+
Generated primary keys are supported and use values that are not monotonically increasing. This
162
+
prevents hotspots in your database. See https://cloud.google.com/spanner/docs/schema-design#primary-key-prevent-hotspots
163
+
for more information. The `TicketSale` model in this sample uses an auto-generated primary key. The
164
+
primary key is generated by a column with type `serial`, which uses a backing bit-reversed sequence
165
+
to generate unique values.
165
166
166
167
```typescript
167
-
modelSinger {
168
-
idString @id
169
-
createdAtDateTime @default(now())
170
-
updatedAtDateTime @updatedAt
171
-
firstNameString
172
-
lastNameString
173
-
/// `fullName` is generated by the database and should not be set.
0 commit comments