00:11.05 | *** join/#storm fcorrea (~fcorrea@189-54-100-52-nd.cpe.vivax.com.br) |
00:11.11 | *** join/#storm hamush (~hamush@184-219-59-194.pools.spcsdns.net) |
02:26.26 | *** join/#storm m4v (~znc@unaffiliated/m4v) |
02:39.56 | *** join/#storm jamesh_ (~james@canonical/launchpad/jamesh) |
04:22.35 | *** join/#storm jcsackett (~jcsackett@cpe-098-122-187-054.nc.res.rr.com) |
05:03.23 | *** join/#storm m4v (~znc@unaffiliated/m4v) |
07:42.06 | *** join/#storm stub (~stub@canonical/launchpad/stub) |
08:12.51 | *** join/#storm wallyworld (~quassel@27-33-46-253.static.tpgi.com.au) |
08:40.43 | *** join/#storm zmijunkie (~sascha@business-188-111-082-104.static.arcor-ip.net) |
09:02.09 | *** join/#storm danilos (~danilo@static-213-198-236-193.adsl.eunet.rs) |
09:02.09 | *** join/#storm danilos (~danilo@canonical/launchpad/danilos) |
09:06.11 | *** join/#storm bigjools (~quassel@82-71-93-254.dsl.in-addr.zen.co.uk) |
09:06.11 | *** join/#storm bigjools (~quassel@canonical/launchpad/bigjools) |
10:59.28 | *** join/#storm danilo_ (~danilo@cable-89-216-142-130.dynamic.sbb.rs) |
11:01.40 | *** join/#storm danilos (~danilo@canonical/launchpad/danilos) |
11:25.22 | *** join/#storm niemeyer (~niemeyer@189-10-175-46.pltce701.dsl.brasiltelecom.net.br) |
12:05.06 | *** join/#storm fcorrea (~fcorrea@187.3.31.9) |
12:14.39 | *** join/#storm stub (~stub@ppp-58-8-15-106.revip2.asianet.co.th) |
12:14.39 | *** join/#storm stub (~stub@canonical/launchpad/stub) |
12:50.15 | *** join/#storm jamesh_ (~james@canonical/launchpad/jamesh) |
13:05.44 | *** join/#storm jcsackett (~jcsackett@cpe-098-122-181-157.nc.res.rr.com) |
13:57.35 | *** join/#storm shaunm (~shaunm@74.83.18.167) |
14:27.49 | *** join/#storm gary_poster (~anonymous@199.72.57.72) |
14:29.40 | *** join/#storm keppla (~keppla@i577B264A.versanet.de) |
14:57.43 | *** join/#storm gary_poster (~anonymous@199.72.57.72) |
15:22.08 | *** part/#storm jcsackett (~jcsackett@cpe-098-122-181-157.nc.res.rr.com) |
16:32.53 | *** join/#storm jamesh_ (~james@canonical/launchpad/jamesh) |
17:17.39 | *** join/#storm keppla (~keppla@i577B264A.versanet.de) |
17:31.16 | *** join/#storm gary_poster (~anonymous@71.16.235.2) |
20:19.11 | *** join/#storm glogiotatidis (~seadog@z039179.its-s.tudelft.nl) |
20:19.13 | glogiotatidis | hello |
20:20.47 | glogiotatidis | I have an issue with storm and sqlite. I'm trying to do an store.execute("PRAGMA foreign_keys = ON;") and although I get no error the command does nothing |
20:21.08 | glogiotatidis | when using from sqlite3 program of course it works. Any ideas on what I'm doing wrong? |
20:26.31 | marienz | glogiotatidis: "This pragma is a no-op within a transaction" |
20:26.59 | glogiotatidis | marienz, aha and how can I do it outside a transaction? |
20:27.56 | marienz | that is a good question |
20:27.56 | marienz | sec |
20:28.07 | glogiotatidis | ;) thnx! |
20:30.04 | marienz | what would work and *might* be the most sensible approach is to subclass storm.databases.sqlite.SQLITE and extend raw_connect to set it the same way it's currently setting PRAGMA synchronous |
20:31.54 | glogiotatidis | marienz, aha I get it. Sounds a bit like a hack tough but it looks like something that will work |
20:32.05 | glogiotatidis | marienz, thnx for your time, I will try it right away |
20:32.27 | marienz | if you look at SQLiteConnection.raw_execute you'll see that storm is always inside a transaction (it BEGINs a transaction for any call to raw_execute other than its internal commit/rollback calls) |
20:33.22 | bob2 | eep, i never noticed that was off by default |
20:33.45 | glogiotatidis | bob2, yes it's off due to compatibility reasons |
20:33.52 | marienz | I guess you could abuse the _end kwarg to raw_execute, or grab the underlying _raw_connection (dbapi connection) and use that directly, but those both seem messier to me than extending SQLite.raw_connect (which has a chance to initialize the dbapi connection before storm's connection object gets constructed, which is really what you want here imho) |
20:34.32 | marienz | bob2: it's off because sqlite only parsed but had no support for enforcing foreign keys for a long while, so it might break apps that set forein keys but were lax about following them |
20:34.47 | bob2 | fair enough |
20:35.10 | glogiotatidis | aha ic. Stupid question maybe but if I subclass SQLite() can I instruct storm to use my object instead of the default object ? |
20:35.11 | marienz | (support was added in 3.6.19 released 2009 Oct 14) |
20:35.29 | marienz | glogiotatidis: that I haven't thought about yet |
20:35.59 | glogiotatidis | :/ |
20:36.57 | marienz | glogiotatidis: storm.database.register_scheme looks promising |
20:38.16 | glogiotatidis | marienz, so I can create a new dbscheme e.g. sqliteforeignkeys and point to the new class? |
20:38.24 | marienz | nods |
20:39.13 | marienz | or you can register the 'sqlite' scheme, which ends up taking precedence over the standard implementation, and only actually turn on foreign keys if the right option is passed in the uri |
20:39.18 | marienz | not sure which I'd prefer |
20:39.39 | marienz | that is: do the exact same thing they do for the synchronous pragma |
20:39.52 | glogiotatidis | yap I get it |
20:40.15 | glogiotatidis | I will play around a bit and post updates here |
20:43.17 | bob2 | would that be worth patching in to storm's sqlite module? |
20:48.51 | *** join/#storm gary_poster (~anonymous@199.72.57.72) |
20:59.16 | *** join/#storm infobot (~infobot@rikers.org) |
20:59.16 | *** topic/#storm is The Storm Python ORM - http://storm.canonical.com/ - 0.18 released! || Review branches: https://code.launchpad.net/storm/+activereviews || IRC logs: http://ibot.rikers.org/#storm/ || API documentation: http://people.canonical.com/~jkakar/storm/ |
21:00.01 | marienz | glad to hear it |
21:00.07 | marienz | bob2: I was about to suggest that :) |
21:00.27 | marienz | glogiotatidis: perhaps patch this into storm proper and file a bug? :) |
21:01.00 | glogiotatidis | http://pastebin.com/b2Ab4Bz3 for anyone interested |
21:01.21 | glogiotatidis | marienz, yes that is something I will do asap |
21:01.27 | glogiotatidis | thnx again for your time |
21:02.27 | marienz | glogiotatidis: instead of overriding raw_connect I'd extend it (def raw_connect(self): raw_connection = SQLite.raw_connect(self); raw_connection.execute('PRAGMA foreign_keys = ON'); return raw_connection) |
21:02.50 | marienz | glogiotatidis: this also lets you omit that nested try/except ImportError block, as you no longer need to use the dbapi module yourself :) |
21:03.31 | glogiotatidis | aha nice suggestion |
21:09.06 | *** join/#storm wallyworld (~quassel@27-33-46-253.static.tpgi.com.au) |
21:22.18 | glogiotatidis | see bug report with included patch https://bugs.launchpad.net/storm/+bug/676702 |
21:22.19 | _mup_ | Bug #676702: Foreign Keys support for SQLite <sqlite> <Storm:New> <https://launchpad.net/bugs/676702> |
21:22.48 | glogiotatidis | marienz, thanks again for your time. going back to do what I was originally supposed to do ;) bb |
21:23.14 | marienz | yes, that's what I had in mind patch-wise :) thanks! |
21:24.05 | marienz | (I guess it'd need a test before it could get merged though) |
21:36.08 | *** join/#storm fcorrea (~fcorrea@189-54-100-52-nd.cpe.vivax.com.br) |
21:45.29 | *** join/#storm keppla (~keppla@i577B264A.versanet.de) |
22:02.46 | *** join/#storm glogiotatidis (~seadog@b81161.upc-b.chello.nl) |
22:48.57 | *** join/#storm jamesh_ (~james@canonical/launchpad/jamesh) |