[sqlite] SQLite remote access over WAN

2016-01-07 Thread a...@zator.com
>  Mensaje original 
> De: Eduardo Morras 
> Para:  sqlite-users at mailinglists.sqlite.org
> Fecha:  Mon, 4 Jan 2016 23:27:35 +0100
> Asunto:  Re: [sqlite] SQLite remote access over WAN
>
>On Mon, 04 Jan 2016 22:52:56 +0100
>ajm at zator.com wrote:
>
>> Hi list:
>> 
>> I've built a Windows desktop app using MS Visual C++ and SQLite. It
>> works fair well in local mode, but now I need made it work over a
>> TCP/IP network.
>> 
>> My question is if some in this list can suggest a library to that
>> purpose, on the basis that I have not concerns on questions like
>> concurrency, access permissions or encriptation. Preferable a light
>> weigth open source C/C++ library. Not .NET, MFC or other external
>> dependencies, although Boost Asio may be Ok. (already I'm using it)
>
>I used libevent (http://libevent.org/), ZMQ (http://zeromq.org/), nanomsg 
>(http://nanomsg.org/) and plain standard libc in different projects. Depending 
>on what you need, where your app will work, the workload you'll have, "the 
>marketing wise boys" opinion, etc...  you should choose one or another.
>

Eduardo:

Thanks for your input.

The ZeroMQ framework seem promising, but still I need some dig in it, and see 
if its asynchronous mode can be adequate to my purposes.

As as far as I can see, the matter has no easy solution (in Windows without 
.NET), so as a last resource, perhaps I use a plain skeletal RPC mechanism 
(MSRPC).

Cheers.

--
Adolfo J. Millan.



[sqlite] SQLite remote access over WAN

2016-01-04 Thread a...@zator.com
Hi list:

I've built a Windows desktop app using MS Visual C++ and SQLite. It works fair 
well in local mode, but now I need made it work over a TCP/IP network.

My question is if some in this list can suggest a library to that purpose, on 
the basis that I have not concerns on questions like concurrency, access 
permissions or encriptation. Preferable a light weigth open source C/C++ 
library. Not .NET, MFC or other external dependencies, although Boost Asio may 
be Ok. (already I'm using it)

Of course, I've done some dig in Google, codeproject, Stack Overflow, and so 
on. But at the moment I have not a formed opini?n on that respect. Not to say 
that in most cases, the concern turn around questions like performance, 
concurrency, threads and so on. In this respect, the SQLite Network page 
(http://www2.sqlite.org/cvstrac/wiki?p=SqliteNetwork) seems a bit outdate, and 
that by the way, a reference, the one of "uSQLiteServer and Client" seem to 
refer to a dangerous site (Google Chrome security warning).

Any sugestion or comment are wellcome.

--
Adolfo J. Mill?n




[sqlite] Problem when upgrading from FTS3/4toFTS5modules(revisited)

2015-12-15 Thread a...@zator.com

>
>  Mensaje original 
> De: Dan Kennedy 
> Para:  sqlite-users at mailinglists.sqlite.org
> Fecha:  Mon, 14 Dec 2015 19:15:23 +0700
> Asunto:  Re: [sqlite] Problem when upgrading from 
> FTS3/4toFTS5modules(revisited)
>
> 
>
>So that looks like database corruption, except we don't think the 
>database is actually corrupt as the DROP TABLE statement did not fail 
>when run in the shell tool. So perhaps heap-corruption has caused the 
>in-memory cache to become corrupt.
>
>Can you run the whole thing under valgrind?
>

Dan:

This is a Windows app build with MS Visual Studio C++, so can't use Valgrind.

Perhaps the cause is a heap corruption, but I doubt because the problem behaves 
consistently in the following scenarios:

a.- The problem appears only when the table is build with the FTS5 modules and 
not when using FTS3/4.
b.- The problem appears when calling the query in different points in the code.
c.- The problem appears in both: debug mode and release mode.
d.- The code behaves correctly changing the name of the table (deletes 
successfully any other table).

I'm pending to tests the same whith other System version in the same equipe 
(actually using Windows 10 with AMD 64 bits, but can boot the same with Window 
7).

Any way I managed a workaround with a fakeDelete function with this logic:

Detect if the table ftsm exist:

Not exist:
   -> Create and populate the table.

Exists
   -> "DELETE FROM ftsm WHERE nm IS NOT null" (hope this erase all files)
   -> "VACUUM ftsm"
   -> Populate the table

Cheers.

--
Adolfo J. Millan




[sqlite] Problem when upgrading from FTS3/4 toFTS5modules(revisited)

2015-12-13 Thread a...@zator.com
I apologize for the mistake, but you must forget my last two posts (probably 
due the tiredness or the excitement of the moment).

In fact, the query "DELETE TABLE IF EXIST database_name.table_name" goes 
flawlessly, but indeed does not drop the table.

Sorry for the confusion.

--
Adolfo J. Millan



[sqlite] Problem when upgrading from FTS3/4 toFTS5modules(revisited)

2015-12-13 Thread a...@zator.com

Oops:

Sorry for the typo. I mean

"DROP TABLE IF EXISTS database_name.table_name"

--
Adolfo J. Millan





[sqlite] Problem when upgrading from FTS3/4 toFTS5modules(revisited)

2015-12-13 Thread a...@zator.com

>
>  Mensaje original 
> De: Dan Kennedy 
> Para:  sqlite-users at mailinglists.sqlite.org
> Fecha:  Fri, 11 Dec 2015 22:54:45 +0700
> Asunto:  Re: [sqlite] Problem when upgrading from FTS3/4 
> toFTS5modules(revisited)
>
> 
>
>Are you able to compile a debugging build of SQLite and set a breakpoint 
>in sqlite3CorruptError()?
>
>Assuming the breakpoint is triggered within the DROP TABLE IF EXISTS 
>statement (pretty good chance), the stack trace will tell us more about 
>the form of corruption SQLite thinks it has found.
>
>

By the way, diggin in Google for solutions, I gave a try to the complete syntax 
for the DROP TABLE query, and has found that the form "DROP TABLE IF EXIST 
table_name.ftsm" goes flawlessly.

So:

- I've a workaround to the problem.

- I'm pretty sure that the problem isn't in my code.

HTH.

--
Adolfo J. Millan




[sqlite] Problem when upgrading from FTS3/4 toFTS5modules(revisited)

2015-12-13 Thread a...@zator.com
>
>  Mensaje original 
> De: Dan Kennedy 
> Para:  sqlite-users at mailinglists.sqlite.org
> Fecha:  Fri, 11 Dec 2015 22:54:45 +0700
> Asunto:  Re: [sqlite] Problem when upgrading from FTS3/4 
> toFTS5modules(revisited)
>
>>>
 1a.- Delete the previous table.
 DROP TABLE IF EXIST ftsm

 This scheme work ok with the FST3/4 modules, but compiling with FTS5 gives 
 an erroro in 1a:  "database disk image is malformed".

 Note that in previous attemps I believed that the problem was into try to 
 delete a ftsm table build with the previous modules, but the error happen 
 when trying delete a table build with the FTS5 module.

 ...
>> Some clues?
> Not really sure why it might fail there. Can you post the entire
> database schema (results of "SELECT * FROM sqlite_master" or the output
> of the .schema shell tool command)?
>
 Dan:

 Here is the schema:
>>> That all looks Ok.
>>>
>>> If you use the shell tool to execute the "DROP TABLE IF EXISTS ftsm"
>>> command does it report an error as well?
>>>
>> Dan:
>>
>> Surprisingly, the shell does not complain when using the same query, and 
>> indeed, drop the table.
>>
>> Yeah, I also believe that the problem is in my roof, although that code has 
>> been behaving Ok from ages with the FTS3/4 modules (only changes some 
>> directives in other places of the code).
>>
>> Any way, when running again the code when the table has been previously 
>> erased (with the shell), the routine works without complaint (executes the 
>> query correctly), and despite the warning, the rest of the app behaves 
>> correctly and the queries related with the search works fine.
>>
>> When the table exist, the debugger shows that sqlite3_prepare_v2() ends Ok, 
>> but sqlite3_step() ends with error 11.
>
>Are you able to compile a debugging build of SQLite and set a breakpoint 
>in sqlite3CorruptError()?
>
>Assuming the breakpoint is triggered within the DROP TABLE IF EXISTS 
>statement (pretty good chance), the stack trace will tell us more about 
>the form of corruption SQLite thinks it has found.
>

Dan:

I managed a breakpoint int the requested function, and can tell that it has 
been called twice inside the sqlite3_step() function before it returns.

Here you have the call's stack:

First call of sqlite3CorrupError()  lineno == 56209

sqlite3CorruptError(int lineno) Line 133961
decodeFlags(MemPage * pPage, int flagByte) Line 56209
btreeInitPage(MemPage * pPage) Line 56251
getAndInitPage(BtShared * pBt, unsigned int pgno, MemPage * * ppPage, BtCursor 
* pCur, int bReadOnly) Line 56495
clearDatabasePage(BtShared * pBt, unsigned int pgno, int freePageFlag, int * 
pnChange) Line 62907
sqlite3BtreeClearTable(Btree * p, int iTable, int * pnChange) Line 62970
btreeDropTable(Btree * p, unsigned int iTable, int * piMoved) Line 63028
sqlite3BtreeDropTable(Btree * p, int iTable, int * piMoved) Line 63111
sqlite3VdbeExec(Vdbe * p) Line 77954
sqlite3Step(Vdbe * p) Line 71546
sqlite3_step(sqlite3_stmt * pStmt) Line 71608
sqlite3_exec(sqlite3 * db, const char * zSql, int (void *, int, char * *, char 
* *) * xCallback, void * pArg, char * * pzErrMsg) Line 103955
fts5ExecPrintf(sqlite3 * db, char * * pzErr, const char * zFormat, ...) Line 
180863
sqlite3Fts5DropAll(Fts5Config * pConfig) Line 180876
fts5DestroyMethod(sqlite3_vtab * pVtab) Line 178532
sqlite3VtabCallDestroy(sqlite3 * db, int iDb, const char * zTab) Line 117587
sqlite3VdbeExec(Vdbe * p) Line 79084
sqlite3Step(Vdbe * p) Line 71546
sqlite3_step(sqlite3_stmt * pStmt) Line 71608

Secon call of sqlite3CorrupError() lineno == 56251

sqlite3CorruptError(int lineno) Line 133961
btreeInitPage(MemPage * pPage) Line 56251
getAndInitPage(BtShared * pBt, unsigned int pgno, MemPage * * ppPage, BtCursor 
* pCur, int bReadOnly) Line 56495
...
Rest the same...

Note that the line numbers can be slightly greater than the ones in the 
original file (SQLite 3.9.1) because the inclusion of some comments.

As I can reproduce the problem as needed, In case of interest, I can try to 
provide any intermediate value inside the stack.

Thanks again for yours attention.

--
Adolfo J. Millan




[sqlite] Problem when upgrading from FTS3/4 to FTS5modules(revisited)

2015-12-11 Thread a...@zator.com

>
>  Mensaje original 
> De: Dan Kennedy 
> Para:  sqlite-users at mailinglists.sqlite.org
> Fecha:  Fri, 11 Dec 2015 15:28:33 +0700
> Asunto:  Re: [sqlite] Problem when upgrading from FTS3/4 to 
> FTS5modules(revisited)
>
>> 1a.- Delete the previous table.
>> DROP TABLE IF EXIST ftsm
>>
>> This scheme work ok with the FST3/4 modules, but compiling with FTS5 gives 
>> an erroro in 1a:  "database disk image is malformed".
>>
>> Note that in previous attemps I believed that the problem was into try to 
>> delete a ftsm table build with the previous modules, but the error happen 
>> when trying delete a table build with the FTS5 module.
>>
>> ...
 Some clues?
>>> Not really sure why it might fail there. Can you post the entire
>>> database schema (results of "SELECT * FROM sqlite_master" or the output
>>> of the .schema shell tool command)?
>>>
>> Dan:
>>
>> Here is the schema:
>
>That all looks Ok.
>
>If you use the shell tool to execute the "DROP TABLE IF EXISTS ftsm" 
>command does it report an error as well?
>

Dan:

Surprisingly, the shell does not complain when using the same query, and 
indeed, drop the table.

Yeah, I also believe that the problem is in my roof, although that code has 
been behaving Ok from ages with the FTS3/4 modules (only changes some 
directives in other places of the code).

Any way, when running again the code when the table has been previously erased 
(with the shell), the routine works without complaint (executes the query 
correctly), and despite the warning, the rest of the app behaves correctly and 
the queries related with the search works fine.

When the table exist, the debugger shows that sqlite3_prepare_v2() ends Ok, but 
sqlite3_step() ends with error 11.

When the table is already deleted, sqlite3_prepare_v2() ends Ok, and 
sqlite3_step() ends with 101.

Frankly, because the routine is the same in both times, and there are not 
variables to bind, really I don't know where to look. Anyway thanks for your's 
attention.

Cheers!

--
Adolfo J. Millan



[sqlite] Problem when upgrading from FTS3/4 to FTS5 modules(revisited)

2015-12-10 Thread a...@zator.com

>
>  Mensaje original 
> De: Dan Kennedy 
> Para:  sqlite-users at mailinglists.sqlite.org
> Fecha:  Fri, 11 Dec 2015 02:41:43 +0700
> Asunto:  Re: [sqlite] Problem when upgrading from FTS3/4 to FTS5 
> modules(revisited)
>
>>
...
>> 1a.- Delete the previous table.
>> DROP TABLE IF EXIST ftsm
>>
>> This scheme work ok with the FST3/4 modules, but compiling with FTS5 gives 
>> an erroro in 1a:  "database disk image is malformed".
>>
>> Note that in previous attemps I believed that the problem was into try to 
>> delete a ftsm table build with the previous modules, but the error happen 
>> when trying delete a table build with the FTS5 module.
>>
...
>>
>> Some clues?
>
>Not really sure why it might fail there. Can you post the entire 
>database schema (results of "SELECT * FROM sqlite_master" or the output 
>of the .schema shell tool command)?
>

Dan:

Here is the schema:

CREATE VIRTUAL TABLE ftsm USING fts5(nm,tokenize='porter unicode61 remove_diacri
tics 0',columnsize=0);

And here the entire database schema as produced by the shell:

sqlite> SELECT * FROM sqlite_master;
table|usr|usr|2|CREATE TABLE usr (ky INTEGER PRIMARY KEY,id CHARACTER UNIQUE,lev
 INTEGER,pwd TEXT)
index|sqlite_autoindex_usr_1|usr|3|
table|block|block|4|CREATE TABLE block (Stat INTEGER,User INTEGER,Page TEXT,Text
 INTEGER)
table|FreqUse|FreqUse|5|CREATE TABLE FreqUse (Stat INTEGER,User INTEGER,Page TEX
T,Text INTEGER)
table|blb|blb|6|CREATE TABLE blb (Id INTEGER PRIMARY KEY,Nm INTEGER)
table|atm|atm|7|CREATE TABLE atm (Id INTEGER PRIMARY KEY,Nm INTEGER,Cl INTEGER,D
c REAL,Dm REAL,St INTEGER)
table|coco|coco|8|CREATE TABLE coco (Id INTEGER PRIMARY KEY,Nm INTEGER,Cl INTEGE
R,Dc REAL,Dm REAL,St INTEGER)
table|lnk|lnk|9|CREATE TABLE lnk (So INTEGER NOT NULL,Ta INTEGER NOT NULL,Cl INT
EGER,Tpt INTEGER,UNIQUE (So,Ta,Cl),CHECK(typeof(So)='integer'),CHECK(typeof(Ta)=
'integer'),CHECK((typeof(Cl)='integer') OR (typeof(Cl)='null')))
index|sqlite_autoindex_lnk_1|lnk|10|
table|prm|prm|11|CREATE TABLE prm(ref INTEGER, val INTEGER, own INTEGER, UNIQUE(
ref, own))
index|sqlite_autoindex_prm_1|prm|12|
table|email|email|13|CREATE TABLE email (Id INTEGER PRIMARY KEY, Tit INTEGER, No
m INTEGER, Org INTEGER,eHnm INTEGER, ePort INTEGER, eUnm INTEGER, ePsw INTEGER,
eScon INTEGER, eDel INTEGER,sHnm INTEGER, sPort INTEGER, sUnm INTEGER, sPsw INTE
GER, sScon INTEGER,Enam INTEGER, Rnam INTEGER, Unam INTEGER, Onam INTEGER, iucs
INTEGER, sec1 INTEGER, sec2 INTEGER, sec3 INTEGER, sec4 INTEGER,Cl INTEGER, St I
NTEGER, aux1 INTEGER, aux2 INTEGER, aux3 INTEGER, aux4 INTEGER, aux5 INTEGER, au
x6 INTEGER, aux7 INTEGER)
view|AgVtHolder|AgVtHolder|0|CREATE VIEW AgVtHolder AS SELECT id FROM atm WHERE
id IN(SELECT so FROM lnk L WHERE L.ta=73 AND L.cl=47)
view|AgVtIDt|AgVtIDt|0|CREATE VIEW AgVtIDt AS SELECT L.ta AS 'Hd', C.nm AS 'Dt'
FROM atm C, lnk L WHERE C.cl=17 AND C.id IN (SELECT L.so FROM lnk L WHERE L.cl=4
8 AND L.ta IN(SELECT id FROM AgVtHolder)) AND L.so=C.id
view|AgVtPre|AgVtPre|0|CREATE VIEW AgVtPre AS SELECT L.ta AS 'Hd', CAST(Nm AS IN
T) AS 'Pr' FROM atm C, lnk L WHERE C.cl=17 AND C.id IN(SELECT so FROM lnk L WHER
E L.cl=49 AND L.ta IN (SELECT C.id FROM atm C WHERE id IN(SELECT so FROM lnk L W
HERE L.ta=73 AND L.cl=47))) AND L.So=C.id
view|AgVtos|AgVtos|0|CREATE VIEW AgVtos AS SELECT D.Hd AS 'Hd', D.Dt AS 'Dt', P.
Pr AS 'Pr' FROM AgVtIDt D, AgVtPre P WHERE P.Hd=D.Hd
view|AgPdHolder|AgPdHolder|0|CREATE VIEW AgPdHolder AS SELECT id FROM atm WHERE
id IN(SELECT So FROM lnk L WHERE L.ta=75 AND L.cl=53)
view|AgPdIDt|AgPdIDt|0|CREATE VIEW AgPdIDt AS SELECT L.ta AS 'Hd', C.Nm AS 'Dt'
FROM atm C, lnk L WHERE C.Cl=18 AND C.id IN (SELECT L.so FROM lnk L WHERE L.cl=5
4 AND L.ta IN(SELECT id FROM AgPdHolder)) AND L.so=C.id
view|AgEfHolder|AgEfHolder|0|CREATE VIEW AgEfHolder AS SELECT id FROM atm WHERE
id IN(SELECT So FROM lnk L WHERE L.ta=77 AND L.cl=59)
view|AgEfIDt|AgEfIDt|0|CREATE VIEW AgEfIDt AS SELECT L.ta AS 'Hd', C.Nm AS 'Dt'
FROM atm C, lnk L WHERE C.Cl=19 AND C.id IN (SELECT L.So FROM lnk L WHERE L.cl=6
0 AND L.ta IN(SELECT id FROM AgEfHolder)) AND L.So=C.id
view|AgEfKlv|AgEfKlv|0|CREATE VIEW AgEfKlv AS SELECT L.ta AS 'Hd', C.Nm AS 'Kl'
FROM atm C, lnk L WHERE C.cl=19 AND C.id IN(SELECT so FROM lnk L WHERE L.cl=61 A
ND L.ta IN (SELECT C.id FROM atm C WHERE id IN(SELECT so FROM lnk L WHERE L.ta=7
7 AND L.cl=59))) AND L.so=C.id
view|AgEfemer|AgEfemer|0|CREATE VIEW AgEfemer AS SELECT D.Hd AS 'Hd', D.Dt AS 'D
t', P.Kl AS 'Kl' FROM AgEfIDt D, AgEfKlv P WHERE P.Hd=D.Hd
table|ftsm|ftsm|0|CREATE VIRTUAL TABLE ftsm USING fts5(nm,tokenize='porter unico
de61 remove_diacritics 0',columnsize=0)
table|ftsm_data|ftsm_data|11332|CREATE TABLE 'ftsm_data'(id INTEGER PRIMARY KEY,
 block BLOB)
table|ftsm_idx|ftsm_idx|11333|CREATE TABLE 'ftsm_idx'(segid, term, pgno, PRIMARY
 KEY(segid, term)) WITHOUT ROWID
table|ftsm_content|ftsm_content|11334|CREATE TABLE 'ftsm_content'(id INTEGER PRI
MARY KEY, c0)
table|ftsm_config|ftsm_config|11335|CREATE TABLE 'ftsm_config'(k PRIMARY 

[sqlite] Problem when upgrading from FTS3/4 to FTS5 modules (revisited)

2015-12-09 Thread a...@zator.com
Hi list:

In a C++ Windows app that uses SQLite v. 3.9.1 and behaves well, I try change 
the search engine from FTS3/4 modules to FTS5, by means off:

1. Define the directive
#define SQLITE_ENABLE_FTS5 1

2.-  Create the table:
CREATE VIRTUAL TABLE ftsm USING fts5(nm,tokenize='porter unicode61 
remove_diacritics 0',columnsize=0)

3.- Populate the table:
INSERT INTO ftsm (row,nm) SELECT id,nm FROM atm WHERE(..)

After that, the app and the search engine works as espected.

To update the ftsm table after several inserts and deletes, I try to follow 
this steps

1a.- Delete the previous table.
DROP TABLE IF EXIST ftsm

2a.- Create table (as above)

3a.- Populate table (as above).

This scheme work ok with the FST3/4 modules, but compiling with FTS5 gives an 
erroro in 1a:  "database disk image is malformed".

Note that in previous attemps I believed that the problem was into try to 
delete a ftsm table build with the previous modules, but the error happen when 
trying delete a table build with the FTS5 module.

I managed to drop the ftsm table by means of create a new dbase; create the 
same tables (except ftsm); populate the tables, and replacing the previous 
dbase with the new one. But obviously, this method is primitive; time 
consuming, and has problems when the dbase is in use.

Some clues?

Thanks in advance.

--
Adolfo J. Millan




[sqlite] Problem when upgrading from FTS3/4 to FTS5 modules

2015-11-11 Thread a...@zator.com
>  Mensaje original 
> De: Richard Hipp  
>Fecha: 4/11/2015 23:23 (GMT+01:00)
>Para: SQLite mailing list 
>Asunto: Re: [sqlite] Problem when upgrading from FTS3/4 to FTS5 modules 

>Here is a hack.
>Let the name of your FTS3 table be "xyzzy"
>(1) Invoke "PRAGMA writable_schema=ON". (Read the documentation about
>the dangers thereof. Do not complain if something goes wrong and you
>corrupt your database.)
>(2) Run "DELETE FROM sqlite_master WHERE name='xyzzy';"
>(3) Set "PRAGMA writable_schema=OFF" again.
>(4) Run the following:
>
>DROP TABLE IF EXISTS xyzzy_content;
>DROP TABLE IF EXISTS xyzzy_segments;
>DROP TABLE IF EXISTS xyzzy_segdir;
>DROP TABLE IF EXISTS xyzzy_docsize;
>DROP TABLE IF EXISTS xyzzy_stat;

Thanks a lot
That tricky worked fine.

--
Adolfo




[sqlite] "Shipping a New Mindset" - SQLite in Windows 10

2015-11-11 Thread a...@zator.com

>
>  Mensaje original 
> De: Simon Slavin 
> Para:  SQLite mailing list 
> Fecha:  Wed, 11 Nov 2015 09:25:47 +
> Asunto:  Re: [sqlite] "Shipping a New Mindset" - SQLite in Windows 10
>
>There's a story behind this.
>
>During the review leading to HTML5 the web consortium (the one which decides 
>which features should be introduced to HTML/CSS/JavaScript) listed a 
>'webdatabase' specification so that browsers could maintain data in a 
>database-like structure.  The specification boiled down to "Implement a simple 
>SQL engine with an API like [this].".
>
>Unfortunately all the leading browser publishers implemented this happily and 
>quickly.  "Unfortunately" because they all did it by including SQLite in their 
>project.  This is a problem because the only way to ensure compatibility in 
>that case is for the web consortium to include the full specification of 
>SQLite inside the specification for a compatible web browser.  Otherwise 
>people would start doing things like calling PRAGMA commands from web pages, 
>and then an unofficial standard would evolve which required PRAGMA commands to 
>be supported from the web API.
>
>So they did.  And it failed.  And that's where we are today.
>

Simon:

You are right, and I realized that before. By the way the "storage" issue from 
JavaScript has been my nightmare in the recent past.

I believe that it's a nonsense that the standard suppose a limitation in the 
field. Although it seem that the Standard work like the lawyers who usually go 
behind the real life. But that reminds me the adoption of the C++ STL whos 
first incarnation was -I think remember- in a unique piece from HP and nobody 
put objections.

Any way in the real life we need it desperately IMHO.

--
Adolfo




[sqlite] "Shipping a New Mindset" - SQLite in Windows 10

2015-11-11 Thread a...@zator.com
>  Mensaje original 
> De: Richard Hipp 
> Para:  General Discussion of SQLite Database mailinglists.sqlite.org>
> Fecha:  Tue, 10 Nov 2015 14:41:28 -0500
> Asunto:  [sqlite] "Shipping a New Mindset" - SQLite in Windows 10
> 
>
>http://engineering.microsoft.com/2015/10/29/sqlite-in-windows-10/
>

Congratulations to all the team. A great praise coming from M$.

A great notice to all us who write Windows. And a final prayer to MS: add an 
extension to use it from JavaScript.

--
Adolfo J. Millan



[sqlite] Problem when upgrading from FTS3/4 to FTS5 modules

2015-11-04 Thread a...@zator.com
Hi list:

Using SQLite 3.9.1, suppose a C++ application using FTS3/4 modules with this 
pseudocode:

1a In config.h

#define SQLITE_ENABLE_FTS3 1
#define SQLITE_ENABLE_FTS3_PARENTHESIS 1

2a.- Delete the previous table if exist

DROP TABLE IF EXISTS ftsm

3a.- Then create the table

CREATE VIRTUAL TABLE ftsm USING fts4(nm,tokenize=simple,matchinfo=fts3)

4a.- Populate the table

INSERT INTO ftsm (rowid,nm) SELECT id,nm FROM atm WHERE(...)

The app run as espected and the search mechanism work as a charm.

Then try to upgrade the app to use the FTS5 module -within the previous dbases- 
with this pseudocode:

1b In config.h

#define SQLITE_ENABLE_FTS5 1

2b.- Delete the previous table if exist (same as previous)

DROP TABLE IF EXISTS ftsm

3b.- Then create the table

CREATE VIRTUAL TABLE ftsm USING fts5(nm,tokenize='unicode61 
remove_diacritics 0',columnsize=0)

4b.- Populate the table (same as previous)

INSERT INTO ftsm (rowid,nm) SELECT id,nm FROM atm WHERE(...)

When reaching 2b, the new app show an error: "no such module: fts4"

When accessing the dataBase with the shell, the .tables command show the ftsm 
table. Then, using manually the 2a query ("DROP TABLE IF EXISTS ftsm;") the 
table is deleted without complain and the .tables command show that the table 
not longer exist.

Then, the app step thru 2b without complain and creates and populates the new 
table smoothly (steps 3b and 4b).

The question: do is there any method to delete the old table without including 
the FTS3/4 modules to those users "in the field"?

Thanks for any idea.

--
Adolfo J. Millan




[sqlite] Erros using some compiler options for SQLite 3. and V. Studio 2015

2015-10-25 Thread a...@zator.com
Keith:

Thank a lot.

Now, the file compiles without error, although still there are two warnings 
(unreferenced local variables):

1>sqlite3\sqlite3.c(79452): warning C4101: 'z': variable local sin referencia

1>sqlite3\sqlite3.c(79451): warning C4101: 'zTrace': variable local sin 
referencia

Perhaps the sentence

 #ifndef SQLITE_OMIT_TRACE

must be moved up a couple lines 

Thanks again.

--
Adolfo

>
>  Mensaje original 
> De: "Keith Medcalf" 
> Para:  "ajm at zator.com" , "General Discussion of SQLite 
> Database" 
> Fecha:  Sun, 25 Oct 2015 13:56:33 -0600
> Asunto:  RE: [sqlite] Erros using some compiler options for SQLite 3. and V. 
> Studio 2015
>
>
>Try changing:
>
>> #define SQLITE_OMIT_TCL_VARIABLE
>> #define SQLITE_OMIT_PROGRESS_CALLBACK
>> #define SQLITE_OMIT_FOREIGN_KEY
>> #define SQLITE_OMIT_AUTOVACUUM
>> #define SQLITE_OMIT_EXPLAIN
>> #define SQLITE_SECURE_DELETE
>> #define SQLITE_OMIT_BUILTIN_TEST
>> #define SQLITE_OMIT_TRACE
>> #define SQLITE_ENABLE_FTS3
>> #define SQLITE_ENABLE_FTS3_PARENTHESIS
>
>to
>
>#define SQLITE_OMIT_TCL_VARIABLE 1
>#define SQLITE_OMIT_PROGRESS_CALLBACK 1
>#define SQLITE_OMIT_FOREIGN_KEY 1
>#define SQLITE_OMIT_AUTOVACUUM 1
>#define SQLITE_OMIT_EXPLAIN 1
>#define SQLITE_SECURE_DELETE 1
>#define SQLITE_OMIT_BUILTIN_TEST 1
>#define SQLITE_OMIT_TRACE 1
>#define SQLITE_ENABLE_FTS3 1
>#define SQLITE_ENABLE_FTS3_PARENTHESIS 1
>
>in your config.h and see if this resolves the issue.
>
>> -Original Message-
>> From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-
>> bounces at mailinglists.sqlite.org] On Behalf Of ajm at zator.com
>> Sent: Sunday, 25 October, 2015 13:24
>> To: sqlite-users at mailinglists.sqliteorg
>> Subject: [sqlite] Erros using some compiler options for SQLite 3. and V.
>> Studio 2015
>> 
>> Hi list:
>> 
>> Using SQLite v.3.9.1 amalgamation code.
>> MS Visual Studio 2015 for desktop C++ compiler
>> 
>> I've got the same compiler error
>> 
>> 1>sqlite3\sqlite3.c(x): fatal error C1017: expresi?n constante de tipo
>> entero no v?lida
>> 
>>  in the following lines of sqlite3.c:
>> 
>>  #if SQLITE_ENABLE_FTS3
>>  #if SQLITE_ENABLE_FTS3_PARENTHESIS
>>  #if SQLITE_OMIT_AUTOVACUUM
>>  #if SQLITE_OMIT_BUILTIN_TEST
>>  #if SQLITE_OMIT_EXPLAIN
>>  #if SQLITE_OMIT_FOREIGN_KEY
>>  #if SQLITE_OMIT_PROGRESS_CALLBACK
>>  #if SQLITE_OMIT_TCL_VARIABLE
>>  #if SQLITE_OMIT_TRACE
>>  #if SQLITE_SECURE_DELETE
>> 
>> The application compiles correctly except when includes the config.h file
>> with these compiler options:
>> 
>> #define SQLITE_OMIT_TCL_VARIABLE
>> #define SQLITE_OMIT_PROGRESS_CALLBACK
>> #define SQLITE_OMIT_FOREIGN_KEY
>> #define SQLITE_OMIT_AUTOVACUUM
>> #define SQLITE_OMIT_EXPLAIN
>> #define SQLITE_SECURE_DELETE
>> #define SQLITE_OMIT_BUILTIN_TEST
>> #define SQLITE_OMIT_TRACE
>> #define SQLITE_ENABLE_FTS3
>> #define SQLITE_ENABLE_FTS3_PARENTHESIS
>> 
>> The only directives of my config.h that seem be accepted, are:
>> 
>> #define SQLITE_MAX_VARIABLE_NUMBER 25
>> #define SQLITE_THREADSAFE 1
>> 
>> Note that the proyect also compiles smoothly without errors using all the
>> compiler directives with SQLite v.3.7.15.1 and MS V. Studio 2013.
>> 
>> Any suggestion would be appreciated.
>> 




[sqlite] Erros using some compiler options for SQLite 3. and V. Studio 2015

2015-10-25 Thread a...@zator.com
Hi list:

Using SQLite v.3.9.1 amalgamation code.
MS Visual Studio 2015 for desktop C++ compiler

I've got the same compiler error

1>sqlite3\sqlite3.c(x): fatal error C1017: expresi?n constante de tipo 
entero no v?lida

 in the following lines of sqlite3.c:

#if SQLITE_ENABLE_FTS3
#if SQLITE_ENABLE_FTS3_PARENTHESIS
#if SQLITE_OMIT_AUTOVACUUM
#if SQLITE_OMIT_BUILTIN_TEST
#if SQLITE_OMIT_EXPLAIN
#if SQLITE_OMIT_FOREIGN_KEY
#if SQLITE_OMIT_PROGRESS_CALLBACK
#if SQLITE_OMIT_TCL_VARIABLE
#if SQLITE_OMIT_TRACE
#if SQLITE_SECURE_DELETE

The application compiles correctly except when includes the config.h file with 
these compiler options:

#define SQLITE_OMIT_TCL_VARIABLE
#define SQLITE_OMIT_PROGRESS_CALLBACK
#define SQLITE_OMIT_FOREIGN_KEY
#define SQLITE_OMIT_AUTOVACUUM
#define SQLITE_OMIT_EXPLAIN
#define SQLITE_SECURE_DELETE
#define SQLITE_OMIT_BUILTIN_TEST
#define SQLITE_OMIT_TRACE
#define SQLITE_ENABLE_FTS3
#define SQLITE_ENABLE_FTS3_PARENTHESIS

The only directives of my config.h that seem be accepted, are:

#define SQLITE_MAX_VARIABLE_NUMBER 25
#define SQLITE_THREADSAFE 1

Note that the proyect also compiles smoothly without errors using all the 
compiler directives with SQLite v.3.7.15.1 and MS V. Studio 2013.

Any suggestion would be appreciated.

--
Adolfo J. Millan



[sqlite] Mozilla wiki 'avoid SQLite'

2015-06-18 Thread a...@zator.com
>  Mensaje original 
> De: 
> Para:  "'General Discussion of SQLite Database'" mailinglists.sqlite.org>
> Fecha:  Thu, 18 Jun 2015 14:50:40 +1000
> Asunto:  Re: [sqlite] Mozilla wiki 'avoid SQLite'
>

Darren:

Maybe you're right. But to that relationship of "goodness" that would be 
desirable, perhaps we should add a few drops of pragmatism. Experience shows 
that in many cases, the perfect is the enemy of the good, and despite a 
disrupting transition (refusing the bad legacy of SQL) can avoid some 
drawbacks, however a non-disrupting evolution, has the advantage of being more 
easily accepted and assimilated by the users, as has happened before.

--
A.J. Millan




[sqlite] Mozilla wiki 'avoid SQLite'

2015-06-18 Thread a...@zator.com
Indeed, I'm agree with Darren, and continuing its thought, perhaps that 
hypothetical new language would be a clean extensi?n of SQL in the same way 
that C++ was respect to C, simplifying the transition and reutilization of 
legacy code.

Cheers.

--
A.J. Millan

>
>  Mensaje original 
> De: 
> Para:  "'General Discussion of SQLite Database'" mailinglistssqlite.org>
> Fecha:  Thu, 18 Jun 2015 14:50:40 +1000
> Asunto:  Re: [sqlite] Mozilla wiki 'avoid SQLite'
>
>The question for now is: does a new database programming language have a
>place?
>




[sqlite] Mozilla wiki 'avoid SQLite'

2015-06-15 Thread a...@zator.com
>  Mensaje original 
> De: Scott Hess 
> Para:  General Discussion of SQLite Database mailinglists.sqlite.org>
> Fecha:  Sun, 14 Jun 2015 10:10:24 -0700
> Asunto:  Re: [sqlite] Mozilla wiki 'avoid SQLite'
>

While certainly, the thread has derived from the concept of the OP, and even 
some think that this kind of discussion is out of place, I must confess that I 
enjoy greatly with this type of thread, that seem to me like images of certain 
books that seem too dry without them. Usually I learn a lot from them, because 
readed dispassionately, the contributions of the various comments -which by the 
way tend to be fairly level- often clarify and put in context, aspects that are 
important. From the allegation of the Mozilla Wiki, to the response of Dr. 
Hipp, passing through the funny misidentification of Alex Bowden (who does not 
make mistakes?).

That said, I would like to complete the opinion of Aleksey Tulinov:

>In my opinion best database language would reflect the way in which 
>database works and best computer programming language would reflect the 
>way in which computer works, as close as reasonably possible.

I think the best database language should reflect how earthlings think about 
the data, and the best computer programming language would reflect easily the 
result we want get from them.

Cheers.

--
A. J. Millan