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
The following data DML [ChangeTypes](https://docs.liquibase.com/change-types/home.html) are supported:<br/>
242
242
insert, update, loadData, loadUpdateData
@@ -274,7 +274,7 @@ delete.
274
274
275
275
### Unsupported Spanner Features
276
276
277
-
There are a number of features that Spanner does not have such as sequences and stored procedures. The Liquibase extension will
277
+
There are a number of features that Spanner does not have such as stored procedures. The Liquibase extension will
278
278
throw an exception during analysis of the changeSet in most cases, but not all. For example, a DELETE without a WHERE clause
279
279
will fail in Spanner but not in the Liquibase extension.
280
280
@@ -292,7 +292,7 @@ will fail in Spanner but not in the Liquibase extension.
292
292
Testing requirements:
293
293
* Emulator requires [testcontainers](https://www.testcontainers.org/) and its [requirements](https://www.testcontainers.org/supported_docker_environment/) installed.
294
294
* Spanner in GCP requires SPANNER_PROJECT and SPANNER_INSTANCE environment variables set to an active instance
295
-
* Spanner in GCP requires application default credentials set or GOOGLE_APPLICATION_CREDENTIALS environent set
295
+
* Spanner in GCP requires application default credentials set or GOOGLE_APPLICATION_CREDENTIALS environment set
This library implements as many available features of both Liquibase and Cloud Spanner as possible. However, there
2
+
This library implements as many available features of both Liquibase and Spanner as possible. However, there
3
3
are a number of features that either can't be supported, or that can only be supported through custom SQL changes.
4
4
These limitations and possible workarounds are listed in this document.
5
5
6
-
## Cloud Spanner features without a corresponding Liquibase change type
7
-
The following Cloud Spanner features do not have a corresponding change type in Liquibase and are, therefore,
6
+
## Spanner features without a corresponding Liquibase change type
7
+
The following Spanner features do not have a corresponding change type in Liquibase and are, therefore,
8
8
only supported through custom SQL change sets or through automatic modification of the SQL statements that are
9
9
generated by Liquibase.
10
10
@@ -16,30 +16,27 @@ to modify the generated SQL. See the [create-schema.yaml](example/create-schema.
16
16
- Commit timestamp columns: Use `ModifySql` to replace the column definition with one that includes the `OPTIONS (allow_commit_timestamp=true)` clause. See [create-schema.yaml](example/create-schema.yaml) for an example.
17
17
- Null-filtered indexes: Use `ModifySql` to replace the `CREATE INDEX` statement with `CREATE NULL_FILTERED INDEX`. See [this test file](src/test/resources/create-null-filtered-index-singers-first-name.spanner.yaml) for an example.
18
18
19
-
## Database features not supported by Cloud Spanner
20
-
The following database features are not supported by Cloud Spanner, and trying to create/alter/drop any of them through Liquibase will cause an error.
19
+
## Database features not supported by Spanner
20
+
The following database features are not supported by Spanner, and trying to create/alter/drop any of them through Liquibase will cause an error.
21
21
22
-
- Auto increment columns
23
-
- Sequences
24
22
- Unique constraints: Use `UNIQUE INDEX` instead of `UNIQUE CONSTRAINT`
25
23
- Stored procedures
26
24
- Table and column remarks
27
25
28
-
## Liquibase change types with no Cloud Spanner support
29
-
The following change types are not supported by Cloud Spanner.
30
-
- Add/Drop primary key: Cloud Spanner requires that all tables have a primary key. The primary key must be defined when the table is created, and cannot be dropped or added later.
31
-
- Rename table: Cloud Spanner does not support renaming tables. Create a copy instead, and drop the old table.
32
-
- Rename column: Cloud Spanner does not support renaming columns. Create a copy instead, and drop the old column.
26
+
## Liquibase change types with no Spanner support
27
+
The following change types are not supported by Spanner.
28
+
- Add/Drop primary key: Spanner requires that all tables have a primary key. The primary key must be defined when the table is created, and cannot be dropped or added later.
29
+
- Rename column: Spanner does not support renaming columns. Create a copy instead, and drop the old column.
33
30
34
-
## Liquibase change types with limited Cloud Spanner support
35
-
The following Liquibase change types are implemented for Cloud Spanner but have certain limitations.
31
+
## Liquibase change types with limited Spanner support
32
+
The following Liquibase change types are implemented for Spanner but have certain limitations.
36
33
37
-
- AddLookupTable: This feature is implemented and works for most cases. However, if the amount of data to be inserted in the new lookup table exceeds any of the [Cloud Spanner transaction limits](https://cloud.google.com/spanner/docs/dml-tasks#transaction_limits), the change will fail and you should implement it using a custom SQL change.
38
-
- Delete: This feature is implemented and works for most cases. However, if the amount of data to be deleted in the new lookup table exceeds any of the [Cloud Spanner transaction limits](https://cloud.google.com/spanner/docs/dml-tasks#transaction_limits), the change will fail and you should implement it using a custom SQL change. Specifying a `WHERE` clause for the `DELETE` statement is required (the clause may be `WHERE TRUE`).
39
-
- Load data / Load-update data: These features are implemented and works for most cases. If however the amount of data to be inserted or updated exceeds any of the [Cloud Spanner transaction limits](https://cloud.google.com/spanner/docs/dml-tasks#transaction_limits), the change will fail and you should implement it using a custom SQL change.
40
-
- Modify data type: This feature works, but only for the data type changes that are [allowed by Cloud Spanner](https://cloud.google.com/spanner/docs/data-definition-language#description_3).
34
+
- AddLookupTable: This feature is implemented and works for most cases. However, if the amount of data to be inserted in the new lookup table exceeds any of the [Spanner transaction limits](https://cloud.google.com/spanner/docs/dml-tasks#transaction_limits), the change will fail and you should implement it using a custom SQL change.
35
+
- Delete: This feature is implemented and works for most cases. However, if the amount of data to be deleted in the new lookup table exceeds any of the [Spanner transaction limits](https://cloud.google.com/spanner/docs/dml-tasks#transaction_limits), the change will fail and you should implement it using a custom SQL change. Specifying a `WHERE` clause for the `DELETE` statement is required (the clause may be `WHERE TRUE`).
36
+
- Load data / Load-update data: These features are implemented and works for most cases. If however the amount of data to be inserted or updated exceeds any of the [Spanner transaction limits](https://cloud.google.com/spanner/docs/dml-tasks#transaction_limits), the change will fail and you should implement it using a custom SQL change.
37
+
- Modify data type: This feature works, but only for the data type changes that are [allowed by Spanner](https://cloud.google.com/spanner/docs/data-definition-language#description_3).
41
38
42
-
A potential work-around for the transaction limits in Cloud Spanner is to use [Partitioned DML](https://cloud.google.com/spanner/docs/dml-tasks#partitioned-dml) instead of transactional DML. Partitioned DML statements are not bound by the transaction limits, but are also not atomic. The Cloud Spanner JDBC driver that is used by Liquibase supports Partitioned DML by setting the `AUTOCOMMIT_DML_MODE` connection property to `PARTITIONED_NON_ATOMIC`:
39
+
A potential work-around for the transaction limits in Spanner is to use [Partitioned DML](https://cloud.google.com/spanner/docs/dml-tasks#partitioned-dml) instead of transactional DML. Partitioned DML statements are not bound by the transaction limits, but are also not atomic. The Spanner JDBC driver that is used by Liquibase supports Partitioned DML by setting the `AUTOCOMMIT_DML_MODE` connection property to `PARTITIONED_NON_ATOMIC`:
43
40
44
41
```sql
45
42
SET AUTOCOMMIT = TRUE;
@@ -53,4 +50,4 @@ SET AUTOCOMMIT_DML_MODE = 'TRANSACTIONAL';
53
50
54
51
## DDL limits
55
52
56
-
Cloud Spanner recommends some [best practices for schema updates](https://cloud.google.com/spanner/docs/schema-updates#best-practices) including limiting the frequency of schema updates and to consider the impact of large scale schema changes. One approach it to apply a small number of change sets. Alternatively, use [SQL change](https://docs.liquibase.com/change-types/community/sql.html) and batch the DDL using [batch statements](https://cloud.google.com/spanner/docs/use-oss-jdbc#batch_statements).
53
+
Spanner recommends some [best practices for schema updates](https://cloud.google.com/spanner/docs/schema-updates#best-practices) including limiting the frequency of schema updates and to consider the impact of large scale schema changes. One approach it to apply a small number of change sets. Alternatively, use [SQL change](https://docs.liquibase.com/change-types/community/sql.html) and batch the DDL using [batch statements](https://cloud.google.com/spanner/docs/use-oss-jdbc#batch_statements).
0 commit comments