ClickHouse Truncate table
API
For the full list of supported methods, see TruncateTableQuery.
db.NewTruncateTable(). Model(&strct). Table("table1"). // quotes table names TableExpr("table1"). // arbitrary unsafe expression ModelTableExpr("table1"). // overrides model table name IfExists(). Exec(ctx)
Example
To truncate ClickHouse table:
_, err := db.NewTruncateTable().Model((*Span)(nil)).Exec(ctx) if err != nil { panic(err) }