[sqlite] Re: Trying to use SQLite3 with PHP5....

2008-01-04 Thread Aristotle Pagaltzis
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2008-01-04 19:50]:
> The Tool Control Language (TCL) is one of the most elegant and
> power programming languages ever devised. TCL is not part of
> the Algol family of languages (it is more closely related to
> Lisp) which makes it difficult to grok for people who have only
> been exposed to Algol-like langauges. But this does not detract
> from the extreme elegance of the language.  

No, it doesn’t, but it also doesn’t change the fact that it’s
kind of wretched. :-)

It’s kind of a grown-up and much cleaner version of shell, which
is likewise much-misunderstood. But personally I’d still not wish
to write overly large codebases in it… though maybe it has become
more suitable to this since the last time I looked, a long while
ago at this point. I did enjoy the grammatic regularity then…
shades of Forth (for which I retain a soft spot).

> Let me state unambiguiously that SQLite would not be possible
> were it not for TCL.

I think that’s a bit of an overstatement. It seems that something
like Lua (which admittedly has only lately really gotten into its
own) would have been no less servicable. In principle any of the
current crop of dynamic languages should suffice, though the
major ones do not make it nearly as easy as Tcl to write bindings
to C libraries. (I hear that Ruby is not half bad in this regard,
though.)

Regards,
-- 
Aristotle Pagaltzis // 

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] no mention of SQLite :(

2008-01-04 Thread drh
"Shane Harrelson" <[EMAIL PROTECTED]> wrote:
> Embedded Database Vendors Face Challenges:
> http://www.eweek.com/article2/0,1895,2243406,00.asp
> 
> How could an article like this not mention SQLite?

I don't know, but my guess is that the article was
ghost-written by Steve Graves and he doesn't want to
draw unnecessary attention to the free database engine
that is eating his lunch.

There is a comment section.  Why don't you post a comment
asking why there is no mention of the embedded SQL
database that powers Mozilla Firefox, Symbian Smartphones,
Google Android and Gears, Adobe AIR and Lightroom, 
Apple Mail and Safari, and Skype, to name but a few.

--
D. Richard Hipp <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] no mention of SQLite :(

2008-01-04 Thread Shane Harrelson
Embedded Database Vendors Face Challenges:
http://www.eweek.com/article2/0,1895,2243406,00.asp

How could an article like this not mention SQLite?


Re: [sqlite] memory leak on sqlite3_open

2008-01-04 Thread drh
arbalest06 <[EMAIL PROTECTED]> wrote:
> 
> Is this a valid memory leak?
> 

No, it is not a real leak.  But we used to get complaints about
it about ever week so I reworked the code to make Valgrind stop
complaining.  That happened about 6 months ago.  If you run with
the latest version of SQLite Valgrind will no longer complain.

--
D. Richard Hipp <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] memory leak on sqlite3_open

2008-01-04 Thread arbalest06

Good day!

I have a C function that would open a database. But when i ran it in
valgrind, it gave me the following leak:

==7230== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 16 from 1)
==7230== malloc/free: in use at exit: 272 bytes in 2 blocks.
==7230== malloc/free: 289 allocs, 287 frees, 42,704 bytes allocated.
==7230== For counts of detected errors, rerun with: -v
==7230== searching for pointers to 2 not-freed blocks.
==7230== checked 21,050,692 bytes.
==7230==
==7230== 272 bytes in 2 blocks are possibly lost in loss record 1 of 1
==7230==at 0x40056BF: calloc (vg_replace_malloc.c:279)
==7230==by 0x35771A: _dl_allocate_tls (in /lib/ld-2.3.4.so)
==7230==by 0x5B591E: pthread_create@@GLIBC_2.1 (in
/lib/tls/libpthread-2.3.4.so)
==7230==by 0x4030E52: findLockInfo (os_unix.c:504)
==7230==by 0x4031ABD: unixOpen (os_unix.c:2268)
==7230==by 0x403080C: sqlite3OsOpen (os.c:134)
==7230==by 0x40330A7: sqlite3PagerOpen (pager.c:2160)
==7230==by 0x401707E: sqlite3BtreeOpen (btree.c:1226)
==7230==by 0x402F03C: sqlite3BtreeFactory (main.c:767)
==7230==by 0x402F68D: openDatabase (main.c:1016)
==7230==by 0x8049482: OpenDB (in
/home/sample/testing/sqlite3/v0.08/driver)
==7230==by 0x80489F5: main (DbDriver.c:60)
==7230==
==7230== LEAK SUMMARY:
==7230==definitely lost: 0 bytes in 0 blocks.
==7230==  possibly lost: 272 bytes in 2 blocks.
==7230==still reachable: 0 bytes in 0 blocks.
==7230== suppressed: 0 bytes in 0 blocks.
==7230== Reachable blocks (those to which a pointer was found) are not
shown.
==7230== To see them, rerun with: --show-reachable=yes

