Re: [sqlite] About SQLite Versions (Newbie)

2011-07-23 Thread Panos Katergiathis

Thank you both for your help.

Panos



On Jul 23, 2011, at 11:38 PM, Simon Slavin wrote:

> 
> On 23 Jul 2011, at 6:47pm, Panos Katergiathis wrote:
> 
>> Oh, this is nice (not having to worry).
>> 
>> I assume that by "The database file format is fixed", you mean "fixed until 
>> SQLite4 is around", at which point the updating of files will also be 
>> required.
>> 
>> Is this correct (or should i be getting some sleep)?
> 
> You're right.  And there are now so many big names using SQLite that there 
> will be no chance of having to figure out an upgrade solution yourself.
> 
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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


Re: [sqlite] About SQLite Versions (Newbie)

2011-07-23 Thread Simon Slavin

On 23 Jul 2011, at 6:47pm, Panos Katergiathis wrote:

> Oh, this is nice (not having to worry).
> 
> I assume that by "The database file format is fixed", you mean "fixed until 
> SQLite4 is around", at which point the updating of files will also be 
> required.
> 
> Is this correct (or should i be getting some sleep)?

You're right.  And there are now so many big names using SQLite that there will 
be no chance of having to figure out an upgrade solution yourself.

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


Re: [sqlite] [FTS3] Header to include for a custom tokenizer

2011-07-23 Thread Abhinav Upadhyay
On Sun, Jul 24, 2011 at 1:40 AM, Abhinav Upadhyay
 wrote:
> On Sat, Jul 23, 2011 at 11:00 PM, Richard Hipp  wrote:
>> On Sat, Jul 23, 2011 at 1:01 PM, Abhinav Upadhyay <
>> er.abhinav.upadh...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>>  I am using the Sqlite3 amalgamation. I am trying to register a custom
>>> tokenizer with sqlite for my FTS application. The custom tokenizer is
>>> in it's separate source file. I have included sqlite3.h header with
>>> the tokenizer source but sqlite3.h does not contain the declaration of
>>> the various structs like sqlite3_tokenizer_module etc. So what is the
>>> usual way to resolve this ? These declarations are also not there in
>>> sqlite3ext.h . Although I see them there in sqlite3.c but I am not
>>> sure I want to include it ? What is the usual way to resolve this ?
>>> May be import fts3_tokenizer.h from the sqlite3 source ?
>>>
>>
>> Yes.  Use fts3_tokenizer.h.
>
> Thanks, That worked. Now, I am able to compile everything.
>
> Next, I am having problem with using this tokenizer. I followed the
> exampple from the FTS3 documentation page on the website and
> registered the tokenizer using code like this:
>
> const sqlite3_tokenizer_module *stopword_tokenizer_module;
>
> sqlstr = "select fts3_tokenizer(:tokenizer_name, :tokenizer_ptr)";
>        rc = sqlite3_prepare_v2(db, sqlstr, -1, &stmt, NULL);
>        if (rc != SQLITE_OK) {
>                sqlite3_close(db);
>                sqlite3_shutdown();
>                return -1;
>        }
>
>        idx = sqlite3_bind_parameter_index(stmt, ":tokenizer_name");
>        rc = sqlite3_bind_text(stmt, idx, "my_tokenizer", -1, NULL);
>        if (rc != SQLITE_OK) {
>                fprintf(stderr, "%s\n", sqlite3_errmsg(db));
>                sqlite3_finalize(stmt);
>                return -1;
>        }
>
>        sqlite3Fts3MyTokenizerModule((const sqlite3_tokenizer_module
> **)&my_tokenizer_module);
>        idx = sqlite3_bind_parameter_index(stmt, ":tokenizer_ptr");
>        rc = sqlite3_bind_blob(stmt, idx, &my_tokenizer_module,
> sizeof(my_tokenizer_module), SQLITE_STATIC);
>        if (rc != SQLITE_OK) {
>                fprintf(stderr, "%s\n", sqlite3_errmsg(db));
>                sqlite3_finalize(stmt);
>                return -1;
>        }
>        rc = sqlite3_step(stmt);
>        if (rc != SQLITE_ROW) {
>                fprintf(stderr, "%s\n", sqlite3_errmsg(db));
>                sqlite3_finalize(stmt);
>                return -1;
>        }
>        sqlite3_finalize(stmt);
>
> It is working fine till above. After executing the above statements, I
> try to create an FTS table using this custom tokenizer, which also
> seem to be getting created. The problem is coming up when I try to
> insert data in the table. A simple statement like "insert into
> my_table values(...)" is giving out errors:
>
> unknown tokenizer: my_tokenizer
>
> I am sure I am missing something here, but don't know what ?
>
> Thanks
>

