Feature Request: Return non-0 from sqlite3 Client on Error

View: New views
2 Messages — Rating Filter:   Alert me  

Feature Request: Return non-0 from sqlite3 Client on Error

by David E. Wheeler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Greetings,

I'm using -bail with the sqlite3 client, which is great, but alas  
sqlite3 doesn't return a non-zero value when it bails with a failure:

     % sqlite3 foo_test.db '.read sql/001-tables.sql'
     SQL error near line 3: near "autoincrement": syntax error
     % echo $?
     0

Would it be possible for the sqlite3 client to exit with a non-zero  
value when it encounters an error and bails? This would greatly help  
with error handling in scripts.

Thanks,

David

_______________________________________________
sqlite-users mailing list
sqlite-users@...
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: Feature Request: Return non-0 from sqlite3 Client on Error

by Roger Binns :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David E. Wheeler wrote:
> I'm using -bail with the sqlite3 client, which is great, but alas  
> sqlite3 doesn't return a non-zero value when it bails with a failure:

This was fixed in 3.6.20 most likely as fixing this:

   http://www.sqlite.org/src/info/beb2dd69ad

See also the timeline at http://www.sqlite.org/src/timeline?n=200

Roger

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkr3JKkACgkQmOOfHg372QTwJQCgrlQirHVwB6FH61gzTKmJdQiJ
M0AAn1sP8b5gxp+1iTOckMXG6W1gRMKA
=42o7
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@...
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users