In DbDriver.c, my line number 60 is:

[60] if( ( res_i = OpenDB( "this.db" ) ) == SQLITE_OK )
[61] {
  ...
   }

and my OpenDB looks like this:

int OpenDB( char *dbName_cp )
{
int retVal_i = CDBM_FAIL; /*< error code */

/* checks if the database name is not equal to NULL */
if( dbName_cp != NULL )
{
/* opens the database */
retVal_i = sqlite3_open( dbName_cp, &GDBM_Db_p );
}

return( retVal_i );
}

Is this a valid memory leak?..where did i go wrong in my codes?..

Thank you and God bless!
-- 
View this message in context: 
http://www.nabble.com/memory-leak-on-sqlite3_open-tp14629415p14629415.html
Sent from the SQLite mailing list archive at Nabble.com.


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] a newbie

2008-01-04 Thread Scott Berry


-Original Message-
From: gerardo cabero [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 04, 2008 9:45 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] a newbie
Sì yo hablo espanol. No Hablo espanol en muchos anos.

Scott


aLGUNO QUE HABLE ESPAÑOL???
SALUDOS GERARD

On 1/3/08, Scott Berry <[EMAIL PROTECTED]> wrote:
>
> Hey guys,
>
> My name is Scott Berry and I am totally blind and a newbie to Sqlite.  I
> have two questions concerning Sqlite.  The questions I have is I have an
> Excel file which will be going in to the database for an aircraft program
> for the blind I am making.  I want to turn this (Excel spreadsheet) in to
> a
> .CVS file comma delimited or tab delimited.  I don't care which.  I am
> using
> Sqlite Admin from Sqlite.org to do my databases since I am not too
> comfortable with the syntax yet.  However, two questions come to mind:
>
> 1.  Which of the delimited files .cvs with commas or tabbed would be best
> to
> use.
> 2.  I need to put my info in by state and airport is it wiser to make a
> table for each state?  I will be using this with in a Basic 4 PPC program.
>
> Any help would be very much appreciated.
>
> Scott
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.17.13/1207 - Release Date: 1/2/2008
> 11:29 AM
>
>
>
>
>

-
> To unsubscribe, send email to [EMAIL PROTECTED]
>
>

-
>
>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Trying to use SQLite3 with PHP5....

2008-01-04 Thread Kees Nuyt
On Fri, 04 Jan 2008 18:16:29 +, [EMAIL PROTECTED] wrote:

>Kees Nuyt <[EMAIL PROTECTED]> wrote:
>> 
>> There are two flavours of PDO_sqlite:
>> 
>> * php_pdo_sqlite
>> Has SQLite linked in. Depending on your Linux distribution
>> and/or your PHP version that might be an obsolete version of
>> SQLite.
>
>To clarify: SQLite does not change in incompatible ways.  So
>there probably is not an issue with using whatever version
>of SQLite is included in PHP.  Kees probably meant to say
>"older version" rather than "obsolete version".

You are right. Yes, I did.
-- 
  (  Kees Nuyt
  )
