Re: [sqlite] infinite looping from sqlite3_close()

2008-09-16 Thread Dan

On Sep 16, 2008, at 5:19 AM, Sathish R wrote:

 Hi All,
 We are using sqlite3 (version 3.2.1) in our product and we are  
 experiencing
 a problem of infinite loop from sqlite3_close(). The problem is
 intermittently reproduced and I am not sure about the exact sequence.
 I have described the details below. is anybody else faced similar  
 problem
 before? Can someone please help me here?

 we have thread safe enabled.

 We collected a core when our process is stuck in infinte loop and  
 one thread
 is infinitely looping in the below marked loop within sqlite3_close 
 (). So,
 it holds the mutex and some other threads are blocked waiting for that
 mutex.

 #ifndef SQLITE_OMIT_GLOBALRECOVER
   {
 sqlite3 *pPrev = pDbList;
 sqlite3OsEnterMutex();
 while( pPrev  pPrev-pNext!=db ){ - one thread is infinite  
 looping in
 this while()
   pPrev = pPrev-pNext;
 }
 if( pPrev ){
   pPrev-pNext = db-pNext;
 }else{
   assert( pDbList==db );
   pDbList = db-pNext;
 }
 sqlite3OsLeaveMutex();
   }
 #endif

 I printed the pDbList from core and the list doesn't seem to end  
 and the
 link list seems to have become a cyclic one somehow.

 (gdb) p pDbList
 $40 = (sqlite3 *) 0x36d00bb8
 (gdb) p pDbList-pNext
 $41 = (sqlite3 *) 0x107b77a8
 (gdb) p pDbList-pNext-pNext
 $42 = (sqlite3 *) 0x107b77a8 - link list becomes cyclic...no NULL.

 Note: I saw that this entire logic of link list and global recovery  
 doesn't
 exist in recent 3.6.2 code base. Should I consider upgrading to newer
 libsqlite library to avoid this problem?

Yes. 3.2.1 is over 3 years old now. Hundreds of bugs have been fixed
since then. Odds are that the problem you're experiencing has been  
fixed,
or, if not, you stand a much better chance of getting help with it if
using 3.6.2.

Dan.


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


[sqlite] DELETEs using a range from an indexed column

2008-09-16 Thread Tomas Lee
I have this schema:

CREATE TABLE members
  (uid INTEGER PRIMARY KEY AUTOINCREMENT,
   name TEXT,
   score INTEGER);
CREATE INDEX members_score_index ON log (score);

I want to delete the 1000 members with the lowest scores.  Assume that
it is extremely unlikely for two members to have identical scores.
Also, the 1000 is arbitrary -- it could be more or less on different
days.  But each time I do this deletion, it will be a fixed number.

What's the fastest way to do this?  I want to lock the database for as
little time as possible.  Would it be:

Method A:

 * find the 1000th lowest score:

   SELECT score FROM members ORDER BY score LIMIT 1 OFFSET 999;

 * delete the records equal to or lower than that score

   DELETE FROM members WHERE score = $thousandth_lowest_score;

Or would it be:

Method B:

 * find the uids for the 1000 lowest scores:

   SELECT uid FROM members ORDER BY score LIMIT 1000;

 * delete those records

   DELETE FROM members WHERE uid IN ([join $uids ,]);

 or:

   foreach doomed_uid in $uids do:
  DELETE FROM members WHERE uid = $doomed_uid

Or would it be:

Method C:

 * delete the records as you find them:

   sqlite3_prepare_v2(db, DELETE FROM members WHERE uid = ?, -1, stmt_d, 
NULL);
   sqlite3_prepare_v2(db, SELECT uid FROM members ORDER BY score LIMIT 1000, 
-1, stmt_q, NULL);
   while (sqlite3_step(stmt_q) == SQLITE_ROW) {
   int uid = sqlite3_column_int(stmt_q, 0);
   sqlite3_bind_int(stmt_d, 0, uid);
   sqlite3_step(stmt_d);
   sqlite3_reset(stmt_d);
   }
   sqlite3_finalize(stmt_d);
   sqlite3_finalize(stmt_q);

Or perhaps something else entirely?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] fts3 database grows

2008-09-16 Thread Holger Lembke
[EMAIL PROTECTED] wrote:

 Database will grow from about 3.615 KB and continue growing.
 After 100 more FILLs (40.000 delete+insert actions.) it
 reaches a size of 85.683 KB.

Just in case we are confused due to European and American dots: those are
European dots.

So it reads: grows from 3 MB to 85 MB.


-- 
Holger LembkeChallenge the net: 3d Traceroute http://d3tr.com/
+49-531-334676   56 Tage auf See: http://56tage.de/

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


[sqlite] sqlite3_open creation/Opening

2008-09-16 Thread Aravinda babu
Hi all,

Does sqlite have any mechanism to determine if sqlite3_open has
created a new database or opened an existing database?


sqlite3_open returns SQLITE_OK for both creation and open

How can i check whether it created or opened an existing database ?

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


Re: [sqlite] sqlite3_open creation/Opening

2008-09-16 Thread Mihai Limbasan

Aravinda babu wrote:

Hi all,

Does sqlite have any mechanism to determine if sqlite3_open has
created a new database or opened an existing database?


sqlite3_open returns SQLITE_OK for both creation and open

How can i check whether it created or opened an existing database ?

Thanks in advance,
Aravind.
  

Hello!

If you're using sqlite3_open, just check whether the database file 
exists before calling sqlite3_open.


Or you could use sqlite3_open_v2, where you can specify separately 
(using the flags parameter) whether you want a new database to be 
created or not.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Closing database fails due to unfinalized statements

2008-09-16 Thread Lothar Behrens
Hi,

I do have any unfinalized statements in my application when compiled  
on Windows, but not on Mac OS X.

Is there any difference I am missing to attent for ?

How could I see, wich statement (statement handle or SQL query to be  
used in that statement) is unfinalized ?

I do not have any differences in my compiler switches (defines).

Thanks

Lothar

-- | Rapid Prototyping | XSLT Codegeneration | http://www.lollisoft.de
Lothar Behrens
Heinrich-Scheufelen-Platz 2
73252 Lenningen








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


[sqlite] Update command working from command line but not from a C program

2008-09-16 Thread Aravinda babu
Hi all,

 static const char *cmd = CREATE TABLE cert_store_table ( certNumber
INTEGER primary key , certTypeLen INTEGER , certType  TEXT , validFlag TEXT,
certData BLOB , lastRowFlag INTEGER);


static const char *updateCmd = UPDATE cert_store_table set lastRowFlag =
:lastRowFlag where lastRowFlag = :lastRowFlag; ;

I added one row in the database

sqlite select * from cert_store_table;
1|4|X509|VALID|0����|1


returnCode = sqlite3_prepare(dbHandle, updateCmd, strlen(updateCmd), stmt,
tail);
   if( returnCode!=SQLITE_OK )
   {
   printf(Can't prepare update cmd in database: %s\n,
sqlite3_errmsg(dbHandle));
   sqlite3_close(dbHandle);
}

