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

On 04/13/2011 04:09 PM, Stephan Wehner wrote:
> is there a way to get a pretty-print version of
> 
> sqlite> .schema
> 
> Would be nice.

The actual table definitions are how you originally supplied them except the
create table words are capitalized.  Consequently if you want pretty print
you'll need to supply them nicely formatted in the first place!  If you do a
'select * from sqlite_master' you'll see where it came from.

To a certain extent simpler SQL could be regenerated from some pragmas but
would omit some information such as constraints.

To take the existing SQL you supplied and pretty print it would require a
SQL parser which isn't available.  (The one builtin to SQLite is littered
with C code and has the goal of generating internal byte code programs
rather than providing a human oriented parse tree.)

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

iEYEARECAAYFAk2mNBcACgkQmOOfHg372QRRzACgkm0c0Vn2czSEakGI8kZWuyZd
kNsAoMKxHpGfitEZVMND13IwrDBNoHFl
=s3lD
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to