c[_]

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Trying to use SQLite3 with PHP5....

2008-01-04 Thread John Stanton
I take your point about TCL and endorse it.  Please excuse my irritation 
at finding that the makefile needed a little tweaking to install an 
upgrade.  TCL is elegant, not wretched, but tclsh appearing in a generic 
makefile was a minor nuisance for a person who gets to be more of a 
curmudgeon each year.  :-)


[EMAIL PROTECTED] wrote:

John Stanton <[EMAIL PROTECTED]> wrote:
You need to make a small change in the make file to get rid of the 
wretched tclsh and link sqlite3 from the library.  Just use an earlier 
makefile as a template.




The problem with the TCL dependency was reported by
tickets #2845 and #2846 and has been fixed in check-in [4636].

John, I will thank you to not refer to tclsh as "wretched".  The
Tool Control Language (TCL) is one of the most elegant and
power programming languages ever devised.  TCL is not part
of the Algol family of languages (it is more closely related
to Lisp) which makes it difficult to grok for people who have 
only been exposed to Algol-like langauges.  But this does not
detract from the extreme elegance of the language.  


Let me state unambiguiously that SQLite would not be possible
were it not for TCL.  70% of SQLite (all of the test scripts,
which are arguable the most important part of the code base)
is written in TCL.

--
D. Richard Hipp <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite]For best Fragementation

2008-01-04 Thread Cory Nelson
On Jan 4, 2008 4:04 AM, Sreedhar.a <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am working in 3.3.6 C code.
>
> I created a database and i started inserting 100 records .
> After inserting i checked the database File.Say 98% of the database is
> filled and the remaining 2% is left out without use.
> Then i inserted next 100 records and i found again 2% is left out.So totally
> 4% is left free.
> I think by using "PRAGMA auto_vacuum = 1;" i can do fragmentation.
>
> I need the database to shrink when ever it finds freespace in the database
> file.
> Can any one please help.
>
>
> Best Regards,
> A.Sreedhar.
>
>

The way b-trees (the internal file structure sqlite uses) work, it is
very hard to use up 100% of the space.  Vacuuming will only free empty
pages and won't solve this.

-- 
Cory Nelson
http://www.int64.org

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Intro and question

2008-01-04 Thread Mike McGonagle
Hello all,
My name is Mike "Mogo" McGonagle. I found SQLite about 3 months ago, and
have beeen hooked ever since.

As I am interested in using SQL in a multimedia environment, I have been
working on connecting SQLite up with the data-flow/graphical programming
language Pure Data. ( https://puredata.info ) Currently, everything is
working fine, and I am able to execute pretty much any SQL statement that I
have used so far. And while it is functional, it is still very much a
work-in-progress, and will be subject to change based on a better idea that
comes along. I use the Amalgamated source for SQLite3, and embed the engine
right into the object file.

My question pretty much involves what might be the best means of interfacing
SQLite with such a language. Pure Data is very similar to Max/MSP and jMax.
I would be interested in hearing from anyone on their ideas for this sort of
thing.

If you are interested in testing what I have done, you can download the
stuff from ( http://puredata.info/Members/mjmogo/ ) and get the
Version 0.01archive.


Mike


Re: [sqlite] Trying to use SQLite3 with PHP5....

2008-01-04 Thread Rob Sciuk

On Fri, 4 Jan 2008, [EMAIL PROTECTED] wrote:


John Stanton <[EMAIL PROTECTED]> wrote:

You need to make a small change in the make file to get rid of the
wretched tclsh and link sqlite3 from the library.  Just use an earlier
makefile as a template.



The problem with the TCL dependency was reported by
tickets #2845 and #2846 and has been fixed in check-in [4636].

John, I will thank you to not refer to tclsh as "wretched".  The
Tool Control Language (TCL) is one of the most elegant and
power programming languages ever devised.  TCL is not part
of the Algol family of languages (it is more closely related
to Lisp) which makes it difficult to grok for people who have
only been exposed to Algol-like langauges.  But this does not
detract from the extreme elegance of the language.


I would agree with D.R.H. on the innate beauty of Tcl, and coupled with 
the very nice (and getting better) GUI development tool Tk (specifically 
the new Ttk (Tile) themed widget set).  Tcl/Tk may not have the momentum
that Ruby/Python/Perl have, but it certainly does *NOT* lack form or 
function, and given the ease with which it can be embedded, seems a 
particularly good match for the SQLite project.  Frankly, using tclsh is 
IMHO an inspired choice.



-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
Robert S. Sciuk http://www.controlq.com 259 Simcoe St. S.
Control-Q Research  tel: 905.576.8028   Oshawa, Ont.
[EMAIL PROTECTED]   fax: 905.576.8386   Canada, L1H 4H3

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Trying to use SQLite3 with PHP5....

2008-01-04 Thread drh
John Stanton <[EMAIL PROTECTED]> wrote:
> You need to make a small change in the make file to get rid of the 
> wretched tclsh and link sqlite3 from the library.  Just use an earlier 
> makefile as a template.
> 

The problem with the TCL dependency was reported by
tickets #2845 and #2846 and has been fixed in check-in [4636].

John, I will thank you to not refer to tclsh as "wretched".  The
Tool Control Language (TCL) is one of the most elegant and
power programming languages ever devised.  TCL is not part
of the Algol family of languages (it is more closely related
to Lisp) which makes it difficult to grok for people who have 
only been exposed to Algol-like langauges.  But this does not
detract from the extreme elegance of the language.  

Let me state unambiguiously that SQLite would not be possible
were it not for TCL.  70% of SQLite (all of the test scripts,
which are arguable the most important part of the code base)
is written in TCL.

--
D. Richard Hipp <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Trying to use SQLite3 with PHP5....

2008-01-04 Thread John Stanton
You need to make a small change in the make file to get rid of the 
wretched tclsh and link sqlite3 from the library.  Just use an earlier 
makefile as a template.


Philip Butler wrote:

Hi all,

I am revisiting this topic again - I have tried a LONG time ago and gave 
up


I am wanting to use SQLite3 with PHP (5.2.5)..  I have 2 issues...

1)
I can't seem to compile sqlite3 on a Linux system.  It wants to use TCL 
which I don't have installed.  I have used:


configure --disable-tcl

and it still wants some tcl utility to (from what I think) build the 
sqlite3.c file.  I have searched the email archives and have seen others 
with the same problem - but haven't found an answer that works for me.  
I have punted trying to compile the source and have installed the 
precompiled sqlite3 files - sqlite-3.5.4.so, sqlite3-3.5.4.bin, 
sqlite3_analyzer-3.5.4.bin.





2)
Now comes the fun part - I can't figure out how to get sqlite3 to play 
right with PHP.  From what I can tell, PDO is needed to do this - but 
from the docs, it seems like I need to be able to compile sqlite3 (i.e. 
issue #1 above).  So it seems that I am stuck.  Does anyone have any 
notes they can share on getting the latest sqlite to work with the 
latest PHP ??  Ideally, the PHP team would incorporate sqlite3 into the 
PHP sources (like they do with sqlite2), but this hasn't been done.


I have been down this path before (a year or two ago) - posted to 
forums/maillists on both SQLite and PHP.  The PHP people say it's a 
sqlite issue and the sqlite people said it was a PHP issue.  Therefore, 
I have been using Postgresql for the past few years.  I don't have a 
problem with Postgres - but want to try something "lean and mean".



Thanks,

Phil Butler




- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 






-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Trying to use SQLite3 with PHP5....

2008-01-04 Thread drh
Kees Nuyt <[EMAIL PROTECTED]> wrote:
> 
> There are two flavours of PDO_sqlite:
> 
> * php_pdo_sqlite
> Has SQLite linked in. Depending on your Linux distribution
> and/or your PHP version that might be an obsolete version of
> SQLite.

To clarify: SQLite does not change in incompatible ways.  So
there probably is not an issue with using whatever version
of SQLite is included in PHP.  Kees probably meant to say
"older version" rather than "obsolete version".

--
D. Richard Hipp <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Possible UNICODE LIKE, upper(), lower() function solution

2008-01-04 Thread Nicolas Williams
I posted about this subject earlier too (in OpenSolaris we added Unicode
tolower() and toupper() functions to SQLite 2.x).  But the fact that
SQLite 3.x already supports ICU disuaded me from pursuing the matter
further.  OpenSolaris has a light-weight Unicode API (licensed under the
CDDL), much like the one you wrote, capable of doing normalization and
case conversions, as well as case- and even normalization-insensitive
string comparison.

It hadn't occurred to me that ICU might be so large as to make use of
alternative libraries interesting.  When we port the relevant app in
OpenSolaris to use SQLite 3.x I'll look again at contributing patches
that add support for the OpenSolaris Unicode APIs.

I hadn't considered something like an "unaccented collation" -- it
sounds tricky.  Which modifiers should be dropped, which should be kept?
That can depend on what language the text is written in, and how much
lossiness or what false positive rates you're willing to accept.  I
recommend that you try normalization-insensitive collation before
resorting to an "unaccented collation."

Nico
-- 

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Trying to use SQLite3 with PHP5....

2008-01-04 Thread Kees Nuyt
On Fri, 4 Jan 2008 11:09:48 -0500, Philip Butler
<[EMAIL PROTECTED]> wrote:

>Hi all,
>
>I am revisiting this topic again - I have tried a 
>LONG time ago and gave up
>
>I am wanting to use SQLite3 with PHP (5.2.5)..  
>I have 2 issues...
>
>1)
>I can't seem to compile sqlite3 on a Linux system.  