sqlite3_bind_int(stmt,  1, 0);
sqlite3_bind_int(stmt,  2, 1 );

returnCode = sqlite3_step(stmt);

printf(returnCode : %d\n,returnCode);


Is there any wrong in the above code ?


If i update on the command line using the command , it is working.What is
the issue ??

sqlite  select * from cert_store_table;
1|4|X509|VALID|0����|1
sqlite update  cert_store_table set lastRowFlag = 0 where lastRowFlag = 1;
sqlite select * from cert_store_table;
1|4|X509|VALID|0����|0



Thanks in advance,

Waiting for your reply,

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


Re: [sqlite] Update command working from command line but not from a C program

2008-09-16 Thread Simon Davies
2008/9/16 Aravinda babu [EMAIL PROTECTED]:
 Hi all,

.
.
.
 static const char *updateCmd = UPDATE cert_store_table set lastRowFlag =
 :lastRowFlag where lastRowFlag = :lastRowFlag; ; 
    same named parameter twice

.
.
.
 Is there any wrong in the above code ?


 If i update on the command line using the command , it is working.What is
 the issue ??

.
.
.

 Waiting for your reply,

 Aravind.

Hi Aravind,

You are using the same parameter name - only the first bind value will be used.
See http://www.sqlite.org/c3ref/bind_blob.html.

I suspect that you are ignoring an error from your second call to
sqlite3_bind_int.

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


Re: [sqlite] DELETEs using a range from an indexed column

2008-09-16 Thread Jay A. Kreibich
On Mon, Sep 15, 2008 at 10:57:37PM -0700, Tomas Lee scratched on the wall:

 I want to delete the 1000 members with the lowest scores.  Assume that
 it is extremely unlikely for two members to have identical scores.
 Also, the 1000 is arbitrary -- it could be more or less on different
 days.  But each time I do this deletion, it will be a fixed number.
 
 What's the fastest way to do this?  


  Your best bet is to just try things out and see.


 Method A:
  * find the 1000th lowest score:
SELECT score FROM members ORDER BY score LIMIT 1 OFFSET 999;
  * delete the records equal to or lower than that score
DELETE FROM members WHERE score = $thousandth_lowest_score;

  Do it as one command using a sub-select:

  DELETE FROM members WHERE score = (
SELECT score FROM members ORDER BY score LIMIT 1 OFFSET 999);

  Personally I don't like this, since it has the potential to delete
  too many records.  Having repeating scores may be rare, but that's
  not never.  On the other hand, getting rid of ties at the cut-off
  point may be desirable.

 Method B:
  * find the uids for the 1000 lowest scores:
SELECT uid FROM members ORDER BY score LIMIT 1000;
  * delete those records
DELETE FROM members WHERE uid IN ([join $uids ,]);

  Again, do it as one command:

  DELETE FROM members WHERE uid IN (
SELECT uid FROM members ORDER BY score LIMIT 1000);

  I'm not sure about speed, but I like this best from from a readability
  standpoint.  It is clean and straight forward, and I wouldn't be
  surprised to find out it is the fastest.

  The only odd thing about this is if several records share the cut-off
  score, there isn't any good way of knowing which will be deleted and
  which will be left behind.  That may or may not matter.

 Method C:
  * delete the records as you find them:
 
sqlite3_prepare_v2(db, DELETE FROM members WHERE uid = ?, -1, stmt_d, 
 NULL);
sqlite3_prepare_v2(db, SELECT uid FROM members ORDER BY score LIMIT 
 1000, -1, stmt_q, NULL);
while (sqlite3_step(stmt_q) == SQLITE_ROW) {
int uid = sqlite3_column_int(stmt_q, 0);
sqlite3_bind_int(stmt_d, 0, uid);
sqlite3_step(stmt_d);
sqlite3_reset(stmt_d);
}
sqlite3_finalize(stmt_d);
sqlite3_finalize(stmt_q);

  Essentially a manual version of Method B.


  Which is fastest may depend on the contents of the table and if the
  index will actually be used or not.  There might also be variations if
  the size (the 1000) changes significantly.

  Again, just try it and see.  Using the sub-selects you can do this
  from the command line on a test database to give you a rough idea.

   -j

-- 
Jay A. Kreibich  J A Y  @  K R E I B I.C H 

Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor.   I'll go home and see if I can scrounge up a ruler
 and a piece of string.  --from Anathem by Neal Stephenson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Network concurrency question

2008-09-16 Thread Jay A. Kreibich
On Mon, Sep 15, 2008 at 11:49:48PM -0400, [EMAIL PROTECTED] scratched on the 
wall:
 I would like to use SQLite from a network share.  I would like to create a
 server app that would do all of the writing to the database except for
 certain tables, one table per client,the clients would write to their own
 table only.  The client drops it's data/instructions into it's own table,
 the server app would scan all client tables for new data/instructions and
 then write the data to the main tables of the database.  Would this work
 without concurrency issues?

  Doubtful.  Since the database is one file, it doesn't matter if the
  clients keep to their own tables.  You still have multiple systems
  trying to write to the same networked database.

  Now if each client had a completely separate database, that *might*
  work, but you'd still have concerns about the remote clients and
  local server accessing the individual databases at the same time.

 Another question I have is do I understand correctly that an SQLite
 database, on a network share, has no problems with many readers, the
 problem starts with many writers. Is this correct?

  When many equals 1 or more, yes.

  Writes need to be completely exclusive.  Even if all the writing is
  done locally, the networked readers may not be kept out of the way
  for the critical sections of the write operation.  My guess is that
  the write operation would be correct, but the reads may crash or get
  bad data.

   -j

-- 
Jay A. Kreibich  J A Y  @  K R E I B I.C H 

Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor.   I'll go home and see if I can scrounge up a ruler
 and a piece of string.  --from Anathem by Neal Stephenson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Network concurrency question

2008-09-16 Thread Enrique Ramirez
 Another question I have is do I understand correctly that an SQLite
 database, on a network share, has no problems with many readers, the
 problem starts with many writers. Is this correct?

 Thanks,
 TD

Yes, you'll have problems with many writers since each network file
system implementation differs from operating system to operating
system. I believe there was a recommendation in the documents about
implementing your own VFS layer in these cases if you need multiple
writers in a network share.

Might want to take a look at: http://www.sqlite.org/faq.html#q5

-- 
// --
Enrique Ramirez Irizarry
Lead Developer
Indie Code Labs
http://www.indiecodelabs.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Closing database fails due to unfinalized statements

2008-09-16 Thread Dan

On Sep 16, 2008, at 4:44 PM, Lothar Behrens wrote:

 Hi,

 I do have any unfinalized statements in my application when compiled
 on Windows, but not on Mac OS X.

 Is there any difference I am missing to attent for ?

 How could I see, wich statement (statement handle or SQL query to be
 used in that statement) is unfinalized ?

Use sqlite3_next_stmt() to find unfinalized statements. sqlite3_sql()
to determine the SQL used to prepare them.

Dan.

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


Re: [sqlite] Closing database fails due to unfinalized statements

2008-09-16 Thread Jay A. Kreibich
On Tue, Sep 16, 2008 at 11:44:24AM +0200, Lothar Behrens scratched on the wall:
 Hi,
 
 I do have any unfinalized statements in my application when compiled  
 on Windows, but not on Mac OS X.
 
 Is there any difference I am missing to attent for ?
 
 How could I see, wich statement (statement handle or SQL query to be  
 used in that statement) is unfinalized ?
 
 I do not have any differences in my compiler switches (defines).

  Since Mac OS X now comes with a copy of the SQLite libs installed
  (that are somewhat out of date), be very careful you're linking against 
  your development libs and not the system libs.

  IIRC, there was a behavior change a few versions back having to do
  with how unfinalized statements were handled when you attempt to
  close the database.
  
  If you're linking against a recent download on Windows and an older
  system lib on the Mac, that might explain the different behavior.

   -j

-- 
Jay A. Kreibich  J A Y  @  K R E I B I.C H 

Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor.   I'll go home and see if I can scrounge up a ruler
 and a piece of string.  --from Anathem by Neal Stephenson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] best language match for SQLite?

2008-09-16 Thread Patrick
I am a beginner to intermediate Python Programmer. I can use SQLite with 
it just fine but it is my understanding that relational database and 
object oriented programming our not the perfect marriage.

I was just wondering if anyone had an opinion on the most ideal language 
to use with SQLite?

I love Python but I LOVE SQLite, I would learn another language just to 
use it better-Patrick
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread Jeff Godfrey
Patrick wrote:
 I was just wondering if anyone had an opinion on the most ideal language 
 to use with SQLite?

 I love Python but I LOVE SQLite, I would learn another language just to 
 use it better-Patrick
   
According to a paper written by Richard Hipp (the creator of SQLite), 
Tcl is the ideal language.  Here's a quote from the mentioned paper:

The increasing popularity of SQLite is seen in the fact that the main 
website daily serves about a gigabyte of data to around 3000 unique IP 
addresses. SQLite has been eagerly embraced by PHP, Perl, and Python 
programmers. What most of these enthusiastic users fail to realize is 
that SQLite bindings for the three P-languages are an afterthought. 
SQLite was designed from the beginning to be used with Tcl. Tcl bindings 
have been in the SQLite core since before version 1.0 and almost half of 
the SQLite source code base consists of regression test scripts written 
in Tcl. SQLite wants to be programmed in Tcl, not those other languages.

The entire paper can be found here:

http://www.tcl.tk/community/tcl2004/Papers/D.RichardHipp/drh.html

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


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread Mohit Sindhwani
Jeff Godfrey wrote:
 According to a paper written by Richard Hipp (the creator of SQLite), 
 Tcl is the ideal language.  Here's a quote from the mentioned paper:

 The increasing popularity of SQLite is seen in the fact that the main 
 website daily serves about a gigabyte of data to around 3000 unique IP 
 addresses. SQLite has been eagerly embraced by PHP, Perl, and Python 
 programmers. What most of these enthusiastic users fail to realize is 
 that SQLite bindings for the three P-languages are an afterthought. 
 SQLite was designed from the beginning to be used with Tcl. Tcl bindings 
 have been in the SQLite core since before version 1.0 and almost half of 
 the SQLite source code base consists of regression test scripts written 
 in Tcl. SQLite wants to be programmed in Tcl, not those other languages.

 The entire paper can be found here:

 http://www.tcl.tk/community/tcl2004/Papers/D.RichardHipp/drh.html

While that's true, Ruby works really well with SQLite!

Cheers,
Mohit.
9/17/2008 | 12:11 AM.

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


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread Ribeiro, Glauber
SQLite is written in C, and its creators seem to be fond of TCL, so
those are 2 good choices, but I don't think there is a most ideal
language for anything - it all depends on balancing what you need to do
and what you want to learn.

And of course, Perl is always best. :)

g

-Original Message-
From: Patrick [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 16, 2008 10:51 AM
To: General Discussion of SQLite Database
Subject: [sqlite] best language match for SQLite?

I am a beginner to intermediate Python Programmer. I can use SQLite with

it just fine but it is my understanding that relational database and 
object oriented programming our not the perfect marriage.

I was just wondering if anyone had an opinion on the most ideal language

to use with SQLite?

I love Python but I LOVE SQLite, I would learn another language just to 
use it better-Patrick

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


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread palmer ristevski

And of course, Perl is always best. :)

That's  right brother!
Educate them , Educate them i say!

P.

 Date: Tue, 16 Sep 2008 11:13:27 -0500
 From: [EMAIL PROTECTED]
 To: sqlite-users@sqlite.org
 Subject: Re: [sqlite] best language match for SQLite?
 
 SQLite is written in C, and its creators seem to be fond of TCL, so
 those are 2 good choices, but I don't think there is a most ideal
 language for anything - it all depends on balancing what you need to do
 and what you want to learn.
 
 And of course, Perl is always best. :)
 
 g
 
 -Original Message-
 From: Patrick [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, September 16, 2008 10:51 AM
 To: General Discussion of SQLite Database
 Subject: [sqlite] best language match for SQLite?
 
 I am a beginner to intermediate Python Programmer. I can use SQLite with
 
 it just fine but it is my understanding that relational database and 
 object oriented programming our not the perfect marriage.
 
 I was just wondering if anyone had an opinion on the most ideal language
 
 to use with SQLite?
 
 I love Python but I LOVE SQLite, I would learn another language just to 
 use it better-Patrick
 
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_
See how Windows connects the people, information, and fun that are part of your 
life.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread bartsmissaert
 And of course, Perl is always best. :)

Of course; but VB (VB6) is just a bit better.

RBS



 And of course, Perl is always best. :)

 That's  right brother!
 Educate them , Educate them i say!

 P.

 Date: Tue, 16 Sep 2008 11:13:27 -0500
 From: [EMAIL PROTECTED]
 To: sqlite-users@sqlite.org
 Subject: Re: [sqlite] best language match for SQLite?

 SQLite is written in C, and its creators seem to be fond of TCL, so
 those are 2 good choices, but I don't think there is a most ideal
 language for anything - it all depends on balancing what you need to do
 and what you want to learn.

 And of course, Perl is always best. :)

 g

 -Original Message-
 From: Patrick [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, September 16, 2008 10:51 AM
 To: General Discussion of SQLite Database
 Subject: [sqlite] best language match for SQLite?

 I am a beginner to intermediate Python Programmer. I can use SQLite with

 it just fine but it is my understanding that relational database and
 object oriented programming our not the perfect marriage.

 I was just wondering if anyone had an opinion on the most ideal language

 to use with SQLite?

 I love Python but I LOVE SQLite, I would learn another language just to
 use it better-Patrick

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

 _
 See how Windows connects the people, information, and fun that are part of
 your life.
 http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/
 ___
 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] best language match for SQLite?

2008-09-16 Thread palmer ristevski

Of course; but VB (VB6) is just a bit better.

YES brothers, Educate them, Educate them 

For you see those 2 are actually my two main programming platforms!

Disciples go forth to educate the peoples!

P.

 Date: Tue, 16 Sep 2008 17:20:55 +0100
 From: [EMAIL PROTECTED]
 To: sqlite-users@sqlite.org
 Subject: Re: [sqlite] best language match for SQLite?
 
  And of course, Perl is always best. :)
 
 Of course; but VB (VB6) is just a bit better.
 
 RBS
 
 
 
  And of course, Perl is always best. :)
 
  That's  right brother!
  Educate them , Educate them i say!
 
  P.
 
  Date: Tue, 16 Sep 2008 11:13:27 -0500
  From: [EMAIL PROTECTED]
  To: sqlite-users@sqlite.org
  Subject: Re: [sqlite] best language match for SQLite?
 
  SQLite is written in C, and its creators seem to be fond of TCL, so
  those are 2 good choices, but I don't think there is a most ideal
  language for anything - it all depends on balancing what you need to do
  and what you want to learn.
 
  And of course, Perl is always best. :)
 
  g
 
  -Original Message-
  From: Patrick [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, September 16, 2008 10:51 AM
  To: General Discussion of SQLite Database
  Subject: [sqlite] best language match for SQLite?
 
  I am a beginner to intermediate Python Programmer. I can use SQLite with
 
  it just fine but it is my understanding that relational database and
  object oriented programming our not the perfect marriage.
 
  I was just wondering if anyone had an opinion on the most ideal language
 
  to use with SQLite?
 
  I love Python but I LOVE SQLite, I would learn another language just to
  use it better-Patrick
 
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
  _
  See how Windows connects the people, information, and fun that are part of
  your life.
  http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/
  ___
  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

_
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread Enrique Ramirez
On Tue, Sep 16, 2008 at 12:20 PM,  [EMAIL PROTECTED] wrote:
 And of course, Perl is always best. :)

 Of course; but VB (VB6) is just a bit better.

 RBS


Almost fell out of my chair laughing.

But in all seriousness, if you're into ADO.Net, the System.Data.SQLite
wrapper by Robert Simpson will make you feel right at home.


-- 
// --
Enrique Ramirez Irizarry
Lead Developer
Indie Code Labs
http://www.indiecodelabs.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread Michael Schlenker
Patrick schrieb:
 I am a beginner to intermediate Python Programmer. I can use SQLite with 
 it just fine but it is my understanding that relational database and 
 object oriented programming our not the perfect marriage.
 
 I was just wondering if anyone had an opinion on the most ideal language 
 to use with SQLite?
 
 I love Python but I LOVE SQLite, I would learn another language just to 
 use it better-Patrick

Depends really on what you wanna do with it. The best language to use with
SQLite is of course SQL ;-).

Otherwise it does not really matter. Your right that there is a mismatch
between the set oriented operations of relational databases and the more
item oriented OO world, thats why there are all those ORMs like SQLalchemy,
Storm etc. which bridge the gap.

But Tcl isn't a bad recommendation anyway. Might feel a bit foreign for your
Python tuned mind, but it has a really, good SQLite interface. Bonus: you
can help improve the SQLite testsuite easier if you understand Tcl.

Michael

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


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread Fred Williams
I haven't met a real programmer since I wrote my last TASM program quite a
few years ago. :-(

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of palmer ristevski
Sent: Tuesday, September 16, 2008 11:19 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] best language match for SQLite?



And of course, Perl is always best. :)

That's  right brother!
Educate them , Educate them i say!

P.

 Date: Tue, 16 Sep 2008 11:13:27 -0500
 From: [EMAIL PROTECTED]
 To: sqlite-users@sqlite.org
 Subject: Re: [sqlite] best language match for SQLite?

 SQLite is written in C, and its creators seem to be fond of TCL, so
 those are 2 good choices, but I don't think there is a most ideal
 language for anything - it all depends on balancing what you need to do
 and what you want to learn.

 And of course, Perl is always best. :)

 g

 -Original Message-
 From: Patrick [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, September 16, 2008 10:51 AM
 To: General Discussion of SQLite Database
 Subject: [sqlite] best language match for SQLite?

 I am a beginner to intermediate Python Programmer. I can use SQLite with

 it just fine but it is my understanding that relational database and
 object oriented programming our not the perfect marriage.

 I was just wondering if anyone had an opinion on the most ideal language

 to use with SQLite?

 I love Python but I LOVE SQLite, I would learn another language just to
 use it better-Patrick

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

_
See how Windows connects the people, information, and fun that are part of
your life.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/
___
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] best language match for SQLite?

2008-09-16 Thread D . Richard Hipp

On Sep 16, 2008, at 12:09 PM, Jeff Godfrey wrote:

 Patrick wrote:
 I was just wondering if anyone had an opinion on the most ideal  
 language
 to use with SQLite?

 I love Python but I LOVE SQLite, I would learn another language  
 just to
 use it better-Patrick

 According to a paper written by Richard Hipp (the creator of SQLite),
 Tcl is the ideal language.  Here's a quote from the mentioned paper:

 The increasing popularity of SQLite is seen in the fact that the main
 website daily serves about a gigabyte of data to around 3000 unique IP
 addresses. SQLite has been eagerly embraced by PHP, Perl, and Python
 programmers. What most of these enthusiastic users fail to realize is
 that SQLite bindings for the three P-languages are an afterthought.
 SQLite was designed from the beginning to be used with Tcl. Tcl  
 bindings
 have been in the SQLite core since before version 1.0 and almost  
 half of
 the SQLite source code base consists of regression test scripts  
 written
 in Tcl. SQLite wants to be programmed in Tcl, not those other  
 languages.


SQLite is a TCL extension that has escaped into the wild.  SQLite was  
originally written to support a large program written in Tcl/Tk.   
SQLite would have never existed where it not for TCL.  SQLite could  
not maintain its current quality without the extensive TCL-based test  
suite.  The language bindings for TCL are the most natural and easy-to- 
use of any language I have seen.

The statistics in the quote above are dated.  Recently we have been  
getting about 11,000 unique IPs per day at the website and the amount  
of TCL code in the source tree (all of the regression tests) is  
approaching 75%.

D. Richard Hipp
[EMAIL PROTECTED]



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


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread P Kishor
On 9/16/08, Patrick [EMAIL PROTECTED] wrote:
 I am a beginner to intermediate Python Programmer. I can use SQLite with
  it just fine but it is my understanding that relational database and
  object oriented programming our not the perfect marriage.

  I was just wondering if anyone had an opinion on the most ideal language
  to use with SQLite?

  I love Python but I LOVE SQLite, I would learn another language just to
  use it better-Patrick
  ___


The best programming language is the one you know best. Since you will
be working with a SQL database, getting good at SQL is also very
important.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread Jim Dodgen
I get a lot of miles out of Perl, 116,000 lines and counting.

