Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write MySQL & Postgres Enum Columns #29

Merged
merged 10 commits into from
Dec 10, 2021
Merged

Write MySQL & Postgres Enum Columns #29

merged 10 commits into from
Dec 10, 2021

Conversation

@billy1624 billy1624 self-assigned this Dec 2, 2021
@billy1624 billy1624 marked this pull request as ready for review December 3, 2021 09:51
@tyt2y3
Copy link
Member

tyt2y3 commented Dec 4, 2021

I don't actually understand why this is necessary. But certainly does not seem right.
Because in the general case, there are database > schema.
Which means we either add DatabaseSchemaTable or simply use SchemaTable as is.

@billy1624
Copy link
Member Author

I don't actually understand why this is necessary.

It's needed because the "schema prefix" will be and should be ignored by MySQL & SQLite

But certainly does not seem right. Because in the general case, there are database > schema. Which means we either add DatabaseSchemaTable or simply use SchemaTable as is.

I will go with DatabaseSchemaTable and dropping the DatabaseTable that I proposed in this PR

  • For Postgres, it will construct SQL statement with "database"."schema"."table"
  • For MySQL & SQLite, it will construct SQL statement with "database"."table" (ignoring the supplied schema)

How is that sounds? @tyt2y3

@billy1624
Copy link
Member Author

Hey @tyt2y3, DatabaseSchemaTable was added on SeaQL/sea-query@1ff761d

Cargo.toml Outdated
@@ -32,7 +32,7 @@ path = "src/lib.rs"
[dependencies]
futures = { version = "0.3", optional = true }
sea-schema-derive = { version = "0.1.0", path = "sea-schema-derive" }
sea-query = { version = "^0.18.1" }
sea-query = { version = "^0.19.0", git = "https://github.com/SeaQL/sea-query.git", branch = "table-ref-db-prefix" }
Copy link
Member

Choose a reason for hiding this comment

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

We might want to wait for the next 'train' of sea-query release

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but we can merge this into master first without release a new version of sea-schema now

@@ -32,7 +32,7 @@ path = "src/lib.rs"
[dependencies]
futures = { version = "0.3", optional = true }
sea-schema-derive = { version = "0.1.0", path = "sea-schema-derive" }
sea-query = { version = "^0.18.1" }
sea-query = { version = "^0.19.0", git = "https://github.com/SeaQL/sea-query.git", branch = "pulls/201" }
Copy link
Member

@tyt2y3 tyt2y3 Dec 10, 2021

Choose a reason for hiding this comment

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

Please release sea-query and remove this

Copy link
Member

@tyt2y3 tyt2y3 left a comment

Choose a reason for hiding this comment

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

Please release sea-schema as well

@tyt2y3 tyt2y3 merged commit d02f29c into master Dec 10, 2021
@tyt2y3 tyt2y3 deleted the sea-orm/pulls/348 branch December 10, 2021 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants