Re: [sqlite] cidr data type

2008-04-20 Thread John Stanton
What stops you from building in the 128 bit address logic? Christof Meerwald wrote: > On Fri, 18 Apr 2008 15:59:14 -0600, Dennis Cote wrote: > >>Christof Meerwald wrote: >> >>>Currently, I am thinking of storing start and end IP addresses as a blob in >>>the database - that way I would be able

Re: [sqlite] multiple writers for in-memory datastore

2008-04-20 Thread James Gregurich
for those who may be interested: I ran a test with SQLite version: 3.5.8 I tried the scheme described earlier with each thread sharing a connection but writing into its own attached in-memory db on that connection. Didn't work. all but the first writer thread failed with a SQLITE_ERROR

Re: [sqlite] how to build sqlite under winxp?

2008-04-20 Thread Dimitri
Hi, > NO make file found in that zip, downloaded from the official website... Which exact ZIP file? -- Dimitri ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] multiple writers for in-memory datastore

2008-04-20 Thread Dan
On Apr 20, 2008, at 12:29 AM, James Gregurich wrote: > > oh good! That isn't the version that ships with Leopard, but I can > live with deploying my own version as part of my app. > > Will l get the writer parallelism I'm after as long as each thread > writes exclusively into its own attached

Re: [sqlite] cidr data type

2008-04-20 Thread Florian Weimer
* Dennis Cote: > This last function can be implemented using bit manipulation operators > in SQL or in a custom function in C. > > containedIn(ip_addr, network_addr, network_size) > > can be replaced by > > nework_addr == (ip_addr & (-1 << network_size)) > > which will be true if the IP

Re: [sqlite] EXISTS operator doesn't seem to work

2008-04-20 Thread pinco palletto
It works now, thanks! P.P. > From: [EMAIL PROTECTED] > To: sqlite-users@sqlite.org > Date: Sat, 19 Apr 2008 08:43:42 -0400 > Subject: Re: [sqlite] EXISTS operator doesn't seem to work > > > On Apr 19, 2008, at 7:06 AM, pinco palletto wrote: > > > update register > > set note = (select

Re: [sqlite] cidr data type

2008-04-20 Thread Jay A. Kreibich
On Sun, Apr 20, 2008 at 11:13:56AM +0200, Florian Weimer scratched on the wall: > * Dennis Cote: > > > This last function can be implemented using bit manipulation operators > > in SQL or in a custom function in C. > > > > containedIn(ip_addr, network_addr, network_size) > > > > can be

Re: [sqlite] cidr data type

2008-04-20 Thread John Stanton
Jay A. Kreibich wrote: > On Sun, Apr 20, 2008 at 11:13:56AM +0200, Florian Weimer scratched on the > wall: > >>* Dennis Cote: >> >> >>>This last function can be implemented using bit manipulation operators >>>in SQL or in a custom function in C. >>> >>>containedIn(ip_addr, network_addr,

Re: [sqlite] cidr data type

2008-04-20 Thread Dennis Cote
Florian Weimer wrote: > > Is this Java or C? For C, this breaks if network_size == 32. > It is SQL (with SQLite extensions which are modeled after C). SQLite has a 64 bit integer type so the bit shifting works as expected for all values up to 63. The same logic can be used in other

Re: [sqlite] cidr data type

2008-04-20 Thread Dennis Cote
Jay A. Kreibich wrote: > > It breaks for everything except network_size == 16. > Why do you say that? > You want something closer to (ip_addr & (~(~0 << network_size))) > In SQLite ~0 is -1. sqlite> select ~0; -1 So your inner expression is only a more complicated way of saying

Re: [sqlite] multiple writers for in-memory datastore

2008-04-20 Thread Dennis Cote
James Gregurich wrote: > I think I will go with CoreData on MacOSX and figure out something > else to do on Windows later. > > > You do know that CoreData uses SQLite for its persistant storage. Dennis Cote ___ sqlite-users mailing list

Re: [sqlite] a suggestion to write tutorial for sqlite

2008-04-20 Thread Toby Roworth
I'm sorry if this reply seems jumbled - I wrote the middle bit (about the sugested content) after the bits above and below it. Jay A. Kreibich wrote: > On Sat, Apr 19, 2008 at 05:40:45PM +0100, Toby Roworth scratched on the wall: > >> mikeobe wrote: >> >>> i found it boring to learn how

Re: [sqlite] multiple writers for in-memory datastore

2008-04-20 Thread James Gregurich
yes. However, CoreData queues up modified managed objects in a managed object context and then commits them all in one shot making sure the serialization is done on the back side. So, it does basically what someone here recommended earlier. I just don't have to write the mechanism myself.

[sqlite] Status of SQLite's full-text search (and Python 2.5 support?)

2008-04-20 Thread python
I'm trying to figure out the status of SQLite's support for full-text search. It appears that full-text support was provisionally added to SQLite in late 2006 via an extension module. It sounds like this early version was experimental only. After more googling it appears that there are two

Re: [sqlite] Status of SQLite's full-text search (and Python 2.5 support?)

2008-04-20 Thread P Kishor
On 4/20/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm trying to figure out the status of SQLite's support for full-text > search. > > It appears that full-text support was provisionally added to SQLite in > late 2006 via an extension module. It sounds like this early version was >

Re: [sqlite] Status of SQLite's full-text search (and Python 2.5 support?)

2008-04-20 Thread python
>> Is SQLite's full text ready for production use yet? > as ready as it will be. FTS 1/2 are deprecated. You don't sound too thrilled :) Are there any limitations that one should be aware of? Thank you, Malcolm ___ sqlite-users mailing list