On Tue, Sep 16, 2008 at 9:41 AM, Fred Williams [EMAIL PROTECTED] wrote:
 I haven't met a real programmer since I wrote my last TASM program quite a
 few years ago. :-(

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of palmer ristevski
 Sent: Tuesday, September 16, 2008 11:19 AM
 To: General Discussion of SQLite Database
 Subject: Re: [sqlite] best language match for SQLite?



 And of course, Perl is always best. :)

 That's  right brother!
 Educate them , Educate them i say!

 P.

 Date: Tue, 16 Sep 2008 11:13:27 -0500
 From: [EMAIL PROTECTED]
 To: sqlite-users@sqlite.org
 Subject: Re: [sqlite] best language match for SQLite?

 SQLite is written in C, and its creators seem to be fond of TCL, so
 those are 2 good choices, but I don't think there is a most ideal
 language for anything - it all depends on balancing what you need to do
 and what you want to learn.

 And of course, Perl is always best. :)

 g

 -Original Message-
 From: Patrick [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, September 16, 2008 10:51 AM
 To: General Discussion of SQLite Database
 Subject: [sqlite] best language match for SQLite?

 I am a beginner to intermediate Python Programmer. I can use SQLite with

 it just fine but it is my understanding that relational database and
 object oriented programming our not the perfect marriage.

 I was just wondering if anyone had an opinion on the most ideal language

 to use with SQLite?

 I love Python but I LOVE SQLite, I would learn another language just to
 use it better-Patrick

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

 _
 See how Windows connects the people, information, and fun that are part of
 your life.
 http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/
 ___
 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




-- 
Jim Dodgen
[EMAIL PROTECTED]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread Clay Dowling
For myself, I find C and C++ to be the best for use with SQLite (and the 
STL makes the set oriented nature of relational databases fit reasonably 
well).  Mostly though that's because those are the languages I prefer to 
work in, rather than in inherent quality of the bindings.  Like the man 
says, it's a TCL extension that escaped quarantine.

Clay

On Tue, 16 Sep 2008, Patrick wrote:

 I am a beginner to intermediate Python Programmer. I can use SQLite with
 it just fine but it is my understanding that relational database and
 object oriented programming our not the perfect marriage.

 I was just wondering if anyone had an opinion on the most ideal language
 to use with SQLite?

 I love Python but I LOVE SQLite, I would learn another language just to
 use it better-Patrick
 ___
 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] best language match for SQLite?

2008-09-16 Thread Martin (OPENGeoMap)
Mohit Sindhwani escribió:
 Jeff Godfrey wrote:
   
 According to a paper written by Richard Hipp (the creator of SQLite), 
 Tcl is the ideal language.  Here's a quote from the mentioned paper:

 The increasing popularity of SQLite is seen in the fact that the main 
 website daily serves about a gigabyte of data to around 3000 unique IP 
 addresses. SQLite has been eagerly embraced by PHP, Perl, and Python 
 programmers. What most of these enthusiastic users fail to realize is 
 that SQLite bindings for the three P-languages are an afterthought. 
 SQLite was designed from the beginning to be used with Tcl. Tcl bindings 
 have been in the SQLite core since before version 1.0 and almost half of 
 the SQLite source code base consists of regression test scripts written 
 in Tcl. SQLite wants to be programmed in Tcl, not those other languages.

 The entire paper can be found here:

 http://www.tcl.tk/community/tcl2004/Papers/D.RichardHipp/drh.html
 

 While that's true, Ruby works really well with SQLite!
   
Ruby rocks. C# rocks. D rocks. I used ruby in a project and i am very 
happy. /gem install sqlite3/-ruby ...
This 3 languages are completed from the begining and with different uses.

For me the universe must be in C and autocreate bindings to other 
languages is direct if the C APi is well designed.
http://live.gnome.org/Vala
http://live.gnome.org/GObjectIntrospection
If you design a masterful API in C, you can access to all languages like 
JAVA, c#, ruby, python, PERL,D, C++, ...
This is the perfect sample of this API:
http://library.gnome.org/devel/glib/2.18/
This is the perfect sample of a full Object oriented API in C with Gobject:
http://library.gnome.org/devel/gtk/stable/

I doubt SQLite was more apropiate to use in TCL. I see the C API of 
SQlite very clean and easy to hack in other languages.

In my opinion TCL.like perl,  is death and sucks in my opinion. 
Ofusctated life...

PD: I was PERL user in the past and i change it for ruby.

Regards
 Cheers,
 Mohit.
 9/17/2008 | 12:11 AM.

 ___
 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] best language match for SQLite?

2008-09-16 Thread P Kishor
On 9/16/08, Martin (OPENGeoMap) [EMAIL PROTECTED] wrote:
 Mohit Sindhwani escribió:

  Jeff Godfrey wrote:
  
   According to a paper written by Richard Hipp (the creator of SQLite),
   Tcl is the ideal language.  Here's a quote from the mentioned paper:
  
   The increasing popularity of SQLite is seen in the fact that the main
   website daily serves about a gigabyte of data to around 3000 unique IP
   addresses. SQLite has been eagerly embraced by PHP, Perl, and Python
   programmers. What most of these enthusiastic users fail to realize is
   that SQLite bindings for the three P-languages are an afterthought.
   SQLite was designed from the beginning to be used with Tcl. Tcl bindings
   have been in the SQLite core since before version 1.0 and almost half of
   the SQLite source code base consists of regression test scripts written
   in Tcl. SQLite wants to be programmed in Tcl, not those other languages.
  
   The entire paper can be found here:
  
   http://www.tcl.tk/community/tcl2004/Papers/D.RichardHipp/drh.html
  
  
   While that's true, Ruby works really well with SQLite!
  

 Ruby rocks. C# rocks. D rocks. I used ruby in a project and i am very
  happy. /gem install sqlite3/-ruby ...
  This 3 languages are completed from the begining and with different uses.

  For me the universe must be in C and autocreate bindings to other
  languages is direct if the C APi is well designed.
  http://live.gnome.org/Vala
  http://live.gnome.org/GObjectIntrospection
  If you design a masterful API in C, you can access to all languages like
  JAVA, c#, ruby, python, PERL,D, C++, ...
  This is the perfect sample of this API:
  http://library.gnome.org/devel/glib/2.18/
  This is the perfect sample of a full Object oriented API in C with Gobject:
  http://library.gnome.org/devel/gtk/stable/

  I doubt SQLite was more apropiate to use in TCL. I see the C API of
  SQlite very clean and easy to hack in other languages.

  In my opinion TCL.like perl,  is death and sucks in my opinion.
  Ofusctated life...

  PD: I was PERL user in the past and i change it for ruby.

ai, ai, ai... words such as death and sucks in one sentence...
fortunately, they are in your opinion.

Fortunately, I won't have to change to Ruby as I am quite happy and
comfortable with the language of my choice (which happens to start
with P).

I reiterate -- the best programming language is the one you are best at.



  Regards

  Cheers,
   Mohit.
   9/17/2008 | 12:11 AM.
  
   ___
   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



-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Foreign key trigger in transaction triggers wrongly

