Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Change SQL to show columns, index to supress dups#5

Merged
shoma merged 1 commit intomasterfrom
change-sql-to-show-columns-index
Oct 30, 2019
Merged

Change SQL to show columns, index to supress dups#5
shoma merged 1 commit intomasterfrom
change-sql-to-show-columns-index

Conversation

@shoma
Copy link
Copy Markdown
Owner

@shoma shoma commented Oct 30, 2019

When a columns is used in multipule index, this duplicate in DESCRIBE commnad.
It brings a confuse to build the SQL for the table.

+-------------+--------------+-------------+----------------+---------------------+-------------+-----------------+
| COLUMN_NAME | SPANNER_TYPE | IS_NULLABLE | COLUMN_DEFAULT | INDEX_NAME          | INDEX_TYPE  | COLUMN_ORDERING |
+-------------+--------------+-------------+----------------+---------------------+-------------+-----------------+
| UUID        | STRING(64)   | NO          | <null>         | PRIMARY_KEY         | PRIMARY_KEY | ASC             |
| SingerId    | INT64        | NO          | <null>         | BySingerIdAndStatus | INDEX       | ASC             | <---
| SingerId    | INT64        | NO          | <null>         | PRIMARY_KEY         | PRIMARY_KEY | ASC             |

And omit TABLE_CATALOG and TABLE_SCHEMA from show index command. These are always empty.

When a columns is used in multipule index, this duplicate in `DESCRIBE` commnad.
It brings a confuse to build the SQL for the table.
```
+-------------+--------------+-------------+----------------+---------------------+-------------+-----------------+
| COLUMN_NAME | SPANNER_TYPE | IS_NULLABLE | COLUMN_DEFAULT | INDEX_NAME          | INDEX_TYPE  | COLUMN_ORDERING |
+-------------+--------------+-------------+----------------+---------------------+-------------+-----------------+
| UUID        | STRING(64)   | NO          | <null>         | PRIMARY_KEY         | PRIMARY_KEY | ASC             |
| SingerId    | INT64        | NO          | <null>         | BySingerIdAndStatus | INDEX       | ASC             | <---
| SingerId    | INT64        | NO          | <null>         | PRIMARY_KEY         | PRIMARY_KEY | ASC             |

```
@shoma shoma merged commit c8ef90a into master Oct 30, 2019
@shoma shoma deleted the change-sql-to-show-columns-index branch October 30, 2019 04:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant