[04:02:27] [connected at Tue Jan 25 04:02:27 2005] [04:02:27] <> *** Looking up your hostname... [04:02:27] <> *** Checking ident [04:02:27] <> *** Found your hostname [04:02:58] <> *** No identd (auth) response [04:02:58] <> *** Your host is kornbluth.freenode.net[kornbluth.freenode.net/6667], running version dancer-ircd-1.0.35 [04:02:58] [I have joined #peak] [04:02:58] ** kornbluth.freenode.net set the topic to http://dirtsimple.org/2004/11/generic-functions-have-landed.html [05:00:01] ** vlado has joined us [05:17:31] ** [nicknam] has joined us [05:17:41] [nicknam] is now known as apoirier [09:02:44] ** rdmurray has joined us [09:53:38] ** [apoirie] has joined us [10:13:52] ** apoirier has left IRC (Read error: 110 (Connection timed out)) [12:36:53] ** debugger has joined us [12:37:26] hello [12:38:37] 'lo [12:39:02] I'm learning PEAK from your tut :) [12:39:05] thx! [12:39:12] You are welcome. [12:39:34] I'm stuck with a stupid problem that has notting to do with peak, but with sqlite [12:39:44] how can I create a autoincrement column? [12:40:01] from here: http://sqlite.org/lang_createtable.html [12:40:15] the syntax is: id INTEGER PRIMARY KEY AUTOINCREMENT [12:40:45] BUT it doesnt work, I have to swap the AUTOINCREMENT keyword to the position after INTEGER [12:40:53] like: id INTEGER AUTOINCREMENT PRIMARY KEY [12:41:15] BUT now, when I try to insert a value in the table, the id columns gets NULL!? [12:41:23] select max(id)+1 from column_name; ;) [12:41:27] any ideia why? [12:41:47] 'fraid not :( [12:42:16] I hacked my way around needing autoincrament in my own ap. [12:42:39] vlado: that means I have to hardcode that statement in every sql statement? [12:43:36] It does look like an sqlite problem rather than a peak problem, though. [12:43:57] autoincrement sucks [12:44:21] vlado: why? [12:44:25] rdmurray: yup, I istarted my "nagging", with "not peak" problem hehe [12:44:56] I would be grad it worked hehe [12:45:01] how could you get the newly created object back since the primary key is autoincrement ? [12:45:02] err s,grad,glad [12:45:56] look for the last_insert_rowid() expression at http://sqlite.org/lang_expr.html [12:46:02] vlado: by running a query after the insert? [12:46:59] humm, I hope PEAK can do that for me :) [12:47:20] (I didn't look at sqlite peak "driver" though) [12:48:36] how could you do that if you do not know the pk ? [12:48:46] ah [12:49:03] i didn't know about last_insert_rowid [12:49:31] ouch! [12:49:33] I got it! [12:49:44] humm I think... [12:50:12] it seems the id columns is not updated BUT the "hidden" column named "ROWID" is! hummmm :/ [12:52:52] ouch... the problem is the AUTOINCREMENT keyword... if I remove it it works! geee [12:54:34] bye [12:54:36] ** vlado has left IRC ("Leaving") [13:51:52] ** [apoirie] has left IRC ("Using KVIrc 3.0.1") [14:47:35] I need to have a "list" command that shows all rows from a specific DM, whats the best way of doing this? add a list method inside the DM? then what? what will I return? [15:07:14] i'll have to issue a sql query there and use preloadState for all returned data? [15:10:13] That's one way. [15:10:33] I sometimes use a method that just returns a list of ids. [15:11:43] But really the preloadstate trick is the more peakish way, I think. [15:12:13] but that way one has to issue several loads (and that equals several selects). [15:12:36] I mean, returning a lists of ids, and using that list. [15:13:02] "peakish way" hehehe [15:13:08] Right. That's why I said preloadwas probably better. [15:13:11] I'm looking for that way :) [15:14:04] ok. I thougt there would be other way of doing that. [15:14:14] The reason to use an id-only query would be if your objects were large and you wanted to avoid loading the unnecessarily. But if you are going to touch each object in the list, you might as well do one query and preload the objects. [15:14:48] Nope, that's basically what preload is _for_. [15:15:11] ok thx :) [15:19:28] you known if there is a way of saving only part of the object? say, I got one object from db, with several columns, now I change only one of those, and commit the transaction. by default my _save will save all object columns/fields, so the question is, is there a way of saving on the modified ones? or one is better off saving all of them? [15:20:06] err so the question is, is there a way of saving _only_ the modified ones? [15:20:08] What would you save by only saving the modified stuff? [15:20:19] gain [15:20:43] maybe I got a big column, something like that? [15:20:56] so, the general ideia is why bother? [15:20:59] I think it would be premature optimization. [15:21:30] After the ap is functional, if that issue turns out to be a big one performance wise, then you could deal with it. [15:21:32] I think that too, but that just striked me now :D [15:21:58] ok then :) [15:22:11] I have a feeling that PJE's new schema organization for this stuff, when it lands, will make that kind of optimization a lot easier. [15:22:48] where did you read about that? [15:24:09] Mailing list. [15:24:24] Also maybe on his blog, I forget. [15:24:31] It was a couple months ago. [15:26:16] ok [15:26:47] you known if preloadState will replace an existing object on the cache? [15:27:02] I believe that it does, but I haven't checked. [15:27:15] ok i'll check then. thx! [15:28:29] it does :D [15:33:04] why the source file have such a big number of empty lines between different classes? [15:34:17] I think PJE uses some sort of special editor or code composition facility. Not sure, though. [15:34:39] Something about classes starting at the "top of a page" or something. [15:35:51] hummm, pages with only 42 lines? heheh [16:49:20] oh, how can I get the inserted autoincrement when _new is only called after commitTransaction? [16:49:44] storage.EntityDM._new [19:03:59] ** gbay has left IRC ("It's not like I'm leaving or anything...") [19:05:52] ** rdmurray has left IRC ("User disconnected") [20:27:54] ** rdmurray has joined us [22:22:56] ** debugger has left IRC (Connection timed out) [23:25:14] ** rdmurray has left IRC ("User disconnected")