drh gave advice on that.

>2)
>Now comes the fun part - I can't figure out how to get sqlite3 to play  
>right with PHP.  From what I can tell, PDO is needed to do this 

There are two flavours of PDO_sqlite:

* php_pdo_sqlite
Has SQLite linked in. Depending on your Linux distribution
and/or your PHP version that might be an obsolete version of
SQLite.

* php_pdo_sqlite_external
Uses any SQLite3 library you offer it, for example the compiled
amalgamation.

>Thanks,
>
>Phil Butler

HTH
-- 
  (  Kees Nuyt
  )
c[_]

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Trying to use SQLite3 with PHP5....

2008-01-04 Thread drh
Philip Butler <[EMAIL PROTECTED]> wrote:
> Hi all,
> 
> I am revisiting this topic again - I have tried a LONG time ago and  
> gave up
> 
> I am wanting to use SQLite3 with PHP (5.2.5)..  I have 2 issues...
> 
> 1)
> I can't seem to compile sqlite3 on a Linux system.  It wants to use  
> TCL which I don't have installed.  I have used:
> 
>   configure --disable-tcl
> 
> and it still wants some tcl utility to (from what I think) build the  
> sqlite3.c file.  I have searched the email archives and have seen  
> others with the same problem - but haven't found an answer that works  
> for me.  I have punted trying to compile the source and have installed  
> the precompiled sqlite3 files - sqlite-3.5.4.so, sqlite3-3.5.4.bin,  
> sqlite3_analyzer-3.5.4.bin.
> 

Download http://www.sqlite.org/sqlite-amalgamation-3_5_4.zip
This file contains a single C source file named sqlite3.c that
is the entire SQLite library.  Just compile that one file into
whatever form you want.

Do not bother with configure or make.  They are way too much
trouble.


