haxetink / tink_sql

SQL embedded into Haxe
MIT License
53 stars 17 forks source link

Add the `TRUNCATE TABLE` operation #140

Closed cedx closed 3 years ago

cedx commented 3 years ago

Fixes #132

Note that SQLite needs a special treatment because it doesn't support the TRUNCATE statement. We can emulate it by using a DELETE statement (cf. https://sqlite.org/lang_delete.html#the_truncate_optimization).

This PR addresses this case only in the Node.js driver. I didn't want to make any big changes because I'm not familiar enough with the Tink SQL code yet... and someone using SQLite should propably know that TRUNCATE is not supported.

kevinresol commented 3 years ago

Would be nice to have some tests, but I guess this is good enough as a start

cedx commented 3 years ago

@kevinresol Done in #142.