The deleteWhere
clause takes any logical boolean, so you could simply say:
myTable.deleteWhere(r => 1 === 1)
Which should output the statement:
DELETE FROM mytable WHERE 1 = 1
If you want to eliminate the where clause automatically, you could try:
myTable.deleteWhere(r => 1 === 1.inhibitWhen(true))
Which should suppress the where clause altogether.
If you are looking for an even more efficient method and your database supports TRUNCATE
or another equivalent function, you can get a java.sql.Connection
from org.squeryl.Session
and issue the query directly through JDBC. Unfortunately, this would lose some of the type safety Squeryl offers.