> 
> 2)
> Now comes the fun part - I can't figure out how to get sqlite3 to play  
> right with PHP.  From what I can tell, PDO is needed to do this - but  
> from the docs, it seems like I need to be able to compile sqlite3  
> (i.e. issue #1 above).  So it seems that I am stuck.  Does anyone have  
> any notes they can share on getting the latest sqlite to work with the  
> latest PHP ??  Ideally, the PHP team would incorporate sqlite3 into  
> the PHP sources (like they do with sqlite2), but this hasn't been done.
> 
> I have been down this path before (a year or two ago) - posted to  
> forums/maillists on both SQLite and PHP.  The PHP people say it's a  
> sqlite issue and the sqlite people said it was a PHP issue.   
> Therefore, I have been using Postgresql for the past few years.  I  
> don't have a problem with Postgres - but want to try something "lean  
> and mean".
> 

The last time I checked, sqlite3 was built into PHP by default.
There is nothing to install.  It should just be there.

Has this changed?

--
D. Richard Hipp <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Trying to use SQLite3 with PHP5....

2008-01-04 Thread Chris Peachment
Ubuntu version 7.10 has available 

  PHP version 5.2.3-1ubuntu6.2

that includes

  Sqlite3 version 3.5.2

accessible with both PDO and sqlite libraries.

Personally, I prefer to use PDO because a single line
change in the PHP code when declaring the database
name to the PDO new() function permits use with both
Sqlite3 and MySql.

I don't know what versions are available with other
Linux distributions.


On Fri, 2008-01-04 at 11:09 -0500, Philip Butler wrote:
> Hi all,
> 
> I am revisiting this topic again - I have tried a LONG time ago and  
> gave up
> 
> I am wanting to use SQLite3 with PHP (5.2.5)..  I have 2 issues...
> 
> 1)
> I can't seem to compile sqlite3 on a Linux system.  It wants to use  
> TCL which I don't have installed.  I have used:
> 
>   configure --disable-tcl
> 
> and it still wants some tcl utility to (from what I think) build the  
> sqlite3.c file.  I have searched the email archives and have seen  
> others with the same problem - but haven't found an answer that works  
> for me.  I have punted trying to compile the source and have installed  
> the precompiled sqlite3 files - sqlite-3.5.4.so, sqlite3-3.5.4.bin,  
> sqlite3_analyzer-3.5.4.bin.
> 
> 
> 
> 
> 2)
> Now comes the fun part - I can't figure out how to get sqlite3 to play  
> right with PHP.  From what I can tell, PDO is needed to do this - but  
> from the docs, it seems like I need to be able to compile sqlite3  
> (i.e. issue #1 above).  So it seems that I am stuck.  Does anyone have  
> any notes they can share on getting the latest sqlite to work with the  
> latest PHP ??  Ideally, the PHP team would incorporate sqlite3 into  
> the PHP sources (like they do with sqlite2), but this hasn't been done.
> 
> I have been down this path before (a year or two ago) - posted to  
> forums/maillists on both SQLite and PHP.  The PHP people say it's a  
> sqlite issue and the sqlite people said it was a PHP issue.   
> Therefore, I have been using Postgresql for the past few years.  I  
> don't have a problem with Postgres - but want to try something "lean  
> and mean".
> 
> 
> Thanks,
> 
> Phil Butler
> 
> 
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Possible UNICODE LIKE, upper(), lower() function solution

2008-01-04 Thread Scott Hess
On Jan 4, 2008 8:43 AM, Nicolas Williams <[EMAIL PROTECTED]> wrote:
> It hadn't occurred to me that ICU might be so large as to make use of
> alternative libraries interesting.  When we port the relevant app in
> OpenSolaris to use SQLite 3.x I'll look again at contributing patches
> that add support for the OpenSolaris Unicode APIs.

ICU doesn't need to be all that large.  By default, it builds
everything, and encodes the data it needs into an object file, so it
is pretty large.  But you can cut that down to just the items you
actually need.  If all you need is case-folding, then the footprint is
going to be a lot smaller.

Of course, if you're using the ICU libraries provided with your
system, you'll be getting it essentially for free.

-scott

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Trying to use SQLite3 with PHP5....

2008-01-04 Thread Philip Butler

Hi all,

I am revisiting this topic again - I have tried a LONG time ago and  
gave up


I am wanting to use SQLite3 with PHP (5.2.5)..  I have 2 issues...

1)
I can't seem to compile sqlite3 on a Linux system.  It wants to use  
TCL which I don't have installed.  I have used:


