Re: [sqlite] Why the parallel read of DB is faster with separate connections per thread?

2016-06-17 Thread Keith Medcalf

See also

https://www.sqlite.org/threadsafe.html


> -Original Message-
> From: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-
> boun...@mailinglists.sqlite.org] On Behalf Of Yuri
> Sent: Friday, 17 June, 2016 14:02
> To: SQLite mailing list
> Subject: [sqlite] Why the parallel read of DB is faster with separate
> connections per thread?
> 
> I have a fairly large DB that I need to only read (not write) as fast as
> possible. I open DB with flags
> SQLITE_OPEN_READONLY|SQLITE_OPEN_PRIVATECACHE and then run select
> queries in 8 threads.
> 
> When each thread opens its own connection, DB is read in 8 wallclock
> seconds using 23 user seconds.
> 
> When DB connection is shared by threads, though, the process reads the
> same data in 17 wallclock seconds using 20 user seconds, much slower
> overall, killing the parallelism benefit.
> 
> 
> Reusing RO connection for some reason makes threads wait for each other
> too much. What makes the single connection to slow the process down?
> 
> 
> In an attempt to speed it up as much as possible, I was trying to first
> copy into :memory: db, so that threads would read only from memory, but
> this requires the shared connection and it is slower.
> 
> 
> sqlite3-3.12.2
> 
> 
> Yuri
> 
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



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


Re: [sqlite] Why the parallel read of DB is faster with separate connections per thread?

2016-06-17 Thread Keith Medcalf
> I have a fairly large DB that I need to only read (not write) as fast as
> possible. I open DB with flags
> SQLITE_OPEN_READONLY|SQLITE_OPEN_PRIVATECACHE and then run select
> queries in 8 threads.
> 
> When each thread opens its own connection, DB is read in 8 wallclock
> seconds using 23 user seconds.
> 
> When DB connection is shared by threads, though, the process reads the
> same data in 17 wallclock seconds using 20 user seconds, much slower
> overall, killing the parallelism benefit.

> Reusing RO connection for some reason makes threads wait for each other
> too much. What makes the single connection to slow the process down?

Of course it is slower since only ONE THREAD at a time can be performing a 
database operation.  This makes your code inherently single threaded where only 
application (outside of the database engine) processing can be overlapped with 
database operations.  Entries into the database engine are serialized.  If you 
application does non-trivial processing between attempts to enter the database 
engine code (ie, you have a very low multiprogramming ratio) then passing 
through a serialized gateway will of course be slower than not doing so.  In 
other words, you need sufficient compute usage between each entry into the 
database engine to permit taking advantage of the multiprocessing capabilities 
you have engaged.  Actually, if you have 8 threads then each thread will have 
to do sufficient compute between database engine accesses to permit the 
remaining 7 threads to proceed through the serialization gate and return before 
the original thread wants to go through the gate again.  This is a basi
 c principle of multiprogramming derived from Amdahl's Law.

https://en.wikipedia.org/wiki/Amdahl%27s_law

You can lookup information on multiprogramming ratio's and what they mean 
yourself.  Basically, any single threaded process will run at its maximum 
speed, that is, it will consume 100% of some resource it requires, after which 
no speed increase for that process is possible.  Running two processes 
sequentially will also run at the maximum speed that each can achieve 
constrained by whatever resource hits 100% utilization.  

If both processes are multiprogrammed (whether as separate threads in the same 
process or separate processes on the same machine -- side-by-each in 
newfy-speak), then the total time taken will be less that the time taken to run 
both the two processes sequentially (one after each, in newfy-speak), but more 
than the time taken to run single process which takes the longest time to 
complete.   This is called the multiprocessing ratio since now both of the 
side-by-each processes are constrained by the single resource, which they both 
require, which is 100% utilized.  In your case this appears to be serialized 
access to the database engie.

Therefore, in order to obtain (and utilize) the maximum capabilities of a 
computer system, the "multiprogramming mix" must be carefully designed to 
achieve as close to 100% usage of all resources simultaneously.  Any resource 
that is not 100% consumed represents a waste of resources (and therefore a 
waste of the money spent to purchase that resource).

That is why mainframe computers in the dinosaur pen are so fast.  It is not 
because on a single-process basis they are fast (they are not, in comparison to 
modern bitty-boxen) but that they are designed to achieve extremely high 
multiprogramming rates by offloading processing from the main processor to 
dedicated processors (mostly I/O processors) wherever possible.  This permits 
many thousands of simultaneous processes to run at a perceived speed that is 
only slightly slower than a single process running on the machine by itself.  
This is something that bittyboxes have been unable to achieve because they have 
not been designed to do so.  So instead of a single refrigerator-sized dinosaur 
you now require a datacenter with a thousand bitty-boxes to achieve the same 
result -- the cost in $ being about the same -- to achieve the same result).

> In an attempt to speed it up as much as possible, I was trying to first
> copy into :memory: db, so that threads would read only from memory, but
> this requires the shared connection and it is slower.

Yes, because your limitation is access to the database engine by multiple 
threads.  Maximum MPR will be achieved by using one connection per thread and 
setting "MULTITHREADED" in the database engine so that the serialization calls 
(which are no longer required) are not made (and thus do not consume the small 
amount of unnecessary processor time they consume).  You will also have to make 
sure that your connection cache sizes are set correctly such that you get a 
decent cache hit ratio on each thread and ensure that you do not simply move 
the bottleneck somewhere else (like the I/O channel or memory).

Done properly your bottleneck will likely become CPU architecture (or OS 
implementation of that architecture) 