2008-09-16 Thread Björn Rauch
Hello, I am writing an application with the database layer implemented with 
SQLite.NET. I am using SQLite 3.6.1 for Windows. I have 2 tables, Document and 
File, where File has a foreign key to the autoincrement primary key of 
Document. I enforce referential integrity using a set of foreign key triggers. 
The table File is first filled with records where DocumentId=0. Then document 
records  are created based on a complicated algorithm involving aggregations on 
all files. After creating a document, the appropriate files are updated to 
point to the document. The inserts and updates run in a transaction. The update 
of the File table raises the update trigger. It seems the the trigger is not 
seeing the inserted records in the Document table. This looks to me like the 
trigger does not see the changes made within the transaction, i.e. the new row 
in the table Document. Am I doing something wrong? Is this unexpected behavior? 
Thanks in advance for your help! Bjorn -Here are the excerpts of the 
database script and statements that raise the trigger: -- table Document CREATE 
TABLE [Document]( [Id] INTEGER PRIMARY KEY AUTOINCREMENT,[Title] 
TEXT(200)); -- primary key read onlyCREATE TRIGGER [pk_Document]BEFORE 
UPDATE OF [Id] ON [Document]FOR EACH ROWBEGINSELECT RAISE( ABORT, 
'Primary key invariant: pk_Document' );END;-- table FileCREATE TABLE File( 
Id INTEGER PRIMARY KEY AUTOINCREMENT,DocumentId INTEGER,   -- foreign key 
(Document.Id)RootFolder TEXT(100), -- foreign key (Storage.RootFolder)
FileName TEXT(250),FullName TEXT(500),Path TEXT(250)); -- primary key 
read onlyCREATE TRIGGER [pk_File]BEFORE UPDATE OF [Id] ON [File]FOR 
EACH ROWBEGINSELECT RAISE( ABORT, 'Primary key invariant: pk_File' );END;-- 
foreign key File.DocumentId -- Document.Id CREATE TRIGGER 
[fk_File_Document_del]BEFORE DELETE ON [Document]FOR EACH ROWWHEN 
(old.[Id] IN (SELECT [DocumentId] FROM [File] GROUP BY [DocumentId]))BEGIN
SELECT RAISE( ABORT, 'Foreign key violated: fk_File_Document_del' );END; CREATE 
TRIGGER [fk_File_Document_ins]BEFORE INSERT ON [File]FOR EACH ROW
WHEN (new.[DocumentId]0 AND new.[DocumentId] NOT IN (SELECT [Id] FROM 
[Document]))BEGINSELECT RAISE( ABORT, 'Foreign key violated: 
fk_File_Document_ins' );END; CREATE TRIGGER [fk_FileDocument_upd]BEFORE 
UPDATE ON [File]FOR EACH ROWWHEN (new.[DocumentId] NOT IN (SELECT [Id] 
FROM [Document]))BEGINSELECT RAISE( ABORT, 'Foreign key violated: 
fk_File_Document_upd' );END;The File table is filled with rows where the 
DocumentId is 0 (a foreign key violation permitted by the insert trigger). My 
application then executes the following SQL statements (aggregated): BEGIN 
TRANSACTION INSERT INTO [Document] ([Title]) VALUES ('blabla') SELECT [seq] 
FROM [sqlite_sequence] WHERE [name]='Document' UPDATE [File] SET [DocumentId]=1 
WHERE [Id]=422 Now the UPDATE fails as the update trigger raises an abort: 
Foreign key violated: fk_File_Document_upd -
_
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vistamkt=en-USform=QBRE
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] relational/OO (was Re: best language match for SQLite?)

2008-09-16 Thread Darren Duncan
Michael Schlenker wrote:
 Patrick schrieb:
 I am a beginner to intermediate Python Programmer. I can use SQLite with 
 it just fine but it is my understanding that relational database and 
 object oriented programming our not the perfect marriage.
 
 Otherwise it does not really matter. Your right that there is a mismatch
 between the set oriented operations of relational databases and the more
 item oriented OO world, thats why there are all those ORMs like SQLalchemy,
 Storm etc. which bridge the gap.

Generally speaking there is no impedance mismatch between relational 
databases and the OO world.

Both natively provide relation and tuple data types and relational 
operators, and sets and arrays etc, and booleans, numbers, text and binary 
strings etc.  Both natively support the creation of arbitrarily complex 
user-defined data types and operators.  Both natively support automatic 
persistence of any of the above, and atomicity, and transactions.  Both 
support definition and enforcement of arbitrary type, state, and transition 
constraints, and triggers.  Both support multiple views of the same data, 
sometimes updateable.  Both support invoking the compiler at runtime.  Both 
support type graphs and polymorphism, substitutability, inheritence.

How they differ are in relatively minor ways, such as in OO you have the 
concept of a value that is a pointer to a memory address or implementation 
detail, while in a relational database you don't and there is a clear 
distinction between a value and a variable, and those are referred to 
symbolically.

The reason that ORMs exist is to either compensate for relatively minor 
differences, or to provide a wider variety of APIs for a database than the 
database is providing itself, or compensate in the application-space for a 
database implementation that lacks some of the relational database features.

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


Re: [sqlite] fts3 database grows

2008-09-16 Thread Scott Hess
On Tue, Sep 16, 2008 at 12:02 AM, Holger Lembke [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] wrote:
 Database will grow from about 3.615 KB and continue growing.
 After 100 more FILLs (40.000 delete+insert actions.) it
 reaches a size of 85.683 KB.

 Just in case we are confused due to European and American dots: those are
 European dots.

 So it reads: grows from 3 MB to 85 MB.

That IS an important distinction!

In the 3MB range, optimize() is probably still pretty reasonable.
It's basically a sorted merge, so the time required will be dominated
by I/O cost.  If your database is not fragmented, it can be pretty
fast, but for databases with lots of updates over long periods, this
kind of thing can start to slow down a lot.

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


Re: [sqlite] Dates SQLite

2008-09-16 Thread bizshop

I use ISO time, which is 20080916122801 as I write this. It can be stored in
integer format, is very easy to manipulate and sort.
YearMonthDateHourMinuteSecond



Brown, Daniel wrote:
 
 Good morning list,
 
 Could someone point me to the documentation regarding dates and SQLite?
 I'm having trouble finding anything about what data type I should use to
 store dates in my SQLite tables, should it be a numerical type (integer
 or real) or a string?
 
 Cheers,
 
 Daniel Brown | Software Engineer @ EA Canada
 The best laid schemes o' mice an' men, gang aft agley
 
 
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 

-- 
View this message in context: 
http://www.nabble.com/Dates---SQLite-tp19496074p19518812.html
Sent from the SQLite mailing list archive at Nabble.com.

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


[sqlite] replacing underscore with a tab

2008-09-16 Thread Robert Citek
How can I replace an underscore (_) in a field with a tab?

This works but seems like suck a hack:

$ sqlite3 foobar.db 'select replace(id,_,{tab}) from bar;' |
  sed -e 's/{tab}/\t/'

I was hoping for a char(9) or similar but couldn't find anything in the docs:

http://www.sqlite.org/lang_corefunc.html

Pointers to references greatly appreciated.

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


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread John Stanton
My advice was not to have the tail wag the dog.  Choose you language as 
appropriate for the application.  Sqlite fits everywhere.  For example 
if it is an embedded system use C.  If it it something else a script 
system like Perl of whatever would be appropriate.

If you want an ideally integrated platform use TCL.

Martin (OPENGeoMap) wrote:
 Mohit Sindhwani escribió:
 Jeff Godfrey wrote:
   
 According to a paper written by Richard Hipp (the creator of SQLite), 
 Tcl is the ideal language.  Here's a quote from the mentioned paper:

 The increasing popularity of SQLite is seen in the fact that the main 
 website daily serves about a gigabyte of data to around 3000 unique IP 
 addresses. SQLite has been eagerly embraced by PHP, Perl, and Python 
 programmers. What most of these enthusiastic users fail to realize is 
 that SQLite bindings for the three P-languages are an afterthought. 
 SQLite was designed from the beginning to be used with Tcl. Tcl bindings 
 have been in the SQLite core since before version 1.0 and almost half of 
 the SQLite source code base consists of regression test scripts written 
 in Tcl. SQLite wants to be programmed in Tcl, not those other languages.

 The entire paper can be found here:

 http://www.tcl.tk/community/tcl2004/Papers/D.RichardHipp/drh.html
 
 While that's true, Ruby works really well with SQLite!
   
 Ruby rocks. C# rocks. D rocks. I used ruby in a project and i am very 
 happy. /gem install sqlite3/-ruby ...
 This 3 languages are completed from the begining and with different uses.
 
 For me the universe must be in C and autocreate bindings to other 
 languages is direct if the C APi is well designed.
 http://live.gnome.org/Vala
 http://live.gnome.org/GObjectIntrospection
 If you design a masterful API in C, you can access to all languages like 
 JAVA, c#, ruby, python, PERL,D, C++, ...
 This is the perfect sample of this API:
 http://library.gnome.org/devel/glib/2.18/
 This is the perfect sample of a full Object oriented API in C with Gobject:
 http://library.gnome.org/devel/gtk/stable/
 
 I doubt SQLite was more apropiate to use in TCL. I see the C API of 
 SQlite very clean and easy to hack in other languages.
 
 In my opinion TCL.like perl,  is death and sucks in my opinion. 
 Ofusctated life...
 
 PD: I was PERL user in the past and i change it for ruby.
 
 Regards
 Cheers,
 Mohit.
 9/17/2008 | 12:11 AM.

 ___
 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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] replacing underscore with a tab