configure --disable-tcl

and it still wants some tcl utility to (from what I think) build the  
sqlite3.c file.  I have searched the email archives and have seen  
others with the same problem - but haven't found an answer that works  
for me.  I have punted trying to compile the source and have installed  
the precompiled sqlite3 files - sqlite-3.5.4.so, sqlite3-3.5.4.bin,  
sqlite3_analyzer-3.5.4.bin.





2)
Now comes the fun part - I can't figure out how to get sqlite3 to play  
right with PHP.  From what I can tell, PDO is needed to do this - but  
from the docs, it seems like I need to be able to compile sqlite3  
(i.e. issue #1 above).  So it seems that I am stuck.  Does anyone have  
any notes they can share on getting the latest sqlite to work with the  
latest PHP ??  Ideally, the PHP team would incorporate sqlite3 into  
the PHP sources (like they do with sqlite2), but this hasn't been done.


I have been down this path before (a year or two ago) - posted to  
forums/maillists on both SQLite and PHP.  The PHP people say it's a  
sqlite issue and the sqlite people said it was a PHP issue.   
Therefore, I have been using Postgresql for the past few years.  I  
don't have a problem with Postgres - but want to try something "lean  
and mean".



Thanks,

Phil Butler




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Possible UNICODE LIKE, upper(), lower() function solution

2008-01-04 Thread Jiri Hajek
Nice! I can imagine that this could be also used e.g. in FTS3,
particularly unaccent() function could make searching for
international users better.

Thans for sharing your code,
Jiri

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Commit fails due to "database is locked" in active transaction

2008-01-04 Thread Lior Okman

Richard Klein wrote:


Requiring the second transaction to complete first is expected in
terms of SQLIte's concurrency system.


So in terms of using SQLite, I need to close the entire transaction 
and restart it when I get a "database locked" return code in a writer 
thread? It's not enough to just retry the commit in a little while?


You don't need to close the connection, but you do need to ROLLBACK
the transaction, unless you have some sort of a priori knowledge that
the second transaction will not try to write to the database.  In such
a case, the second transaction will not try to acquire the RESERVED lock
already held by the first transaction, and so the second transaction
will eventually run to completion.  In such a scenario, the first
transaction can sit in a busy wait loop (sleep for a bit, then retry
the COMMIT) until the COMMIT succeeds.

However, if the second transaction will (or might) try to write to the
database, you must ROLLBACK the first transaction, sleep for a bit, and
restart the first transaction.


I've written the attached test program.

In this program, I run 2 threads, each opening an explicit transaction 
(begin immediate), inserting a row into a table, and committing the 
transaction. I run the program 4 times, in loopback mounted directories, 
using JFS, Ext3, TMPFS and ReiserFS3.


I expected that it would be possible for the program to get SQLITE_BUSY 
only for the begin statement, however, based on the underlying 
filesystem,  I get:


Ext3: takes 6 seconds to run on my system, with SQLITE_BUSY happening 
for commit even though each thread has a RESERVED lock on the database.


JFS: takes 4 seconds to run on my system, with SQLITE_BUSY happening for 
commit.


ReiserFS version 3: takes 90 (!!!) seconds  on my system, with 
SQLITE_BUSY happening for commit, and the threads nearly completely 
serialized.


Tmpfs: Takes 2 seconds, again with SQLITE_BUSY happening for the commit 
statements.


My questions are:
1. Why do I get SQLITE_BUSY for commit statements? Each thread has a 
reserved lock - there should be no busy situation for anything other 
than a "begin immediate" operation.

2. Why does running on reiserfs cause such a huge performance penalty?
3. Another weird thing - if I change the program to open a deferred 
transaction, instead of an immediate transaction, the program doesn't 
deadlock, even when I get a SQLITE_BUSY on an insert statement.


Thanks
Lior

- Richard Klein




-
To unsubscribe, send email to [EMAIL PROTECTED]
-




test.c.gz
Description: GNU Zip compressed data
-
To unsubscribe, send email to [EMAIL PROTECTED]
-

Re: [sqlite] a newbie

2008-01-04 Thread gerardo cabero
aLGUNO QUE HABLE ESPAÑOL???
SALUDOS GERARD

On 1/3/08, Scott Berry <[EMAIL PROTECTED]> wrote:
>
> Hey guys,
>
> My name is Scott Berry and I am totally blind and a newbie to Sqlite.  I
> have two questions concerning Sqlite.  The questions I have is I have an
> Excel file which will be going in to the database for an aircraft program
> for the blind I am making.  I want to turn this (Excel spreadsheet) in to
> a
> .CVS file comma delimited or tab delimited.  I don't care which.  I am
> using
> Sqlite Admin from Sqlite.org to do my databases since I am not too
> comfortable with the syntax yet.  However, two questions come to mind:
>
> 1.  Which of the delimited files .cvs with commas or tabbed would be best
> to
> use.
> 2.  I need to put my info in by state and airport is it wiser to make a
> table for each state?  I will be using this with in a Basic 4 PPC program.
>
> Any help would be very much appreciated.
>
> Scott
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.17.13/1207 - Release Date: 1/2/2008
> 11:29 AM
>
>
>
>
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
>
> -
>
>


[sqlite]For best Fragementation

2008-01-04 Thread Sreedhar.a
Hi,
 
I am working in 3.3.6 C code.
 
I created a database and i started inserting 100 records .
After inserting i checked the database File.Say 98% of the database is
filled and the remaining 2% is left out without use.
Then i inserted next 100 records and i found again 2% is left out.So totally
4% is left free.
I think by using "PRAGMA auto_vacuum = 1;" i can do fragmentation.
 
I need the database to shrink when ever it finds freespace in the database
file.
Can any one please help.
 
 
Best Regards,
A.Sreedhar.
 


Re: [sqlite] Size of Meta data ?

2008-01-04 Thread Kees Nuyt

Hi Yuva,

On Fri, 4 Jan 2008 15:32:44 +0530, "Yuvaraj Athur Raghuvir"
<[EMAIL PROTECTED]> wrote:

>Hello,
>
>Is there any way to estimate the size of the metadata of a SQLite database?
>
>I am trying to do the following:
>1) Set the DB size using MAX_PAGE_COUNT and PAGE_SIZE parameters
>2) I want to do a bulk insert.
>3) However, I want to insert only those many records such that the insert
>succeeds.
>4) I also want to keep a 30% buffer for the data. I would like to start new
>DB instances when that threshold is reached.
>
>To do step 3 successfully, I have to estimate the size of the meta-data.
>Assuming that there is no more data model changes, is there a algorithm or
>heuristic to determine the amount of meta data present in the database?
>
>Thanks and Regards,
>Yuva

The metadata is mostly in the fileheader and the sqlite_master
table. If your schema is more or less static, a run with
sqlite3_analyzer will tell you all you need to know.

Runs of sqlite3_analyzer on a few sample databases could tell
you something about the overhead for your specific data and
filling pattern.

A more reliable approach is to COMMIT your INSERTs frequently
and measure the size of the database file.

HTH
-- 
  (  Kees Nuyt
  )
c[_]

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Size of Meta data ?

2008-01-04 Thread Yuvaraj Athur Raghuvir
Hello,

Is there any way to estimate the size of the metadata of a SQLite database?

I am trying to do the following:
1) Set the DB size using MAX_PAGE_COUNT and PAGE_SIZE parameters
2) I want to do a bulk insert.
3) However, I want to insert only those many records such that the insert
succeeds.
4) I also want to keep a 30% buffer for the data. I would like to start new
DB instances when that threshold is reached.

To do step 3 successfully, I have to estimate the size of the meta-data.
Assuming that there is no more data model changes, is there a algorithm or
heuristic to determine the amount of meta data present in the database?

Thanks and Regards,
Yuva