Re: [sqlite] Correct, best, or generally accepted database structure for groups of things

2016-06-17 Thread Chris Locke
Thanks James.  Points taken on board.  :-)


Chris

On Fri, Jun 17, 2016 at 5:24 PM, James K. Lowden 
wrote:

> On Fri, 17 Jun 2016 07:37:16 +0100
> Chris Locke  wrote:
>
> > I fail to see what any of this has to do with sqlite.  I thought this
> > was a mailing list for sqlite?  Seeing queries (no pun intended) on
> > sql statements is very subjective, especially with the limited data
> > provided by the original poster.
>
> A query question frequently exposes design choices, either logical or
> physical.  Both of those can have great effect on the utility and
> performance of the system.  Answering SQL questions helps people use
> SQLite more effectively, and to understand where it differs from other
> DBMSs.
>
> Queries occasionally provoke changes in SQLite itself, either because
> the output was wrong (or unexpected), or because it presented a case
> for optimization.  I have to believe that real queries from users on
> this list serve to inform the developers in how SQLite is used.  (I
> have never seen a homework question on this list.)
>
> > it won't stop there, and as soon as the original poster has another
> > query
>
> No, it won't, because it hasn't.  I've  been hanging out here for 18
> months, and I remember only one annoying trivial-query participant.
> Out of 13,693 messages, that doesn't amount to much.
>
> --jkl
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Correct, best, or generally accepted database structure for groups of things

2016-06-17 Thread Chris Locke
As this is a mailing list, I've not been aware of past history.  I thought
(albeit wrongly) that an SQLite group was about the product sqlite.
Someone posted the other day about a car analogy, so this is like posting
to the Ford Engine Forums, askign what air freshner to put in the car.

I don't mind off-topic posts either, but the generic post about 'how do I
write this sql?' was extremely basic.  Half the group will spin off about
third normal forms...

Ooh yes, I'll be back!  I've a very 'basic' knowledge of SQL, so am picking
up bits from the odd post here and there.  I craft a lot of databases in
vb.net but as my needs are small, sqlite eats this up for breakfast...

I'm tempted to set up a beginners SQL forum though... a 'getting started'
guide together with a 'how the &%$£ do I do this?' section...
I prefer forums to email lists... don't feel so 'spammmy' and noisy...


Thanks,
Chris


On Fri, Jun 17, 2016 at 3:16 PM, Drago, William @ CSG - NARDA-MITEQ <
william.dr...@l-3com.com> wrote:

> > -Original Message-
> > From: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-
> > boun...@mailinglists.sqlite.org] On Behalf Of John McKown
> > Sent: Friday, June 17, 2016 9:35 AM
> > To: SQLite mailing list
> > Subject: Re: [sqlite] Correct, best, or generally accepted database
> structure
> > for groups of things
> >
> > On Fri, Jun 17, 2016 at 1:37 AM, Chris Locke 
> > wrote:
> >
> > > I fail to see what any of this has to do with sqlite.  I thought this
> > > was a mailing list for sqlite?  Seeing queries (no pun intended) on
> > > sql statements is very subjective, especially with the limited data
> > > provided by the original poster.
> > > Everyone will give helpful advice, but it won't stop there, and as
> > > soon as the original poster has another query (no pun intended) which
> > > would result in a schema change, this would have to be explained, etc.
> > >
> > > A specific group on SQL is required.
> > >
> >
> > ​Perhaps so. But such a group would run into problems because it would
> be a
> > case of "whose SQL?" The four "big" ones that I know of are: SQLite,
> > PostgreSQL, Oracle, and IBM's DB2. The basics are the same, but each has
> > their own peculiarities. ​I don't know what the intent of this forum
> really is. It
> > is only for SQLite related "perculiarities"? Or does it include
> something like
> > the OP's question which is basically "how do I do a SQLite query to get
> this
> > information?" I don't really know. I also monitor the PostgreSQL forums
> and
> > see this "how do I craft an SQL query to ...?" type question quite
> often. What
> > is weird to me, is that someone will post such a question on the _bugs_
> > forums, phrasing it as "I did this SQL query and it didn't do what I
> expected.
> > Please fix your product to make it work." And the reason it didn't work
> was
> > because the SQL query is garbage. Ah, the ever requested "do what I need,
> > not what I said" fix.
> >
>
> I don't know what the actual rules are for this group either. Almost any
> database related topic seems to be tolerated if not enthusiastically
> embraced.
> Chris Locke has only been active here since May of this year (and maybe he
> won't be back now that his problem is solved), so maybe he's unaware of
> some of (off) topics that have made the rounds. In any case maybe he has a
> good point in keeping the mailing list strictly on topic. I personally
> don't mind the occasional detour into other realms, especially on a low
> activity group like this one, and I usually learn a thing or two along the
> way as well, but that is just my opinion.
>
> -Bill
>
> CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any
> attachments are solely for the use of the addressee and may contain
> information that is privileged or confidential. Any disclosure, use or
> distribution of the information contained herein is prohibited. In the
> event this e-mail contains technical data within the definition of the
> International Traffic in Arms Regulations or Export Administration
> Regulations, it is subject to the export control laws of the
> U.S.Government. The recipient should check this e-mail and any attachments
> for the presence of viruses as L-3 does not accept any liability associated
> with the transmission of this e-mail. If you have received this
> communication in error, please notify the sender by reply e-mail and
> immediately delete this message and any attachments.
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] it's just a bombshell!

2016-06-17 Thread goclimbonit
Hi,