2008-09-16 Thread Igor Tandetnik
Robert Citek [EMAIL PROTECTED]
wrote:
 How can I replace an underscore (_) in a field with a tab?

 This works but seems like suck a hack:

 $ sqlite3 foobar.db 'select replace(id,_,{tab}) from bar;' |
  sed -e 's/{tab}/\t/'

 I was hoping for a char(9) or similar but couldn't find anything in
 the docs:

 http://www.sqlite.org/lang_corefunc.html

There's no special SQLite function because none is needed. SQLite will 
quite happily accept a string literal containing a TAB character. The 
trick is to enter one on the command line - and that's an issue with the 
shell, not with SQLite.

Assuming you use bash shell, try this:

sqlite3 foobar.db $'select replace(id,\'_\',\'\t\') from bar;'

or

echo -e select replace(id,'_','\t') from bar; | sqlite3 foobar.db


But if you insist on doing it in SQL, this should work:

sqlite3 foobar.db select replace(id,'_',cast(x'09' as text)) from bar;


Igor Tandetnik



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


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread palmer ristevski

I don't see any problems with people waving the FLAGS of their
favorite programming languages.
The more FLAG waving the merrier i say, and people will get to 
see the many languages being used by the users of SQLite!
This is a wonderful venue for freedom of expression and exchange of
points of view on the different programming languages and SQLite!

P.

 Date: Tue, 16 Sep 2008 15:27:57 -0500
 From: [EMAIL PROTECTED]
 To: sqlite-users@sqlite.org
 Subject: Re: [sqlite] best language match for SQLite?
 
 My advice was not to have the tail wag the dog.  Choose you language as 
 appropriate for the application.  Sqlite fits everywhere.  For example 
 if it is an embedded system use C.  If it it something else a script 
 system like Perl of whatever would be appropriate.
 
 If you want an ideally integrated platform use TCL.
 
 Martin (OPENGeoMap) wrote:
  Mohit Sindhwani escribió:
  Jeff Godfrey wrote:

  According to a paper written by Richard Hipp (the creator of SQLite), 
  Tcl is the ideal language.  Here's a quote from the mentioned paper:
 
  The increasing popularity of SQLite is seen in the fact that the main 
  website daily serves about a gigabyte of data to around 3000 unique IP 
  addresses. SQLite has been eagerly embraced by PHP, Perl, and Python 
  programmers. What most of these enthusiastic users fail to realize is 
  that SQLite bindings for the three P-languages are an afterthought. 
  SQLite was designed from the beginning to be used with Tcl. Tcl bindings 
  have been in the SQLite core since before version 1.0 and almost half of 
  the SQLite source code base consists of regression test scripts written 
  in Tcl. SQLite wants to be programmed in Tcl, not those other languages.
 
  The entire paper can be found here:
 
  http://www.tcl.tk/community/tcl2004/Papers/D.RichardHipp/drh.html
  
  While that's true, Ruby works really well with SQLite!

  Ruby rocks. C# rocks. D rocks. I used ruby in a project and i am very 
  happy. /gem install sqlite3/-ruby ...
  This 3 languages are completed from the begining and with different uses.
  
  For me the universe must be in C and autocreate bindings to other 
  languages is direct if the C APi is well designed.
  http://live.gnome.org/Vala
  http://live.gnome.org/GObjectIntrospection
  If you design a masterful API in C, you can access to all languages like 
  JAVA, c#, ruby, python, PERL,D, C++, ...
  This is the perfect sample of this API:
  http://library.gnome.org/devel/glib/2.18/
  This is the perfect sample of a full Object oriented API in C with Gobject:
  http://library.gnome.org/devel/gtk/stable/
  
  I doubt SQLite was more apropiate to use in TCL. I see the C API of 
  SQlite very clean and easy to hack in other languages.
  
  In my opinion TCL.like perl,  is death and sucks in my opinion. 
  Ofusctated life...
  
  PD: I was PERL user in the past and i change it for ruby.
  
  Regards
  Cheers,
  Mohit.
  9/17/2008 | 12:11 AM.
 
  ___
  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-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread A. H. Ongun
Best language to use is the one that is suited for the job.

Examples:
I use Perl as a gluing language to connect various subsystems together, and as 
a swiss army knife.
C, C++ for embedded development on Linux.
C++ for Windows development.
Forth for embedded development on some specialized hardware.
SQL for Oracle, and MS SQL work.

and Vim to rule them all.  :)

andy


