Re: [sqlite] pragma table_info(database.table) not supported

2013-03-22 Thread Peter Haworth
I found the code in the two attached files (are they allowed on this list?)
on the web a while back.  The claim was that it created an information
schema database from an sqlite db.  I know nothing about Lua but I managed
to get as far as creating the schema. Unfortunately, the url I got it from
no longer has the code. but I'd be interested to know if it works.

On Thu, Mar 21, 2013 at 9:00 AM, sqlite-users-requ...@sqlite.org wrote:

 Message: 16
 Date: Wed, 20 Mar 2013 22:15:39 +
 From: Simon Slavin slav...@bigfraud.org
 To: General Discussion of SQLite Database sqlite-users@sqlite.org
 Subject: Re: [sqlite] pragma table_info(database.table) not supported
 Message-ID: c9f4c996-f601-4080-a23c-7dc5c58e7...@bigfraud.org
 Content-Type: text/plain; charset=us-ascii


 On 20 Mar 2013, at 6:52pm, Petite Abeille petite.abei...@gmail.com
 wrote:

  On Mar 20, 2013, at 6:53 PM, Jay A. Kreibich j...@kreibi.ch wrote:
 
  If there is any change I'd like to see, it is that all the PRAGMAs
  that return tabular data should really be system catalog tables.
 
  Triple hurray for that! SQLite deserves a proper data dictionary, no
 question asked.
 
  What about adopting/adapting the information schema and call it a day?
 
  http://en.wikipedia.org/wiki/Information_schema

 Me three.  I feel that this would be a better way to get details about the
 currently connected database(s).  It should replace all the PRAGMAs which
 return details about tables, indexes, foreign keys, etc..  I do remember
 someone posted code here a year or two ago which executed lots of PRAGMAs
 and used the results to build such tables.  It may have been this, or
 related to it:

 http://www.sqlite.org/cvstrac/wiki?p=InformationSchema

 These tables could either be updated on any schema change, or could be
 left uncalculated until a query on them is executed, or could be
 created/updated on execution of a special command like ANALYSE.




Pete
lcSQL Software http://www.lcsql.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] pragma table_info(database.table) not supported

2013-03-22 Thread Simon Slavin

On 21 Mar 2013, at 5:41pm, Peter Haworth p...@lcsql.com wrote:

 I found the code in the two attached files (are they allowed on this list?)

You can't attach things to messages to this list.  Thanks for finding the code. 
 I think it's interesting as a talking point but we don't actually need to see 
the code.  If the developer team wants this to work they can make up their own 
code pretty easily and it won't be in Lua.

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


Re: [sqlite] Problem getting utf-8 text out of a text column

2013-03-22 Thread Tim Streater
On 21 Mar 2013 at 23:30, Richard Hipp d...@sqlite.org wrote: 

 On Thu, Mar 21, 2013 at 6:52 PM, Tim Streater t...@clothears.org.uk wrote:

 I have a column defined as TEXT and I insert utf-8 text into it. In
 particular, there are byte sequences that might look as follows:
 ... 74 6F 20 C2 A3 32 35 30 ... (in hex)
 which represents:
 ... to £250 ...
 I used Navicat for SQLite Lite to peer at the data as hex and text in the
 column, and it looks as I've presented it.
 The problem comes when I try to retrieve the data using a PHP script. I
 want the data back as bytes because I'm going to encode it as quoted
 printable, with decimal byte values greater than 127 being separately
 encoded. This would give the above as:
 ... to =C2=A3250 ...
 But: the byte stream I get back on doing a SELECT is always *missing* the
 C2 byte. What am I missing here? I'm using the PHP PDO interface.

 What do you get back when you do select hex(column) instead of just
 column using PHP.  If the C2 byte is there, then I'm going to put the
 blame on PHP in this case.

Having checked the db carefully, both using hex(col) (via the sqlite3 CLI 
program), and using the unix hexdump utility on the db, I'm now reasonably 
certain that the C2 bytes are simply not in the db. That they show up when I 
examine the db with Navicat for SQLite Lite is another matter altogether.

Sorry for the distraction.

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


Re: [sqlite] Problem getting utf-8 text out of a text column

2013-03-22 Thread Simon Slavin

On 22 Mar 2013, at 3:04pm, Tim Streater t...@clothears.org.uk wrote:

 Having checked the db carefully, both using hex(col) (via the sqlite3 CLI 
 program), and using the unix hexdump utility on the db, I'm now reasonably 
 certain that the C2 bytes are simply not in the db. That they show up when I 
 examine the db with Navicat for SQLite Lite is another matter altogether.

The moral of the story (for anyone else finding this thread when googling to 
solve their own problem) is not to trust third-party software.  Write your own 
code or use the sqlite3 executable provided by the sqlite development team.  
Oh, and I should have thought of hex() myself.  Bad Simon.  No cookie.

 Sorry for the distraction.

I assume that means you have no more sqlite3-related problem.  Glad we could 
help.  Good luck with the rest of your project.

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