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

Table::drop() with multiple .table when using sqlite3 causes invalid sql #737

Open
uttarayan21 opened this issue Jan 8, 2024 · 1 comment

Comments

@uttarayan21
Copy link

Description

    let down = Table::drop()
        .table(RootFolderIden::Table)
        .table(FolderIden::Table)
        .table(FileIden::Table)
        .build(SqliteQueryBuilder);

That generates the following sql

DROP TABLE "root_folder", "folder", "file"

Steps to Reproduce

  1. Generate the sql from the above code snippet.

Expected Behavior

Ideally it should be the same as when creating a table. (i.e. overwrites the table name with the last one used )

Actual Behavior

DROP TABLE "root_folder", "folder", "file"
Generated a drop table statement with all the tables which isn't supported by sqlite (https://www.sqlite.org/lang_droptable.html)

Reproduces How Often

Always

Versions

│   └── sea-query v0.30.6
│       ├── sea-query-attr v0.1.1 (proc-macro)
│       └── sea-query-derive v0.4.1 (proc-macro)
│   ├── sea-query v0.30.6 (*)
├── sea-query v0.30.6 (*)

Additional Information

@thgoebel
Copy link

I ran into this because the README told me to: https://github.com/SeaQL/sea-query/tree/0.32.0#table-drop

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

No branches or pull requests

2 participants