Nevermind. Seems like I need to register the tokenizer everytime I try
to query the database or store the values.

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


Re: [sqlite] [FTS3] Header to include for a custom tokenizer

2011-07-23 Thread Abhinav Upadhyay
On Sat, Jul 23, 2011 at 11:00 PM, Richard Hipp  wrote:
> On Sat, Jul 23, 2011 at 1:01 PM, Abhinav Upadhyay <
> er.abhinav.upadh...@gmail.com> wrote:
>
>> Hi,
>>
>>  I am using the Sqlite3 amalgamation. I am trying to register a custom
>> tokenizer with sqlite for my FTS application. The custom tokenizer is
>> in it's separate source file. I have included sqlite3.h header with
>> the tokenizer source but sqlite3.h does not contain the declaration of
>> the various structs like sqlite3_tokenizer_module etc. So what is the
>> usual way to resolve this ? These declarations are also not there in
>> sqlite3ext.h . Although I see them there in sqlite3.c but I am not
>> sure I want to include it ? What is the usual way to resolve this ?
>> May be import fts3_tokenizer.h from the sqlite3 source ?
>>
>
> Yes.  Use fts3_tokenizer.h.

Thanks, That worked. Now, I am able to compile everything.

Next, I am having problem with using this tokenizer. I followed the
exampple from the FTS3 documentation page on the website and
registered the tokenizer using code like this:

const sqlite3_tokenizer_module *stopword_tokenizer_module;

sqlstr = "select fts3_tokenizer(:tokenizer_name, :tokenizer_ptr)";
rc = sqlite3_prepare_v2(db, sqlstr, -1, &stmt, NULL);
if (rc != SQLITE_OK) {
sqlite3_close(db);
sqlite3_shutdown();
return -1;
}

idx = sqlite3_bind_parameter_index(stmt, ":tokenizer_name");
rc = sqlite3_bind_text(stmt, idx, "my_tokenizer", -1, NULL);
if (rc != SQLITE_OK) {
fprintf(stderr, "%s\n", sqlite3_errmsg(db));
sqlite3_finalize(stmt);
return -1;
}

sqlite3Fts3MyTokenizerModule((const sqlite3_tokenizer_module
**)&my_tokenizer_module);
idx = sqlite3_bind_parameter_index(stmt, ":tokenizer_ptr");
rc = sqlite3_bind_blob(stmt, idx, &my_tokenizer_module,
sizeof(my_tokenizer_module), SQLITE_STATIC);
if (rc != SQLITE_OK) {
fprintf(stderr, "%s\n", sqlite3_errmsg(db));
sqlite3_finalize(stmt);
return -1;
}
rc = sqlite3_step(stmt);
if (rc != SQLITE_ROW) {
fprintf(stderr, "%s\n", sqlite3_errmsg(db));
sqlite3_finalize(stmt);
return -1;
}
sqlite3_finalize(stmt);

It is working fine till above. After executing the above statements, I
try to create an FTS table using this custom tokenizer, which also
seem to be getting created. The problem is coming up when I try to
insert data in the table. A simple statement like "insert into
my_table values(...)" is giving out errors:

unknown tokenizer: my_tokenizer

I am sure I am missing something here, but don't know what ?

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


Re: [sqlite] About SQLite Versions (Newbie)

2011-07-23 Thread Panos Katergiathis

Oh, this is nice (not having to worry).

I assume that by "The database file format is fixed", you mean "fixed until 
SQLite4 is around", at which point the updating of files will also be required.

Is this correct (or should i be getting some sleep)?

Regards



On Jul 23, 2011, at 8:29 PM, Richard Hipp wrote:

