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

Is there a way to truncate the table? #1009

Open
devsarvesh92 opened this issue Jun 6, 2024 · 3 comments
Open

Is there a way to truncate the table? #1009

devsarvesh92 opened this issue Jun 6, 2024 · 3 comments

Comments

@devsarvesh92
Copy link

No description provided.

@dantownsend
Copy link
Member

Piccolo doesn't have a truncate command built in at the moment - you can use delete:

await MyTable.delete(force=True)

Or raw SQL to access the truncate command:

await MyTable.raw('TRUNCATE my_table')

@dantownsend
Copy link
Member

I'll probably add this when I get time, as I do think would be nice.

Sometimes along the lines of this:

async def drop_db_tables(*tables: t.Type[Table]) -> None:

@sarvesh-deserve
Copy link

Thanks @dantownsend

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

3 participants