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

On 09/23/2011 08:47 AM, David Garfield wrote:
> But that is the point.  Strings are generally defined in two ways.
> Either:
> 
> 1) a pointer, and count every byte up to but not including a NUL.
> 
> 2) a pointer and a length, and count every byte in the specified length.

You insist on a dichotomy but SQLite supports both conventions
simultaneously.  You'll only have some difficulty if you use the second
convention as some builtin functions operate on the first convention, but
your own user defined functions/collations etc can do the right thing.

> Internally, SQLite uses counted strings.  It should treat NUL as just
> one more character, since it is just one more character.

It does with the exception of some user defined functions.

> ... user's database ...

The same database can be populated by many different programs, and you
should really distinguish between users and developers - sometimes they are
the same person and sometimes not.  Eg whose database is the one used by
Chrome and Firefox?

> Actually, I guess I am more concerned with the "shell".

The shell is not a formal part of SQLite.  It doesn't have the same level of
testing or backwards/forwards compatibility requirements.  It is still
completely open code with no restrictions on how it operates so you can
modify the code to do whatever you want.

> I use blob
> columns that are partly text and would like to have the text portions
> at least be visible.

You cannot display bytes as text unless you know the encoding.  There is
nothing stopping you from altering the shell to do this, adding a hexdump
output mode, adding a user defined function etc.

The SQLite shell isn't particular well structured for easy developer
extension.  My Python SQLite wrapper includes a compatible shell that is
easy to augment and extend:

  http://apidoc.apsw.googlecode.com/hg/shell.html

Roger

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk59DPMACgkQmOOfHg372QRh4gCdE+pNpGL7GG3FD9YVA161JdZj
gYYAn2lrpRpKsNerKWOv6o47EH0AL/Jf
=BPPC
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to