Have you ever seen something like that? It's a bombshell you have to see! Look 
at it here 

Sincerely, goclimbo...@yahoo.it

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


[sqlite] Why the parallel read of DB is faster with separate connections per thread?

2016-06-17 Thread Yuri
I have a fairly large DB that I need to only read (not write) as fast as 
possible. I open DB with flags 
SQLITE_OPEN_READONLY|SQLITE_OPEN_PRIVATECACHE and then run select 
queries in 8 threads.


When each thread opens its own connection, DB is read in 8 wallclock 
seconds using 23 user seconds.


When DB connection is shared by threads, though, the process reads the 
same data in 17 wallclock seconds using 20 user seconds, much slower 
overall, killing the parallelism benefit.



Reusing RO connection for some reason makes threads wait for each other 
too much. What makes the single connection to slow the process down?



In an attempt to speed it up as much as possible, I was trying to first 
copy into :memory: db, so that threads would read only from memory, but 
this requires the shared connection and it is slower.



sqlite3-3.12.2


Yuri

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


Re: [sqlite] sqlite3_column_origin_name for INSERT and UPDATE

2016-06-17 Thread Rapin Patrick
2016-06-17 18:26 GMT+02:00 Igor Tandetnik :

>
> select * from t1 where col1 = ?1+?2 and col2=?1-?2;
>
> What should be the expected output of your hypothetical generic way for a
> statement like this?
>
> You seem to assume a one-to-one correspondence between columns and
> placeholders. This assumption doesn't generally hold.
>

I know that there are cases where placeholders do not match a column value.
In these cases, I am expecting NULL for column and table names, just like
sqlite3_column_origin_name is returning for SELECT when produced data is
not a table column.
These situation does not occur often in our code base at least, and I don't
care to just ignore unit dimensions then.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_column_origin_name for INSERT and UPDATE

2016-06-17 Thread Rapin Patrick
2016-06-17 18:24 GMT+02:00 James K. Lowden :

>
> You are encoding type information in the name.  If you move the type
> information into the data, SQLite can manage the unit dimension.  You
> could use a CHECK constraint to require that speed was in m/s, or a
> trigger to make it so.
>

That would indeed be an option. I suppose that you mean to use a string
like "2.34 m/s" or a BLOB of typically 9 bytes (a 'double' and a unit
enum).
But this would slightly increase the database size, and slow down access
due to formatting / parsing.
I targeted to have a zero-overhead support when possible.
In addition, my approach had the big advantage to being backward
compatible: older versions of our application would just ignore the column
unit type, and read/write regular 'double'.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_column_origin_name for INSERT and UPDATE

2016-06-17 Thread Igor Tandetnik

On 6/17/2016 8:21 AM, Rapin Patrick wrote:

Find a generic way to retrieve column names and table name (and then column 
types with above pragma) in a arbitrary single SQL statement for all 
placeholder values.

Examples:
"INSERT INTO t1(col1, col2) VALUES(2, ?); » => (t1, col2)
"UPDATE t2 SET col1=? WHERE col2=? " => (t2, col1) and (t2, col2)
"SELECT * from t1 WHERE col2=?" => (t1, col2)


select * from t1 where col1 = ?1+?2 and col2=?1-?2;

What should be the expected output of your hypothetical generic way for 
a statement like this?


You seem to assume a one-to-one correspondence between columns and 
placeholders. This assumption doesn't generally hold.

--
Igor Tandetnik

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


Re: [sqlite] Correct, best, or generally accepted database structure for groups of things

2016-06-17 Thread James K. Lowden
On Fri, 17 Jun 2016 07:37:16 +0100
Chris Locke  wrote:

> I fail to see what any of this has to do with sqlite.  I thought this
> was a mailing list for sqlite?  Seeing queries (no pun intended) on
> sql statements is very subjective, especially with the limited data
> provided by the original poster.

A query question frequently exposes design choices, either logical or
physical.  Both of those can have great effect on the utility and
performance of the system.  Answering SQL questions helps people use
SQLite more effectively, and to understand where it differs from other
DBMSs.  

Queries occasionally provoke changes in SQLite itself, either because
the output was wrong (or unexpected), or because it presented a case
for optimization.  I have to believe that real queries from users on
this list serve to inform the developers in how SQLite is used.  (I
have never seen a homework question on this list.)  

> it won't stop there, and as soon as the original poster has another
> query 

No, it won't, because it hasn't.  I've  been hanging out here for 18
months, and I remember only one annoying trivial-query participant.
Out of 13,693 messages, that doesn't amount to much.  

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


Re: [sqlite] Correct, best, or generally accepted database structure for groups of things

2016-06-17 Thread James K. Lowden
On Thu, 16 Jun 2016 20:53:25 +
"Drago, William @ CSG - NARDA-MITEQ"  wrote:

> CREATE TABLE Apples (
> ID INTEGER PRIMARY KEY,
> Color TEXT COLLATE NOCASE, --Could be Red, Green, or Yellow

check Color in ( 'Red', 'Green', 'Yellow' ), -- FTFY

> Height REAL, --Measured in cm
> Width REAL --Measured in cm
> Weight REAL --Measured in grams
> );
> 
> And say I had a function that looks at the Apples table and finds
> groups of 4 apples that match in color, dimensions, and weight.

create view FourApples as
select max(ID) as ID
, Color, Height, Width, Weight
from Apples
group by Color, Height, Width, Weight
having count(*) = 4
;

Why bother with a table? 

--jkl

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


Re: [sqlite] Trouble coding conditional UNIQUE

