DB.open "sqlite3:./mydb.sqlite3" do |db|
db.exec "DROP TABLE IF EXISTS tablename"
end
triggers "Exception: no such table: tablename (SQLite3::Exception)"
when:
sqlite3 mydb.sqlite3
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> .tables
tablename
- table exists
- sqlite3 implements "DROP TABLE IF EXISTS tablename" which should NOT trigger any exception.
- crystal-sqlite3 test spec https://github.com/crystal-lang/crystal-sqlite3/blob/master/spec/db_spec.cr
specifically invokes (lines 81-83)
drop_table_if_exists_syntax do |table_name|
"drop table if exists #{table_name}"
end
- I cleaned cache ~/.cache/crystal/
crystal version 1.7.3
What am I doing wrong?