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

Add truncate() on models too #352

Closed
girardinsamuel opened this issue Jan 30, 2021 · 2 comments · Fixed by #376
Closed

Add truncate() on models too #352

girardinsamuel opened this issue Jan 30, 2021 · 2 comments · Fixed by #376
Labels
easy These issues are geared for people who have not yet contributed to this project yet help wanted Extra attention is needed Query Builder Related to the query builder

Comments

@girardinsamuel
Copy link
Contributor

girardinsamuel commented Jan 30, 2021

Right now we can do

from config.database import DB
DB.get_schema_builder().truncate("licenses")

Would be cool to be able to do it on the model

License.truncate()
@jpmateo022
Copy link

jpmateo022 commented Feb 3, 2021

Right now we can do

from config.database import DB
DB.get_schema_builder().truncate("licenses")

Would be cool to be able to do it on the model

License.truncate()

Agree :)

@josephmancuso
Copy link
Member

This feature is really simple. The truncate queries just need to be added to the query grammars. Then a truncate method needs to be added to the query builder, as well as the passthrough on the Model class.

@josephmancuso josephmancuso added easy These issues are geared for people who have not yet contributed to this project yet Query Builder Related to the query builder help wanted Extra attention is needed labels Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy These issues are geared for people who have not yet contributed to this project yet help wanted Extra attention is needed Query Builder Related to the query builder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants