[sqlite] SELECT difference between TABLE and VIEW

2011-01-30 Thread Lapo Luchini
Column headers are different if obtained from a table or a view:

% sqlite3 a
SQLite version 3.7.4
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE TABLE a (a);
sqlite> CREATE VIEW b AS SELECT * FROM a;
sqlite> INSERT INTO a VALUES ('foo');
sqlite> .header on
sqlite> SELECT v.a FROM a v;
a
foo
sqlite> SELECT v.a FROM b v;
v.a
foo

-- 
Lapo Luchini - http://lapo.it/

“Never worry about theory as long as the machinery does what it's
supposed to do.” (Robert A. Heinlein, "Waldo & Magic, Inc.", 1950)
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] unused thread-related options in configure

2010-09-02 Thread Lapo Luchini
configure and Makefile have ways to define SQLITE_THREAD_OVERRIDE_LOCK=1
and SQLITE_ALLOW_XTHREAD_CONNECT=1 but those flags are used nowhere in
the source code.
Couldn't them be removed from configure/Makefile too, for the sake of
avoiding confusion?

-- 
Lapo Luchini - http://lapo.it/

“The future is not google-able.” (William Gibson, 2004-02-05)
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] user_version and .dump

2009-05-06 Thread Lapo Luchini
I noticed that sqlite3 command doesn't dump the user_version PRAGMA,
though that would arguably be necessary for the correct work of the
application (or it wouldn't have set it at all, I guess).

Was it simply forgot or is there a specific reason not to dump that?

-- 
Lapo Luchini - http://lapo.it/

“Computers are useless. They can only give you answers.” (Pablo Picasso)

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


[sqlite] SQLITE_ENABLE_COLUMN_METADATA pro and cons

2008-06-25 Thread Lapo Luchini
I have a question for which I couldn't find much in this list or in
sqlite.org website: the pros are ovious, but what are the cons of
compiling with -DSQLITE_ENABLE_COLUMN_METADATA?
I guess there must be some, if that's not compiled by default.
What's the concern?
Code size? (this would not be a problem in my case)
More memory used? per query o per row?
Less efficient or somewhat slower?
Or simply it is an unsupported option with no known cons but not tested
enough yet?

cheers,

-- 
Lapo Luchini - http://lapo.it/

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


Re: [sqlite] Supported data types

2005-09-26 Thread Lapo Luchini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Firman Wandayandi wrote:

> Can anyone describe me, more detail list of which are data types
> currently supported by SQLite, on both
> http://sqlite.org/datatypes.html & http://sqlite.org/datatype3.html
> had gave me some or maybe all (not sure), because when I create a
> table with a SMALLINT column, seems SQLite is ok. So I figured out
> there are more data types supported? please give me a list of it.

As stated on those very pages, sqlite2 doesn't really care about data
types, only uses them in sorting (numbers are sorted differently than
strings).
This means, you can create a "b TINYINT" field and put the value
'hello world' in it (see the page itself for a more long explanation).

sqlite3 does have "stronger" data types, but are connected to the
specific value, not to the column anyway (but the column does have
"affinity", so that an integer put in a TEXT column gets converted to
text).
INT, SMALLINT or ANYTHINGINT will be INTEGER value anyway.
See paragraph "2.1 Determination Of Column Affinity" for more info.

- --
Lapo Luchini
[EMAIL PROTECTED] (OpenPGP & X.509)
www.lapo.it (ICQ UIN: 529796)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJDN9R0AAoJELBiMTth2oCD0ywP/iJeBIk9abG8PEauMr1RqwKP
LUQWWJ/XFj3e/gmkQgGlKOxXV5i3trqQEVPZXUFnCmJl48T60IneuIvFNJKsxVli
cKGGutbWVpJrETcwhI0H6YLhp4CZrE9mlBtfIAasF+LUq1T4SIjxV4Nh4RWJUcn9
/ZJnY4MndKCZJ6TF7Y+RaHBswt9EkXlauWDXiYXaw2hmOsgzK7jn4VjJFhPdqqEx
gLZp0vSM0mSscVY3wQYpo4QmSL1rKsQk/M0ETmTcXBdxLRQ2VQztkug93f5zVdPO
lKCYDpVq/pjWfig+ManFUlwJobhuDcUntlm/yDE4wIWwOSf4kEWjyXapsVg5Yvyo
Kk3aFku3eSPrtqUgpTCu+kGxWp13pkTFa/B2VjdHf/bjJRcVIP1cyF8H1petjjpS
XV+xeQqCfXkpEI3BtOKUIMpMftIhX7rIZThL03Il0jY2XF9L6NE9lfHlRRcSu1MJ
zh8lKNPrFddN0b8uB0xEGBcjDsjwu9vJpJN5kbgGSxHYvHy5Fl70SA52E714w1H/
J76oy/06GUFqVVp6q4WFkhfhqHNI1SmWr4xiw+9G0E4XkmjkMtWQApiWHOo8tQXI
StQtDNPwvGDSzZqhuyU71F/g1KWBEQXT9eqzdi6/2M+40dArFEWvCEfcl9gT83YX
U4GsWJGx6NYlHYELuv+c
=wBvP
-END PGP SIGNATURE-



[sqlite] BLOB dumping & printing

2005-09-23 Thread Lapo Luchini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I think I found a small glitch or, maybe, consider it a request for
enhancement ;-)

% sqlite3 prova  
SQLite version 3.2.5
Enter ".help" for instructions
sqlite> CREATE TABLE a(b);
sqlite> INSERT INTO a VALUES (X'41424300500051');
sqlite> .dump
BEGIN TRANSACTION;
CREATE TABLE a(b);
INSERT INTO "a" VALUES(X'41424300500051');
COMMIT;
sqlite> .mode insert
sqlite> SELECT * FROM a;
INSERT INTO table VALUES('ABC');

It would be nice for ".mode insert" to print a command that would
actually re-create the same data, the same as ".dump" (the obvious
difference is that .dump can't filter data in any way, it just dumps
it all) or, at least, it would be very nice if the already existing
function that "prints binary data as X'-encoded-string" were reachable
from SQL, so that one could use something like:
SELECT xencode(b) FROM a;
and obtain
X'41424300500051'

Lapo

PS: I prefer to read the ML from gmane newsgroup interface, is there
any way I can be added to the people that can post without actually
needing to receive the emails also?

- --
L a p o   L u c h i n i
l a p o @ l a p o . i t
w w w . l a p o . i t /
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iEYEARECAAYFAkMzy2sACgkQaJiCLMjyUvucQwCg3qVABfQAdoaViiDypL/kjoEi
aVEAoO8HDKElCdWbqhDG6wlC2ed9f0qW
=dFDl
-END PGP SIGNATURE-