> On Sat, Jul 23, 2011 at 12:53 PM, Panos Katergiathis
> wrote:
> 
>> Hello all
>> 
>> I fail to understand what "Upgrading from version x.x.x.x to x.x.x.x"
>> means.
>> 
>> If i have understood properly so far, SQLite databases are single files,
>> that are structured according to some specification, which - of course -
>> will evolve in the future. So, those files will need to be updated in order
>> to conform to the new specification when available.
>> 
> 
> No.
> 
> The database file format is fixed.  You do not need to update your database
> files.
> 
> "Upgrading from version x to y" means that you should use version
> y of the SQLite software in the applications you write, usually because
> it is faster or it fixes some obscure bug.   If you are not the person who
> compiles SQLite into applications, then you shouldn't need to worry about
> this.
> 
> 
> 
>> 
>> However, the current PHP version (on the current Debian stable release)
>> supports SQLite version 3.7.3, so what would updating mean? Should one use
>> more recent php versions, that would certainly be able to read/write new
>> SQLite files, and would that process automatically update the internal
>> structure of files that were created with the older PHP version?
>> 
>> Or, would one use some other tool (what would that be?) to update any
>> SQLite files, and then would these files still be writable/readable from the
>> older PHP version?
>> 
>> If files (and file versions) are not backward compatible, how would one
>> proceed in selecting a language (and a language version) so as to not get in
>> trouble? For example, how can one know what SQLite version the current
>> JavaSE release supports?
>> 
>> I would be thankful if you could shed some light and help me overcome this
>> confusion, or point me to the right direction.
>> 
>> Regards
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> 
> 
> 
> 
> -- 
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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


Re: [sqlite] [FTS3] Header to include for a custom tokenizer

2011-07-23 Thread Richard Hipp
On Sat, Jul 23, 2011 at 1:01 PM, Abhinav Upadhyay <
er.abhinav.upadh...@gmail.com> wrote:

> Hi,
>
>  I am using the Sqlite3 amalgamation. I am trying to register a custom
> tokenizer with sqlite for my FTS application. The custom tokenizer is
> in it's separate source file. I have included sqlite3.h header with
> the tokenizer source but sqlite3.h does not contain the declaration of
> the various structs like sqlite3_tokenizer_module etc. So what is the
> usual way to resolve this ? These declarations are also not there in
> sqlite3ext.h . Although I see them there in sqlite3.c but I am not
> sure I want to include it ? What is the usual way to resolve this ?
> May be import fts3_tokenizer.h from the sqlite3 source ?
>

Yes.  Use fts3_tokenizer.h.


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



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


Re: [sqlite] About SQLite Versions (Newbie)

2011-07-23 Thread Richard Hipp
On Sat, Jul 23, 2011 at 12:53 PM, Panos Katergiathis
wrote:

> Hello all
>
> I fail to understand what "Upgrading from version x.x.x.x to x.x.x.x"
> means.
>
> If i have understood properly so far, SQLite databases are single files,
> that are structured according to some specification, which - of course -
> will evolve in the future. So, those files will need to be updated in order
> to conform to the new specification when available.
>

No.

The database file format is fixed.  You do not need to update your database
files.

"Upgrading from version x to y" means that you should use version
y of the SQLite software in the applications you write, usually because
it is faster or it fixes some obscure bug.   If you are not the person who
compiles SQLite into applications, then you shouldn't need to worry about
this.



>
> However, the current PHP version (on the current Debian stable release)
> supports SQLite version 3.7.3, so what would updating mean? Should one use
> more recent php versions, that would certainly be able to read/write new
> SQLite files, and would that process automatically update the internal
> structure of files that were created with the older PHP version?
>
> Or, would one use some other tool (what would that be?) to update any
> SQLite files, and then would these files still be writable/readable from the
> older PHP version?
>
> If files (and file versions) are not backward compatible, how would one
> proceed in selecting a language (and a language version) so as to not get in
> trouble? For example, how can one know what SQLite version the current
> JavaSE release supports?
>
> I would be thankful if you could shed some light and help me overcome this
> confusion, or point me to the right direction.
>
> Regards
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


[sqlite] [FTS3] Header to include for a custom tokenizer

2011-07-23 Thread Abhinav Upadhyay
Hi,

 I am using the Sqlite3 amalgamation. I am trying to register a custom
tokenizer with sqlite for my FTS application. The custom tokenizer is
in it's separate source file. I have included sqlite3.h header with
the tokenizer source but sqlite3.h does not contain the declaration of
the various structs like sqlite3_tokenizer_module etc. So what is the
usual way to resolve this ? These declarations are also not there in
sqlite3ext.h . Although I see them there in sqlite3.c but I am not
sure I want to include it ? What is the usual way to resolve this ?
May be import fts3_tokenizer.h from the sqlite3 source ?

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


[sqlite] About SQLite Versions (Newbie)

2011-07-23 Thread Panos Katergiathis
Hello all

I fail to understand what "Upgrading from version x.x.x.x to x.x.x.x" means.

