Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Seeking Sqlite no-op command

Tags:

sqlite

noop

no-op

Is there a command which I can run to do nothing (or very little) which will never error?

I need something for testing porpoises.

like image 738
Mawg says reinstate Monica Avatar asked Jan 30 '14 08:01

Mawg says reinstate Monica


2 Answers

A comment does nothing (but your database driver might complain if there is not command at all):

/* Hello, world! */

Unknown PRAGMA statements are ignored, and do not return anything:

PRAGMA testing_porpoises;

If you need a statement that returns an empty result set, you need a SELECT:

SELECT 0 WHERE 0;
like image 50
CL. Avatar answered Nov 14 '22 23:11

CL.


For example a simple constant select could do:

SELECT 1 WHERE 0;
like image 5
laalto Avatar answered Nov 14 '22 23:11

laalto