2016-06-17 Thread James K. Lowden
On Thu, 16 Jun 2016 23:23:33 +0200
Dominique Devienne  wrote:

> > > On Behalf Of James K. Lowden
> > >
> > >   create view vParts as
> > >   select 1 as Matched, * from Parts
> > >   UNION
> > >   select 0, * from UnmatchedParts
> >
> 
> Why UNION instead of UNION ALL here?
> Thanks to the 1 and 0, there can't be any dups, so the dedup step of
> UNION wastes cycles, no?

Well spotted, yes!  (Maybe one of these days we'll have a relational
query language without the strange "select distinct / union all"
contradiction.)  

I think you're right that, by construction, these two sets are
distinct.  I was going to suggest that perhaps SQLite could detect
that case, and skip the de-duplication step.  But I think it's a bridge
too far.  To begin with, there's no way in SQL to *declare* two tables
represent distinct sets.  If we can't even do that, how can the DBMS be
expected to deduce that any two derived sets are distinct?  

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


Re: [sqlite] sqlite3_column_origin_name for INSERT and UPDATE

2016-06-17 Thread James K. Lowden
On Fri, 17 Jun 2016 10:56:32 +0200
Rapin Patrick  wrote:

> And my C++ wrapper then knows that this column is a speed expressed
> in meters per second. So when making a SELECT on t1 table, the
> wrapper will output number objects with unit dimension of Speed
> expressed in m/s !

You are encoding type information in the name.  If you move the type
information into the data, SQLite can manage the unit dimension.  You
could use a CHECK constraint to require that speed was in m/s, or a
trigger to make it so.  

--jkl

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


Re: [sqlite] Lemon bug in shiftreduce action for error symbol

2016-06-17 Thread Richard Hipp
On 6/6/16, Vincent Zweije  wrote:

>
> When the shiftreduce action is used in an error context,
> such as:
>
>X -> alpha error.
>
> the adjustment is not made. This causes error handling to fail.
>

Is this problem fixed by
https://www.sqlite.org/src/fdiff?sbs=1=66a16b5e00fefff2=8c4e9d8517e50da3
from earlier this month?  Or have you identified a new problem?
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Correct, best, or generally accepted database structure for groups of things

2016-06-17 Thread R Smith



On 2016/06/17 3:35 PM, John McKown wrote:

On Fri, Jun 17, 2016 at 1:37 AM, Chris Locke 
wrote:


I fail to see what any of this has to do with sqlite.  I thought this was a
mailing list for sqlite?  Seeing queries (no pun intended) on sql
statements is very subjective, especially with the limited data provided by
the original poster.
Everyone will give helpful advice, but it won't stop there, and as soon as
the original poster has another query (no pun intended) which would result
in a schema change, this would have to be explained, etc.

A specific group on SQL is required.


​Perhaps so. But such a group would run into problems because it would be a
case of "whose SQL?" The four "big" ones that I know of are: SQLite,
PostgreSQL, Oracle, and IBM's DB2. The basics are the same, but each has
their own peculiarities. ​I don't know what the intent of this forum really
is. It is only for SQLite related "perculiarities"? Or does it include
something like the OP's question which is basically "how do I do a SQLite
query to get this information?" I don't really know. I also monitor the
PostgreSQL forums and see this "how do I craft an SQL query to ...?" type
question quite often. What is weird to me, is that someone will post such a
question on the _bugs_ forums, phrasing it as "I did this SQL query and it
didn't do what I expected. Please fix your product to make it work." And
the reason it didn't work was because the SQL query is garbage. Ah, the
ever requested "do what I need, not what I said" fix.


I agree, and I would like to even promote posting query questions that 
will be executed in SQLite here, simply because there are so many 
followers of this list who learn from the answers of such SQL related 
questions, even when (or especially when) the answers get into deep down 
relational theory. I also think the above from Chris makes sense, an 
SQL-specific side-list might be useful, but in practice I don't think I 
would bother with both lists - one that has it all is great.


I have not seen any official rules for this list, but I would suggest 
that SQL questions get included where you are trying to achieve a result 
or sculpt a query specifically to use in SQLite. It is worth remembering 
that a good percentage of the SQL used in SQLite is very peculiar to 
SQLite and SQLite mannerisms (or at a minimum, might behave in ways 
worth mentioning when run in SQLite).


Who is to judge when a query is so significantly void of SQLite 
peculiarity that it should definitely be on another list? - I think this 
judgement activity would take more time than simply reading/answering 
the question here.


If one can use the SQL elsewhere, also acceptable - many of us use more 
SQL platforms than just SQLite - but perhaps the question should at 
least originate when trying to build an SQLite query. I believe this is 
mostly the case on this forum and I feel this rule is respected in 
unwritten form by all thus far.  Perhaps a time might come when this is 
no longer the case, however, I'd wait till then to change things.


In short: I wouldn't change a thing yet.

Cheers,
Ryan


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


[sqlite] Lemon bug in shiftreduce action for error symbol

2016-06-17 Thread Vincent Zweije
[resent without pgp signature since i've not seen it
come back on the list or had any reaction so far]

The shiftreduce action is a shift action followed by a
reduce action. It is executed in two parts: a shift part,
shifting to an anonymous state. In this state, the state
number is actually an indication of the reduction to perform,
independently of the lookahead symbol.

When performing the shift part, the argument of the action
is adjusted before being stored in the state of the anonymous
state.

Problem:

When the shiftreduce action is used in an error context,
such as:

   X -> alpha error.

the adjustment is not made. This causes error handling to fail.