If i have understood properly so far, SQLite databases are single files, that 
are structured according to some specification, which - of course - will evolve 
in the future. So, those files will need to be updated in order to conform to 
the new specification when available.

However, the current PHP version (on the current Debian stable release) 
supports SQLite version 3.7.3, so what would updating mean? Should one use more 
recent php versions, that would certainly be able to read/write new SQLite 
files, and would that process automatically update the internal structure of 
files that were created with the older PHP version?

Or, would one use some other tool (what would that be?) to update any SQLite 
files, and then would these files still be writable/readable from the older PHP 
version?

If files (and file versions) are not backward compatible, how would one proceed 
in selecting a language (and a language version) so as to not get in trouble? 
For example, how can one know what SQLite version the current JavaSE release 
supports?

I would be thankful if you could shed some light and help me overcome this 
confusion, or point me to the right direction.

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


Re: [sqlite] How best to determine changes in a db

2011-07-23 Thread Roger Andersson
  On 07/23/11 01:09 PM, Kent Tenney wrote:
> Right, but I really want a generic solution, since so many apps
> store data in sqlite. if I can monitor Shotwell changes, I can
> do the same for Banshee, Firefox, Zotero ...
>
Something like http://www.softwareaddins.com/CompareDataWiz.htm but for 
sqlite?

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


Re: [sqlite] SQLite3.dll for Win 64

2011-07-23 Thread Tom Browder
On Fri, Jul 22, 2011 at 06:23, Everton Vieira
 wrote:
> Please Help. I need an SQLite3.dll for Win 64?

This link has Windows 64-bit binary installation packages--may find it
in one of them:

  http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki

HTH

Best regards,

-Tom

Thomas M. Browder, Jr.
Niceville, Florida
USA
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] How best to determine changes in a db

2011-07-23 Thread Kent Tenney
On Fri, Jul 22, 2011 at 9:22 PM, Roger Binns  wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 07/22/2011 02:06 PM, Kent Tenney wrote:
>> I make copies periodically, so I have 2 files
>> shotwell_2011-07-21.db and shotwell_2011-07-22.db
>
> Shotwell is open source so you could also modify it to meet your needs.  You
> won't be the first Shotwell user who wants it to sync across multiple
> machines (I'm one too!).

Right, but I really want a generic solution, since so many apps
store data in sqlite. if I can monitor Shotwell changes, I can
do the same for Banshee, Firefox, Zotero ...

>
> Roger
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.11 (GNU/Linux)
>
> iEYEARECAAYFAk4qMGQACgkQmOOfHg372QQcDgCgncwlGd7uTMI1CjrzOqWf/oaP
> vlEAn0EBj1EuDj5je/4JdN+scWNLOUQ3
> =p5/A
> -END PGP SIGNATURE-
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLite3.dll for Win 64

2011-07-23 Thread Everton Vieira
Please Help. I need an SQLite3.dll for Win 64?
 
I've try to download the source and make this dll but I have not success.
 
Anyone knows where to download this dll, or anyone knows how to make this dll 
with the source?
 
Many Thanks
Everton
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Multiplex VACUUM fails to delete chunks on Windows

2011-07-23 Thread Ralf Junker
VACUUM with multiplex does not delete chunks on Windows (fossil [8ce2b74a82]).

It seems this is because the file handle(s) are still held open by the 
multiplex layer when xDelete is triggered. Since Windows can not delete open 
files, they are kept.

I have not investigated this in depth, but closing the file handle before 
deleting the file works well for my simple test case. Here is the change in 
multiplexSubClose():

static void multiplexSubClose(
  multiplexGroup *pGroup,
  int iChunk,
  sqlite3_vfs *pOrigVfs
){
  sqlite3_file *pSubOpen = pGroup->aReal[iChunk].p;
  if( pSubOpen ){
pSubOpen->pMethods->xClose(pSubOpen); /* <-- Moved here */
if( pOrigVfs ) pOrigVfs->xDelete(pOrigVfs, pGroup->aReal[iChunk].z, 0);
/* pSubOpen->pMethods->xClose(pSubOpen); <-- Moved above */
sqlite3_free(pGroup->aReal[iChunk].p);
  }
  sqlite3_free(pGroup->aReal[iChunk].z);
  memset(&pGroup->aReal[iChunk], 0, sizeof(pGroup->aReal[iChunk]));
}

By the way: No error is returned if multiplex VACUUM fails to delete a chunk. 
Maybe it should, to warn curious end users who like to investigate files with 
uncommon names?

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