Skip to content

Conversation

@erezrokah
Copy link
Member

@erezrokah erezrokah commented Jun 7, 2023

Summary

Fixes #11325
Same as #9143 for MySQL destination.
Type handling taken from https://github.com/cloudquery/cloudquery/pull/11214/files#diff-c4ee14fff2e1c7cbea7dfcf122879522b5d817aaa041f54564696293b1c6bc30R90.

Once we have the MySQL source migrated to v3 we can add support for more granular types like char(x) or other fixed size types (doing that will be a breaking change).

@erezrokah erezrokah requested review from a team and hermanschaaf and removed request for a team June 7, 2023 10:56
@cq-bot cq-bot added the mysql label Jun 7, 2023
@erezrokah erezrokah added the automerge Automatically merge once required checks pass label Jun 7, 2023
if strings.HasPrefix(sqlType, "datetime") {
return arrow.FixedWidthTypes.Timestamp_us
}
if strings.HasPrefix(sqlType, "decimal") || strings.HasPrefix(sqlType, "numeric") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this might fail in the future if we start supporting general array types via Arrow, but right now this is not yet supported on the source side so we're okay. It'll be a bigger change in any case

@kodiakhq kodiakhq bot merged commit f0ec33e into cloudquery:main Jun 7, 2023
kodiakhq bot pushed a commit that referenced this pull request Jun 7, 2023
🤖 I have created a release *beep* *boop*
---


## [2.2.0](plugins-destination-mysql-v2.1.1...plugins-destination-mysql-v2.2.0) (2023-06-07)


### Features

* **dest-mysql:** Handle all MySQL types ([#11360](#11360)) ([f0ec33e](f0ec33e))


### Bug Fixes

* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 90670b8 ([#11279](#11279)) ([a6cdc91](a6cdc91))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
kodiakhq bot pushed a commit that referenced this pull request Jun 12, 2023

#### Summary

This is a follow up to #11360 to ensure `blob/text` SQL types have their PK configured correctly.
It also has another PK fix related to the arrow migration to avoid creating a duplicate index for columns that have all `Unique,NotNull,PrimaryKey` flags set

<!--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: char() bug for mysql source > mysql destination

3 participants