Re: [sqlite] Adjusting strategy for ROWIDs

2011-03-04 Thread Nico Williams
On Fri, Mar 4, 2011 at 7:18 PM, Enrico Thierbach wrote: > On 04.03.2011, at 22:21, Drake Wilson wrote: >> Why do you want to do this?  In particular, why would it not work to >> randomize the values from the application side during inserts? > I am trying to build a solution

Re: [sqlite] Adjusting strategy for ROWIDs

2011-03-04 Thread Richard Hipp
On Fri, Mar 4, 2011 at 5:59 PM, Simon Slavin wrote: > > On 4 Mar 2011, at 9:55pm, Black, Michael (IS) wrote: > > > SQlite's random() is a pseudo-random (as are most all) so there is no > collision until you get the same value back at which point it just repeats > the whole

Re: [sqlite] Adjusting strategy for ROWIDs

2011-03-04 Thread Simon Slavin
On 5 Mar 2011, at 1:18am, Enrico Thierbach wrote: > I do have a working solution for synching my databases (with randomly > generated ROWIDs). The problem I face > is that I cannot get the rowid of a newly created record to pass thru back > into the application using last_insert_row_id. I

Re: [sqlite] Adjusting strategy for ROWIDs

2011-03-04 Thread Enrico Thierbach
On 04.03.2011, at 22:21, Drake Wilson wrote: > Quoth Enrico Thierbach , on 2011-03-04 22:11:07 +0100: >> If I insert a record into a table with a primary key column id, >> Sqlite assigns a ROWID as outlined here >> http://www.sqlite.org/autoinc.html. However, I would like to

[sqlite] more OSX locking

2011-03-04 Thread Dave Dyer
I've tracked down the difference in behavior (between former sqlite and modern sqlite) to this #if which disappeared in the current version of sqlite. aMap[] = { { "hfs", }, { "ufs", }, { "afpfs", }, #ifdef SQLITE_ENABLE_AFP_LOCKING_SMB { "smbfs", }, #else {

Re: [sqlite] Adjusting strategy for ROWIDs

2011-03-04 Thread Simon Slavin
On 4 Mar 2011, at 9:55pm, Black, Michael (IS) wrote: > SQlite's random() is a pseudo-random (as are most all) so there is no > collision until you get the same value back at which point it just repeats > the whole sequence again. Are you sure about that ? It's very difficult to generate

[sqlite] Passing key as string in system.data.sqlite

2011-03-04 Thread Jean-Christophe Deschamps
Hi Dear list, I'm looking into system.data.sqlite and I've been asking myself questions about the most portable encoding of a text passphrase to sqlite_[re]key. It seems to me that the only portable way is to pass an UTF-8 string since it's the only encoding invariant wrt byte order and

Re: [sqlite] Adjusting strategy for ROWIDs

2011-03-04 Thread Drake Wilson
Quoth "Black, Michael (IS)" , on 2011-03-04 21:55:01 +: > SQlite's random() is a pseudo-random (as are most all) so there is > no collision until you get the same value back at which point it > just repeats the whole sequence again. Yes, it's a PRNG, but even if the

Re: [sqlite] Adjusting strategy for ROWIDs

2011-03-04 Thread Black, Michael (IS)
SQlite's random() is a pseudo-random (as are most all) so there is no collision until you get the same value back at which point it just repeats the whole sequence again. So the following example should work fine for him. When it collides you've cycled through the complete range of SQlite's

[sqlite] Prescott Iris Soc

2011-03-04 Thread Gerry Snyder
-- Sent from my mobile device ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Adjusting strategy for ROWIDs

2011-03-04 Thread Drake Wilson
Quoth Enrico Thierbach , on 2011-03-04 22:11:07 +0100: > If I insert a record into a table with a primary key column id, > Sqlite assigns a ROWID as outlined here > http://www.sqlite.org/autoinc.html. However, I would like to assign > a totally random rowid. Why do you want to

[sqlite] Adjusting strategy for ROWIDs

2011-03-04 Thread Enrico Thierbach
Hi everyone, I just stumbled about a problem with sqlite that I am not able to solve. I hope to find the most experienced sqlite users here, maybe you know of a solution :) If I insert a record into a table with a primary key column id, Sqlite assigns a ROWID as outlined here

Re: [sqlite] Using indexed fields in a table.

2011-03-04 Thread Simon Slavin
On 4 Mar 2011, at 2:59pm, J Trahair wrote: > You have a table called AllMusic containing columns called Composer, > NameOfPiece, YearComposed, etc. > > SELECT * FROM AllMusic_tbl WHERE Composer = 'Bach' ORDER BY YearComposed > > I thought the select would be quicker if the AllMusic table had

[sqlite] Using indexed fields in a table.

2011-03-04 Thread J Trahair
Hi I understand about Primary keys and Unique keys attributed to their own field. Is there a need to have other fields indexed, for faster searching? Eg. a table containing your favourite music. Say you have 9 Beethoven symphonies (one row in the table for each), 14 Bach partitas and 100 Haydn

Re: [sqlite] Help with a query

2011-03-04 Thread Marco Bambini
Thanks a lot Simon and Robert. -- Marco Bambini http://www.sqlabs.com On Mar 4, 2011, at 11:50 AM, Robert Hairgrove wrote: > On Fri, 2011-03-04 at 11:10 +0100, Marco Bambini wrote: >> Hello, >> I have a table defined as: >> CREATE TABLE MKProperties (id INTEGER PRIMARY KEY AUTOINCREMENT,

Re: [sqlite] Help with a query

2011-03-04 Thread Robert Hairgrove
On Fri, 2011-03-04 at 11:10 +0100, Marco Bambini wrote: > Hello, > I have a table defined as: > CREATE TABLE MKProperties (id INTEGER PRIMARY KEY AUTOINCREMENT, obj_id > INTEGER, prop_key TEXT, prop_value TEXT, UNIQUE(obj_id, prop_key)) > > In that table there some rows like: > obj_id

Re: [sqlite] Help with a query

2011-03-04 Thread Simon Davies
On 4 March 2011 10:10, Marco Bambini wrote: > Hello, > I have a table defined as: > CREATE TABLE MKProperties (id INTEGER PRIMARY KEY AUTOINCREMENT, obj_id > INTEGER, prop_key TEXT, prop_value TEXT, UNIQUE(obj_id, prop_key)) > > In that table there some rows like: > obj_id  

Re: [sqlite] Bug: rtree2 tests fail due to incorrect format string in rtree.c

2011-03-04 Thread David Gilbert
On Wed, Mar 02, 2011 at sometime, Jay A. Kreibich wrote: > On Tue, Mar 01, 2011 at 03:21:58PM +, David Gilbert scratched on the wall: > > for(jj=0; jj >sqlite3_snprintf(512-nCell,[nCell]," > > %f",(double)cell.aCoord[jj].f); > > > > That's against 3.7.4 but

[sqlite] Help with a query

2011-03-04 Thread Marco Bambini
Hello, I have a table defined as: CREATE TABLE MKProperties (id INTEGER PRIMARY KEY AUTOINCREMENT, obj_id INTEGER, prop_key TEXT, prop_value TEXT, UNIQUE(obj_id, prop_key)) In that table there some rows like: obj_id prop_keyprop_value 1 PARENTID0 1 RESOURCE_ORDER 0