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

Feature Request: getQuery() method. #69

Open
danielhe4rt opened this issue Jan 6, 2025 · 3 comments
Open

Feature Request: getQuery() method. #69

danielhe4rt opened this issue Jan 6, 2025 · 3 comments

Comments

@danielhe4rt
Copy link
Contributor

Hey everyone!

I'm working into some enhancements under a Scylla app and I was wondering if there's not a possibility of make a method that dumps the current query before execute it.

#[charybdis_model(
table_name = submissions,
partition_keys = [id],
clustering_keys = [song_id],
)]

pub struct Submission {
    pub id: Uuid,
    pub song_id: Text,
}

let submission: Submission;
submission.insert().get_query(); // INSERT INTO submissions  (id, song_id) VALUES (...,...)

Or even a tool like the migrator that lists all the possible queries.

Btw, Happy New Year!

@GoranBrkuljan
Copy link
Member

GoranBrkuljan commented Jan 10, 2025

@danielhe4rt, we can easily add option to get query string, but do you also need query values? It's a bit more complicated in that case.

@danielhe4rt
Copy link
Contributor Author

Only the query would be amazing! IF we had the possibility to extract all the queries into an export or pretty output on terminal... Since we have limited queries and behaviors, to scaffold documentations for OSS projects, this would be GOLD!

@danielhe4rt
Copy link
Contributor Author

Thinking a little bit more on it: the migration tool could have a flag like "output" with all of them listed somehow.

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