Is there a way to check the syntax of a SQLite3 script without running it?
Basically, I'm looking for the equivalent of the SQLite3 ruby -c script.rb, perl -c script.pl, php --syntax-check script.phpetc.
I was thinking about using explain, but most of the scripts that I would like to test are stored for reference purposes (and do not necessarily have a related database). Using explainalso makes it difficult to use with something like Syntastic . (That is, I only want to check the syntax, not the semantics.)
Update:
I'm confused. Let's say I want the syntax to check this:
select * from foo;
I could do something like:
echo 'explain select * from foo;' | sqlite3
But then I get:
SQL error near line 1: no such table: foo
All I expect to see is OK Syntax (or something similar). Is it possible?