Message: 1
Date: Tue, 16 Sep 2008 11:50:40 -0400
From: Patrick [EMAIL PROTECTED]
Subject: [sqlite] best language match for SQLite?
To: General Discussion of SQLite Database sqlite-users@sqlite.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

I am a beginner to intermediate Python Programmer. I can use SQLite with 
it just fine but it is my understanding that relational database and 
object oriented programming our not the perfect marriage.

I was just wondering if anyone had an opinion on the most ideal language 
to use with SQLite?

I love Python but I LOVE SQLite, I would learn another language just to 
use it better-Patrick  



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


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread Javier Julio
Um... excuse me! You can all move to the side and make room for Flex  
and AIR!

Ciao!
Javi

On Sep 16, 2008, at 5:29 PM, A. H. Ongun wrote:

 Best language to use is the one that is suited for the job.

 Examples:
 I use Perl as a gluing language to connect various subsystems  
 together, and as a swiss army knife.
 C, C++ for embedded development on Linux.
 C++ for Windows development.
 Forth for embedded development on some specialized hardware.
 SQL for Oracle, and MS SQL work.

 and Vim to rule them all.  :)

 andy


 Message: 1
 Date: Tue, 16 Sep 2008 11:50:40 -0400
 From: Patrick [EMAIL PROTECTED]
 Subject: [sqlite] best language match for SQLite?
 To: General Discussion of SQLite Database sqlite-users@sqlite.org
 Message-ID: [EMAIL PROTECTED]
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed

 I am a beginner to intermediate Python Programmer. I can use SQLite  
 with
 it just fine but it is my understanding that relational database and
 object oriented programming our not the perfect marriage.

 I was just wondering if anyone had an opinion on the most ideal  
 language
 to use with SQLite?

 I love Python but I LOVE SQLite, I would learn another language just  
 to
 use it better-Patrick  




 ___
 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] best language match for SQLite?

2008-09-16 Thread palmer ristevski

Glory Be to You!
That is the platform I am currently moving into!
Adobe Flex/Air where Desktop App and Web Apps merge!

P.

 To: sqlite-users@sqlite.org
 Date: Tue, 16 Sep 2008 17:33:09 -0400
 From: [EMAIL PROTECTED]
 Subject: Re: [sqlite] best language match for SQLite?
 
 Um... excuse me! You can all move to the side and make room for Flex  
 and AIR!
 
 Ciao!
 Javi
 
 On Sep 16, 2008, at 5:29 PM, A. H. Ongun wrote:
 
  Best language to use is the one that is suited for the job.
 
  Examples:
  I use Perl as a gluing language to connect various subsystems  
  together, and as a swiss army knife.
  C, C++ for embedded development on Linux.
  C++ for Windows development.
  Forth for embedded development on some specialized hardware.
  SQL for Oracle, and MS SQL work.
 
  and Vim to rule them all.  :)
 
  andy
 
 
  Message: 1
  Date: Tue, 16 Sep 2008 11:50:40 -0400
  From: Patrick [EMAIL PROTECTED]
  Subject: [sqlite] best language match for SQLite?
  To: General Discussion of SQLite Database sqlite-users@sqlite.org
  Message-ID: [EMAIL PROTECTED]
  Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
  I am a beginner to intermediate Python Programmer. I can use SQLite  
  with
  it just fine but it is my understanding that relational database and
  object oriented programming our not the perfect marriage.
 
  I was just wondering if anyone had an opinion on the most ideal  
  language
  to use with SQLite?
 
  I love Python but I LOVE SQLite, I would learn another language just  
  to
  use it better-Patrick  
 
 
 
 
  ___
  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

_
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] replacing underscore with a tab

2008-09-16 Thread Robert Citek
On Tue, Sep 16, 2008 at 3:49 PM, Igor Tandetnik [EMAIL PROTECTED] wrote:
 But if you insist on doing it in SQL, this should work:

 sqlite3 foobar.db select replace(id,'_',cast(x'09' as text)) from bar;

That worked:

$ sqlite3 foobar.db 'select replace(id,_,cast(x09 as text)) from bar;'

Although, using cast was non-obvious to me from reading the docs:

http://www.sqlite.org/lang_expr.html

Here's another version using bash syntax to insert the tab character:

$ sqlite3 foobar.db 'select replace(id,_,'$'\t'') from bar;'

Thanks, Igor.

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


Re: [sqlite] best language match for SQLite?

2008-09-16 Thread Andy Allord
How about Flex, AIR and a P backend!


On Sep 16, 2008, at 4:33 PM, Javier Julio wrote:

 Um... excuse me! You can all move to the side and make room for Flex
 and AIR!

 Ciao!
 Javi

 On Sep 16, 2008, at 5:29 PM, A. H. Ongun wrote:

 Best language to use is the one that is suited for the job.

 Examples:
 I use Perl as a gluing language to connect various subsystems
 together, and as a swiss army knife.
 C, C++ for embedded development on Linux.
 C++ for Windows development.
 Forth for embedded development on some specialized hardware.
 SQL for Oracle, and MS SQL work.

 and Vim to rule them all.  :)

 andy


 Message: 1
 Date: Tue, 16 Sep 2008 11:50:40 -0400
 From: Patrick [EMAIL PROTECTED]
 Subject: [sqlite] best language match for SQLite?
 To: General Discussion of SQLite Database sqlite-users@sqlite.org
 Message-ID: [EMAIL PROTECTED]
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed

 I am a beginner to intermediate Python Programmer. I can use SQLite
 with
 it just fine but it is my understanding that relational database and
 object oriented programming our not the perfect marriage.

 I was just wondering if anyone had an opinion on the most ideal
 language
 to use with SQLite?

 I love Python but I LOVE SQLite, I would learn another language just
 to
 use it better-Patrick  




 ___
 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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Vista frustrations

2008-09-16 Thread Robert Simpson
I recently had a user of the ADO.NET provider report a problem on Vista.
His database is 5gb, and he's doing a full table scan of 16 million rows.
Yea.

 

I ran some tests using the command-line sqlite3.exe, and observed that
Windows Vista (SP1) is actually trying to cache the entire 5gb file into
memory during the table scan!  The system slows to a complete crawl and
becomes unresponsive.  The sqlite3.exe's memory remains very minimal, but
Vista itself eats every last scrap of physical memory, forcing all other
apps to the paging file trying to cache the contents of the database.

 

It took about 500 seconds to scan the entire table, which isn't all that bad
given the circumstances.  Unfortunately Vista's cache remained high and
continued to make the entire system unresponsive until I quit out of the
command-line.

 

After some research, I commented out the FILE_FLAG_RANDOM_ACCESS flag in
os_win.c and re-ran the test.

 

It completed in 99 seconds.  System remained highly responsive, and Vista
never blew out the memory trying to cache the entire file.

 

Now, I know Windows CE benefits greatly from having this flag hint - but has
anyone tested normal desktop performance with or without it?  To me this
seems like an obvious bug in Vista, but the chances of getting Microsoft to
fix it are slim to none.

 

Robert

 

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