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

issues-179 Add support for view #293

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ikrivosheev
Copy link
Member

@ikrivosheev ikrivosheev commented Apr 4, 2022

PR Info

Depends on:

Adds

Add support for: create, delete, rename VIEW.

TODO:

  • add backends
  • add tests
  • add docs

@ikrivosheev ikrivosheev changed the title issues-179 Add support for view without backend impl issues-179 Add support for view Apr 4, 2022
@ikrivosheev
Copy link
Member Author

I need more time for support backends, because SQLite, MySQL and Postgres are very different in the details.

@ikrivosheev
Copy link
Member Author

ikrivosheev commented Apr 5, 2022

@tyt2y3 @billy1624, hello. POC for support VIEW is done (without docs and tests). I have one question: ViewCreateStatement has field: query which is SelectStatement. For transform SelectStatement to SQL needed impl QueryStatementBuilder on the other hand: ViewDropStatement does not needed QueryStatementBuilder (only SchemaStatementBuilder).

What to do? In impl ViewStatement everywhere return (String, Values) or is there something better?

@ikrivosheev
Copy link
Member Author

@tyt2y3 @billy1624 any ideas?

Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

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

Hey @ikrivosheev, sorry for the delay. What a huge PR loll

Notice a few things. For, create view:

  • OR REPLACE is supported by MySQL, MariaDB and PostgreSQL, SQLite wasn't supported
  • However, IF NOT EXISTS is supported by SQLite but not the other three db
  • TEMPORARY is supported by PostgreSQL and SQLite but not the other two db
  • RECURSIVE is supported only by PostgreSQL
  • WITH [ CASCADED | LOCAL ]...

And, the list goes on. I think it's better to document these db specific features later in this PR. Or, even, dump some of the feature that supported by only one db.

References:

@ikrivosheev
Copy link
Member Author

Hey @ikrivosheev, sorry for the delay. What a huge PR loll

Notice a few things. For, create view:

  • OR REPLACE is supported by MySQL, MariaDB and PostgreSQL, SQLite wasn't supported
  • However, IF NOT EXISTS is supported by SQLite but not the other three db
  • TEMPORARY is supported by PostgreSQL and SQLite but not the other two db
  • RECURSIVE is supported only by PostgreSQL
  • WITH [ CASCADED | LOCAL ]...

And, the list goes on. I think it's better to document these db specific features later in this PR. Or, even, dump some of the feature that supported by only one db.

References:

I understood this. My question was: #293 (comment)

@tyt2y3
Copy link
Member

tyt2y3 commented Apr 26, 2022

I think ViewCreateStatement should impl QueryStatementBuilder.
May be we can forget ViewStatement for now, if we do keep it then all methods should return (String, Values)

@ian-p-cooke
Copy link

status?

@ikrivosheev
Copy link
Member Author

status?

@ian-p-cooke hello! I am working on support Postgres array in SeaQuery. After I will return back to this PR.

@ikrivosheev
Copy link
Member Author

Well, It's time to continue working on this PR.

@LucaRickler
Copy link

Any news on this?

@bismitpanda
Copy link

what is the current state of this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

Please add support for views
6 participants