Re: [sqlite] Status of SQLite's full-text search (and Python 2.5 support?)

2008-04-20 Thread P Kishor
On 4/20/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >> Is SQLite's full text ready for production use yet? > > > as ready as it will be. FTS 1/2 are deprecated. > > > You don't sound too thrilled :) Are there any limitations that one > should be aware of? I have no idea how I conveyed

Re: [sqlite] Status of SQLite's full-text search (and Python 2.5 support?)

2008-04-20 Thread python
P Kishor, > I have no idea how I conveyed that impression. I think FTS3 is really > wonderful, and have implemented it in my own personal website. I firmly > believe in the "Why file when you can full-text search" doctrine. Excellent! Thanks for the follow-up. You answered my questions. And

[sqlite] sqlite and NAN

2008-04-20 Thread Justin Greenfield
I'm trying to figure out how to insert and retrieve a NAN value from an sqlite database. I'm on Mac OS X 10.5 which is using sqlite3 3.4.0. Obviously, using the sqlite3 command line tool, this is what I get: $ sqlite3 nantest.db SQLite version 3.4.0 Enter ".help" for instructions sqlite>

Re: [sqlite] cidr data type

2008-04-20 Thread Florian Weimer
* Jay A. Kreibich: >> Is this Java or C? For C, this breaks if network_size == 32. > > It breaks for everything except network_size == 16. I was alluding to the fact that a popular architecture implements modulo-32 shifts for 32-bit integers (and modulo-64 shifts for 64-bit integers), for

[sqlite] Delete inside Select+Step

2008-04-20 Thread Neville Franks
Use the latest SQLite Version can you do: select clma from tablea; while( sqlite3_step() ) { if ( clma == somevalue ) delete from tablea clma=somevalue; else process row; } ie. Delete a row while stepping through the results of a select and know the remaining

[sqlite] NUMERIC affinity and unwanted conversions

2008-04-20 Thread Aladdin Lampé
Hi! I've just created my own "DECIMAL" set of user functions using the IBM decNumber library. I would like to assign my decimal columns the type "DECIMAL([precision])", but they are given the NUMERIC affinity, and numbers are converted when inserted in TEXT format... That's exactly what I'm

[sqlite] Select TOP n

2008-04-20 Thread James Dodd
Hi, (Newbie to sqlite, some experience with SQL Server 2000). I tried to do a "SELECT TOP 10 * FROM tab1" and sqlite3 complained. Then I looked at the SQL syntax page and indeed TOP doesn't seem to be there. Is there a reason for this and, better still, is there a way to get around it? Or is it

Re: [sqlite] Select TOP n

2008-04-20 Thread David Baird
On Sun, Apr 20, 2008 at 5:07 PM, James Dodd <[EMAIL PROTECTED]> wrote: > Hi, > > (Newbie to sqlite, some experience with SQL Server 2000). I tried to do a > "SELECT TOP 10 * FROM tab1" and sqlite3 complained. Then I looked at the SQL > syntax page and indeed TOP doesn't seem to be there. Is

Re: [sqlite] cidr data type

2008-04-20 Thread Jay A. Kreibich
On Sun, Apr 20, 2008 at 09:29:34AM -0600, Dennis Cote scratched on the wall: > Jay A. Kreibich wrote: > > > > It breaks for everything except network_size == 16. > > > Why do you say that? > > You want something closer to (ip_addr & (~(~0 << network_size))) > > > In SQLite ~0 is -1. > >

Re: [sqlite] NUMERIC affinity and unwanted conversions

2008-04-20 Thread John Stanton
I implemented a DECIMAL type and ended up making a small patch to Sqlite to stop it changing the type to numeric. As I recall it was very simple. Aladdin Lampé wrote: > Hi! > I've just created my own "DECIMAL" set of user functions using the IBM > decNumber library. > I would like to assign my

Re: [sqlite] Delete inside Select+Step

2008-04-20 Thread BareFeet
Hi Neville, > Use the latest SQLite Version can you do: > > select clma from tablea; > while( sqlite3_step() ) > { >if ( clma == somevalue ) > delete from tablea clma=somevalue; >else > process row; > } > > ie. Delete a row while stepping through the results of a select and

Re: [sqlite] Delete inside Select+Step

2008-04-20 Thread Neville Franks
Monday, April 21, 2008, 10:44:15 AM, you wrote: >> I actually need to call a function for each iteration of >> sqlite3_step() and depending on what it returns, delete the row or >> not. B> Perhaps you could include your function in an example. Well it is a function that calls various other