Search code examples
activejdbc

Truncate table with ActiveJDBC


What is the best way to truncate a table with ActiveJDBC? The Model class only has deleteAll().
So I guess I need to run a native SQL query, is Base.exec("TRUNCATE TABLE table1") the way to go?

Thanks.


Solution

  • Yes, if you want to execute arbitrary SQL, use Base.exec(sql).