Solution:

Moving the adjustment into the yy_shift function fixes the
problem.

I think check-in 2c17a1358353a0845b039283be79353f033e2491
is missing this adjustment, and so it would affect releases
3.9.0 and up (3.13.*).

The following patch fixes the problem for me, but it
is not against the latest trunk, and I think it will
not apply to it because the line to be removed has been
reformatted. Nevertheless I suppose it will be useful.

Index: tool/lempar.c
===
--- tool/lempar.c
+++ tool/lempar.c
@@ -563,6 +563,7 @@
   int yyMajor,  /* The major token to shift in */
   ParseTOKENTYPE yyMinor/* The minor token to shift in */
 ){
+  if( yyNewState > YY_MAX_SHIFT ) yyNewState += YY_MIN_REDUCE - 
YY_MIN_SHIFTREDUCE;
   yyStackEntry *yytos;
   yypParser->yyidx++;
 #ifdef YYTRACKMAXSTACKDEPTH
@@ -813,7 +814,6 @@
   do{
 yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor);
 if( yyact <= YY_MAX_SHIFTREDUCE ){
-  if( yyact > YY_MAX_SHIFT ) yyact += YY_MIN_REDUCE - 
YY_MIN_SHIFTREDUCE;
   yy_shift(yypParser,yyact,yymajor,yyminor);
 #ifndef YYNOERRORRECOVERY
   yypParser->yyerrcnt--;

Thanks.
Vincent.
-- 
WCC - Smart Search & Match
NL  +31 30 7503222
vzwe...@wcc-group.com
www.wcc-group.com
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Correct, best, or generally accepted database structure for groups of things

2016-06-17 Thread Drago, William @ CSG - NARDA-MITEQ
> -Original Message-
> From: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-
> boun...@mailinglists.sqlite.org] On Behalf Of John McKown
> Sent: Friday, June 17, 2016 9:35 AM
> To: SQLite mailing list
> Subject: Re: [sqlite] Correct, best, or generally accepted database structure
> for groups of things
>
> On Fri, Jun 17, 2016 at 1:37 AM, Chris Locke 
> wrote:
>
> > I fail to see what any of this has to do with sqlite.  I thought this
> > was a mailing list for sqlite?  Seeing queries (no pun intended) on
> > sql statements is very subjective, especially with the limited data
> > provided by the original poster.
> > Everyone will give helpful advice, but it won't stop there, and as
> > soon as the original poster has another query (no pun intended) which
> > would result in a schema change, this would have to be explained, etc.
> >
> > A specific group on SQL is required.
> >
>
> ​Perhaps so. But such a group would run into problems because it would be a
> case of "whose SQL?" The four "big" ones that I know of are: SQLite,
> PostgreSQL, Oracle, and IBM's DB2. The basics are the same, but each has
> their own peculiarities. ​I don't know what the intent of this forum really 
> is. It
> is only for SQLite related "perculiarities"? Or does it include something like
> the OP's question which is basically "how do I do a SQLite query to get this
> information?" I don't really know. I also monitor the PostgreSQL forums and
> see this "how do I craft an SQL query to ...?" type question quite often. What
> is weird to me, is that someone will post such a question on the _bugs_
> forums, phrasing it as "I did this SQL query and it didn't do what I expected.
> Please fix your product to make it work." And the reason it didn't work was
> because the SQL query is garbage. Ah, the ever requested "do what I need,
> not what I said" fix.
>

I don't know what the actual rules are for this group either. Almost any 
database related topic seems to be tolerated if not enthusiastically embraced.
Chris Locke has only been active here since May of this year (and maybe he 
won't be back now that his problem is solved), so maybe he's unaware of some of 
(off) topics that have made the rounds. In any case maybe he has a good point 
in keeping the mailing list strictly on topic. I personally don't mind the 
occasional detour into other realms, especially on a low activity group like 
this one, and I usually learn a thing or two along the way as well, but that is 
just my opinion.

-Bill

CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any 
attachments are solely for the use of the addressee and may contain information 
that is privileged or confidential. Any disclosure, use or distribution of the 
information contained herein is prohibited. In the event this e-mail contains 
technical data within the definition of the International Traffic in Arms 
Regulations or Export Administration Regulations, it is subject to the export 
control laws of the U.S.Government. The recipient should check this e-mail and 
any attachments for the presence of viruses as L-3 does not accept any 
liability associated with the transmission of this e-mail. If you have received 
this communication in error, please notify the sender by reply e-mail and 
immediately delete this message and any attachments.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Correct, best, or generally accepted database structure for groups of things

2016-06-17 Thread John McKown
On Fri, Jun 17, 2016 at 1:37 AM, Chris Locke 
wrote:

> I fail to see what any of this has to do with sqlite.  I thought this was a
> mailing list for sqlite?  Seeing queries (no pun intended) on sql
> statements is very subjective, especially with the limited data provided by
> the original poster.
> Everyone will give helpful advice, but it won't stop there, and as soon as
> the original poster has another query (no pun intended) which would result
> in a schema change, this would have to be explained, etc.
>
> A specific group on SQL is required.
>

​Perhaps so. But such a group would run into problems because it would be a
case of "whose SQL?" The four "big" ones that I know of are: SQLite,
PostgreSQL, Oracle, and IBM's DB2. The basics are the same, but each has
their own peculiarities. ​I don't know what the intent of this forum really
is. It is only for SQLite related "perculiarities"? Or does it include
something like the OP's question which is basically "how do I do a SQLite
query to get this information?" I don't really know. I also monitor the
PostgreSQL forums and see this "how do I craft an SQL query to ...?" type
question quite often. What is weird to me, is that someone will post such a
question on the _bugs_ forums, phrasing it as "I did this SQL query and it
didn't do what I expected. Please fix your product to make it work." And
the reason it didn't work was because the SQL query is garbage. Ah, the
ever requested "do what I need, not what I said" fix.



>
> Just my thoughts...
>
>
> Chris
>
>
-- 
"Pessimism is a admirable quality in an engineer. Pessimistic people check
their work three times, because they're sure that something won't be right.
Optimistic people check once, trust in Solis-de to keep the ship safe, then
blow everyone up."
"I think you're mistaking the word optimistic for inept."
"They've got a similar ring to my ear."

From "Star Nomad" by Lindsay Buroker:

Maranatha! <><
John McKown
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite database is locked when query SQLITE_MASTER table

2016-06-17 Thread Simon Slavin
Are you programming in a programming language ?  If so, which language are you 
using and which library are you using to execute SQLite commands ?

If you are scripting instead please tell us which scripting language you're 
using.

If you are using multi-threading or multi-processing, please tell us whether 
you are using one shared or many independent database connections.

Please try to execute some of your commands using the SQLite shell tool.  You 
can download the shell tool from the SQLite Download page as one of the 
"Precompiled Binaries" for your platform.  You can use the shell tool as one or 
both of your processes.

The SQLite shell tool is maintained by the same team that maintains SQLite.  If 
you can demonstrate a problem using the SQLite shell tool then it'll probably 
get fixed.  If it turns out that your problem occurs only with your own 
programming then we might be able to help anyway.

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


Re: [sqlite] Correct, best, or generally accepted database structure for groups of things

2016-06-17 Thread Drago, William @ CSG - NARDA-MITEQ
> -Original Message-
> From: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-
> boun...@mailinglists.sqlite.org] On Behalf Of Chris Locke
> Sent: Friday, June 17, 2016 2:37 AM
> To: SQLite mailing list
> Subject: Re: [sqlite] Correct, best, or generally accepted database structure
> for groups of things
>
> I fail to see what any of this has to do with sqlite.  I thought this was a 
> mailing
> list for sqlite?

Sorry for the off topic post. I've been a member of this group for a few years 
and I've seen generic SQL questions posted here from time to time without 
complaints from the mods. I thought it was ok. I do appreciate the value of a 
high signal-to-noise ratio group, so I'll take this discussion elsewhere.

--
Bill Drago
Staff Engineer
L3 Narda-MITEQ
435 Moreland Road
Hauppauge, NY 11788
631-272-5947 / william.dr...@l-3com.com


CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any 
attachments are solely for the use of the addressee and may contain information 
that is privileged or confidential. Any disclosure, use or distribution of the 
information contained herein is prohibited. In the event this e-mail contains 
technical data within the definition of the International Traffic in Arms 
Regulations or Export Administration Regulations, it is subject to the export 
control laws of the U.S.Government. The recipient should check this e-mail and 
any attachments for the presence of viruses as L-3 does not accept any 
liability associated with the transmission of this e-mail. If you have received 
this communication in error, please notify the sender by reply e-mail and 
immediately delete this message and any attachments.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Possibly missing feature in json1 extension

2016-06-17 Thread Richard Hipp
New json_quote() function added on a branch
(https://www.sqlite.org/src/info/2c3714aebf5e40e3).  If there is no
pushback, and if this fixes David's problem, then this will get merged
to trunk and appear in the next release.

On 6/16/16, David Empson  wrote:
> I'm working with SQLite 3.13.0, and am the process of adding a new table to
> a database:
>
> CREATE TABLE settings(key TEXT PRIMARY KEY NOT NULL, value TEXT)
>
> This table will hold arbitrarily named application defined settings. For the
> value column I’d like to use JSON for every row, as some of the settings
> will be structured (either as arrays or objects, possibly with nested
> substructures). The json1 extension seems to cover most of what I need
> (without having a separate JSON library outside of SQLite), but I've run
> into a problem which might point to a missing function.
>
> I can easily deal with arrays and objects using functions like json_array(),
> but I'm having trouble with simple values, particularly strings: there
> appears to be no function to turn an SQLite text value into a simple JSON
> text value, without putting it in an array or object.
>
> e.g. this is fine:
>
> sqlite> SELECT json_array('one',2,'we"ird');
> ["one",2,"we\"ird"]
>
> but I can't find a way to convert just the SQLite text 'one' into the JSON
> text "one" (or 'we"ird' into "we\"ird") without the array (or object)
> wrapper.
>
> A function like json_value(value) would solve the problem. It would be a
> single argument function based on the implementation of json_array(), which
> doesn't output the square brackets. It should also support NULL and numeric
> arguments, like json_array().
>
> Converting a simple JSON value back to native SQLite types is easy:
> json_extract(json,'$'), or I can use json_each() or json_tree() to parse the
> JSON values without knowing their structure.
>
> Perhaps json_set() should be able to handle this? I tried something like
> this:
>
> sqlite> SELECT json_set('null', '$', 'test');
> test
>
> It copies the string in the third parameter, but doesn't output valid JSON
> because the quotes haven't been added. Is this a bug?
>
>
> As an interim solution, I can modify a local copy of the json1 extension to
> add my proposed function, but it would be nice if this was standard in a
> later version.
>
> Here is a draft implementation:
>
> static void jsonValueFunc(
>   sqlite3_context *ctx,
>   int argc,
>   sqlite3_value **argv
> ){
>   JsonString jx;
>
>   jsonInit(, ctx);
>   jsonAppendValue(, argv[0]);
>   jsonResult();
>   sqlite3_result_subtype(ctx, JSON_SUBTYPE);
> }
> with this definition in the aFunc[] array:
>
> { "json_value",  -1, 0,   jsonValueFunc },
>
>
> A workaround I've found is to use  json_array('text') wrapped in SQLite
> functions to strip the square brackets off the array, but that seems ugly.
>
> An alternative solution would be that I only use JSON for the complex
> settings and leave the simple ones stored using SQLite native types, but
> that either means adding a column to track which ones are JSON, or having
> inherent knowledge for each setting, which could lead to compatibility
> problems and potential ambiguity if a future update changes to using JSON
> for an existing setting, and an existing value happens to be valid JSON,
> such as the word 'true'.
>
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] rand_s and Windows 2000

2016-06-17 Thread Richard Hipp
On 6/17/16, Alex Alabuzhev  wrote:
> Hi guys,
>
> SQlite 3.12 and newer uses rand_s in winRandomness() implementation.
>
> rand_s depends  on
> RtlGenRandom 
> API
> (aka Advapi32.dll::SystemFunction036), which is only available in Windows
> XP and later.
>
> Could you please consider using rand() instead, or, say, using rand_s()
> only if SystemFunction036 is present in advapi32.dll, or any other
> apprropriate way to remove this dependency?
>

The use of rand_s() is already predicated on

#if defined(_MSC_VER) && _MSC_VER>=1400 && !SQLITE_OS_WINCE

Can you suggest an additional term or terms for this #if statement
that would cause rand_s() to be omitted from the obsolete Windows
systems you are targeting?

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_column_origin_name for INSERT and UPDATE

2016-06-17 Thread Rapin Patrick

> Le 17 juin 2016 à 13:35, Hick Gunter  a écrit :
> 
> Does
> 
> .pragma table_info();
> 
> not solve your problem?
> 

I indeed need PRAGMA table_info(), to get type names from column names.
Let my rephrase my question:

Find a generic way to retrieve column names and table name (and then column 
types with above pragma) in a arbitrary single SQL statement for all 
placeholder values.

Examples:
"INSERT INTO t1(col1, col2) VALUES(2, ?); » => (t1, col2)
"UPDATE t2 SET col1=? WHERE col2=? " => (t2, col1) and (t2, col2)
"SELECT * from t1 WHERE col2=?" => (t1, col2)

With regular expressions, I was in fact able to implement my feature for INSERT 
and UPDATE in a acceptable way (without supporting the WHERE nor WITH clauses).
But I was asking if there is a better solution, not requiring slow regex, using 
information SQLite3 already has internally about placeholder values.

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


[sqlite] rand_s and Windows 2000

2016-06-17 Thread Alex Alabuzhev
Hi guys,

SQlite 3.12 and newer uses rand_s in winRandomness() implementation.

rand_s depends  on
RtlGenRandom  API
(aka Advapi32.dll::SystemFunction036), which is only available in Windows
XP and later.

Could you please consider using rand() instead, or, say, using rand_s()
only if SystemFunction036 is present in advapi32.dll, or any other
apprropriate way to remove this dependency?

Thanks.

-- 
Best regards,
  Alex
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite database is locked when query SQLITE_MASTER table

2016-06-17 Thread Bhavesh Patel

I have the huge size of the database file (approx 5.5GB).

I have two processes.

1.The first process:
It executes master table query. (Ex. "SELECT "type", "tbl_name" FROM 
"SQLite_MASTER").
It creates the new table using the dump of the existing table and database file 
size has been increased after dump ( approx  5.7 GB).
For Example:
SQL Statement: "CREATE TABLE "XYZ" AS SELECT * FROM ABC "

2. The second process:
It deletes tables which have been created by the first process.
delete query takes 4 minutes.

I have tested the three test scenario.

1. The first scenario : database is locked when I have executed "SELECT "type", 
"tbl_name" FROM "SQLite_MASTER"".

The first process execution is completed.
The second process starts and it is still running.
I execute the first process while the second process is already running.
sqlite throw error: "SELECT "type", "tbl_name" FROM "SQLite_MASTER"" in the 
first process.

2. The second scenario: database is locked when I have executed "CREATE TABLE 
XYZ AS SELECT "name" FROM "ABC".

The first process execution is completed.
The second process starts and it is still running.
I execute the first process while the second process is already running.
In the case of master table query executed successfully ("SELECT "type", 
"tbl_name" FROM "SQLite_MASTER"").
sqlite throw error: "CREATE TABLE XYZ AS SELECT "name" FROM "TEST"" in the 
first process.

3. The third scenario: There is no error.

The first process execution is completed.
The second process starts and it is still running.
I will wait for the end of execution of the second process.
After that, I start the first process for execution.
There is no error when we are execute two processes one by one.


I want to run the second process in the background.

Execute first process
Execute the second process as soon as first is executed.
While the second process is running, I want to start the first process.

I cannot combine first and second process because deleting take 4 minutes and 
my application gets busy.

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


Re: [sqlite] Correct, best, or generally accepted database structure for groups of things

2016-06-17 Thread Chris Locke
I fail to see what any of this has to do with sqlite.  I thought this was a
mailing list for sqlite?  Seeing queries (no pun intended) on sql
statements is very subjective, especially with the limited data provided by
the original poster.
Everyone will give helpful advice, but it won't stop there, and as soon as
the original poster has another query (no pun intended) which would result
in a schema change, this would have to be explained, etc.

A specific group on SQL is required.

Just my thoughts...


Chris

On Thu, Jun 16, 2016 at 10:14 PM, Simon Slavin  wrote:

>
> On 16 Jun 2016, at 9:53pm, Drago, William @ CSG - NARDA-MITEQ
>  wrote:
>
> > Should that function insert its results into a table that looks like the
> one below, or is there a better way?
> >
> > CREATE TABLE Groups (
> > ID INTEGER PRIMARY KEY,
> > AppleID1 INTEGER
> > AppleID2 INTEGER
> > AppleID3 INTEGER
> > AppleID4 INTEGER
> > );
>
> You would definitely want each of the four AppleIDs to have a FOREIGN KEY
> reference to the Apple table.
>
> An alternative to your Groups table would be a Membership table:
>
> CREATE TABLE Members (
> AppleID INTEGER,
> GroupID INTEGER,
> FOREIGN KEY (AppleID) REFERENCES Apples(ID)
> );
>
> It is the responsibility of your software to ensure that every GroupID
> appears exactly four times in Members.
>
> This would allow you to create another table, Groups, which stored things
> like the group's colour and total weight.  And this should be a foreign key
> reference for the Members table too.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_column_origin_name for INSERT and UPDATE

2016-06-17 Thread Hick Gunter
Does

.pragma table_info();

not solve your problem?

-Ursprüngliche Nachricht-
Von: sqlite-users-boun...@mailinglists.sqlite.org 
[mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Rapin 
Patrick
Gesendet: Freitag, 17. Juni 2016 10:57
An: sqlite-users@mailinglists.sqlite.org
Betreff: [sqlite] sqlite3_column_origin_name for INSERT and UPDATE

Hello,

I am using function sqlite3_column_origin_name and friends in my SQLite3 C++ 
wrapper class to get table and column names in SELECT statements.
I would like to have the same feature for INSERT and UPDATE statements: that 
is, find the table name and column names when writing to the database, not only 
reading.
I think this is impossible with current SQLite3 library, but I may be missing 
something.
The workaround I have implemented is to use some C++11 regular expressions to 
parse the SQL expression outside of SQLite3.
What would be the difficulty to support origin column names also for writing, 
not just reading ?

___

In background, I will explain the reason I would like such feature.
I know that there are already plenty of C++ wrappers over SQLite3, but I wrote 
another one for our company base framework.
I think it has plenty of qualities:
simple: essentially a single function, executeQuery, using a variadic signature 
like printf (but type safe, thanks to C++11 variadic templates !) automatic 
caching of instructions (does not recompile same SQL expression if already in 
the cache) automatic binding of both input and output arguments
fast: the overhead over calling manually SQLite3 functions is minimum natively 
support the C++ base classes of our framework (also a drawback: I could not 
distribute that wrapper by itself) have a limited support for units in numeric 
values.

The last point is the reason for my request. For example, if a table was 
created with that command:

CREATE TABLE t1 (speed REAL_m_per_s);

SQLite3 will assign to speed column an affinity of floating point value since 
it has REAL in the type.
And my C++ wrapper then knows that this column is a speed expressed in meters 
per second.
So when making a SELECT on t1 table, the wrapper will output number objects 
with unit dimension of Speed expressed in m/s !

To be complete, I want to check when writing to database (UPDATE or INSERT) 
that the unit contained in the input values match the expected type of the 
column.
Possibly making unit conversion on the fly (m -> ft).
But for that, I need to find out the column names and table name implied in a 
UPDATE or INSERT statement.

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


___
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


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


[sqlite] sqlite3_column_origin_name for INSERT and UPDATE

2016-06-17 Thread Rapin Patrick
Hello,

I am using function sqlite3_column_origin_name and friends in my SQLite3 C++ 
wrapper class to get table and column names in SELECT statements. 
I would like to have the same feature for INSERT and UPDATE statements: that 
is, find the table name and column names when writing to the database, not only 
reading.
I think this is impossible with current SQLite3 library, but I may be missing 
something.
The workaround I have implemented is to use some C++11 regular expressions to 
parse the SQL expression outside of SQLite3.
What would be the difficulty to support origin column names also for writing, 
not just reading ?

___

In background, I will explain the reason I would like such feature.
I know that there are already plenty of C++ wrappers over SQLite3, but I wrote 
another one for our company base framework.
I think it has plenty of qualities:
simple: essentially a single function, executeQuery, using a variadic signature 
like printf (but type safe, thanks to C++11 variadic templates !)
automatic caching of instructions (does not recompile same SQL expression if 
already in the cache)
automatic binding of both input and output arguments
fast: the overhead over calling manually SQLite3 functions is minimum
natively support the C++ base classes of our framework (also a drawback: I 
could not distribute that wrapper by itself)
have a limited support for units in numeric values.

The last point is the reason for my request. For example, if a table was 
created with that command:

CREATE TABLE t1 (speed REAL_m_per_s);

SQLite3 will assign to speed column an affinity of floating point value since 
it has REAL in the type.
And my C++ wrapper then knows that this column is a speed expressed in meters 
per second. 
So when making a SELECT on t1 table, the wrapper will output number objects 
with unit dimension of Speed expressed in m/s !

To be complete, I want to check when writing to database (UPDATE or INSERT) 
that the unit contained in the input values match the expected type of the 
column.
Possibly making unit conversion on the fly (m -> ft).
But for that, I need to find out the column names and table name implied in a 
UPDATE or INSERT statement.

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