sqlobject-discuss Mailing List for SQLObject (Page 372)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
2003 |
Jan
|
Feb
(2) |
Mar
(43) |
Apr
(204) |
May
(208) |
Jun
(102) |
Jul
(113) |
Aug
(63) |
Sep
(88) |
Oct
(85) |
Nov
(95) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(38) |
Feb
(93) |
Mar
(125) |
Apr
(89) |
May
(66) |
Jun
(65) |
Jul
(53) |
Aug
(65) |
Sep
(79) |
Oct
(60) |
Nov
(171) |
Dec
(176) |
2005 |
Jan
(264) |
Feb
(260) |
Mar
(145) |
Apr
(153) |
May
(192) |
Jun
(166) |
Jul
(265) |
Aug
(340) |
Sep
(300) |
Oct
(469) |
Nov
(316) |
Dec
(235) |
2006 |
Jan
(236) |
Feb
(156) |
Mar
(229) |
Apr
(221) |
May
(257) |
Jun
(161) |
Jul
(97) |
Aug
(169) |
Sep
(159) |
Oct
(400) |
Nov
(136) |
Dec
(134) |
2007 |
Jan
(152) |
Feb
(101) |
Mar
(115) |
Apr
(120) |
May
(129) |
Jun
(82) |
Jul
(118) |
Aug
(82) |
Sep
(30) |
Oct
(101) |
Nov
(137) |
Dec
(53) |
2008 |
Jan
(83) |
Feb
(139) |
Mar
(55) |
Apr
(69) |
May
(82) |
Jun
(31) |
Jul
(66) |
Aug
(30) |
Sep
(21) |
Oct
(37) |
Nov
(41) |
Dec
(65) |
2009 |
Jan
(69) |
Feb
(46) |
Mar
(22) |
Apr
(20) |
May
(39) |
Jun
(30) |
Jul
(36) |
Aug
(58) |
Sep
(38) |
Oct
(20) |
Nov
(10) |
Dec
(11) |
2010 |
Jan
(24) |
Feb
(63) |
Mar
(22) |
Apr
(72) |
May
(8) |
Jun
(13) |
Jul
(35) |
Aug
(23) |
Sep
(12) |
Oct
(26) |
Nov
(11) |
Dec
(30) |
2011 |
Jan
(15) |
Feb
(44) |
Mar
(36) |
Apr
(26) |
May
(27) |
Jun
(10) |
Jul
(28) |
Aug
(12) |
Sep
|
Oct
|
Nov
(17) |
Dec
(16) |
2012 |
Jan
(12) |
Feb
(31) |
Mar
(23) |
Apr
(14) |
May
(10) |
Jun
(26) |
Jul
|
Aug
(2) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
(6) |
2013 |
Jan
(4) |
Feb
(5) |
Mar
|
Apr
(4) |
May
(13) |
Jun
(7) |
Jul
(5) |
Aug
(15) |
Sep
(25) |
Oct
(18) |
Nov
(7) |
Dec
(3) |
2014 |
Jan
(1) |
Feb
(5) |
Mar
|
Apr
(3) |
May
(3) |
Jun
(2) |
Jul
(4) |
Aug
(5) |
Sep
|
Oct
(11) |
Nov
|
Dec
(62) |
2015 |
Jan
(8) |
Feb
(3) |
Mar
(15) |
Apr
|
May
|
Jun
(6) |
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
(19) |
2016 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(4) |
May
(3) |
Jun
(7) |
Jul
(14) |
Aug
(13) |
Sep
(6) |
Oct
(2) |
Nov
(3) |
Dec
|
2017 |
Jan
(6) |
Feb
(14) |
Mar
(2) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(3) |
Dec
|
2018 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
(44) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2021 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2025 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ian B. <ia...@co...> - 2004-09-20 01:25:25
|
paul kölle wrote: > paul kölle wrote: > > just for the record: > >> class CaCert(CertItem): >> SignedCaCerts = MultipleJoin('SubCaCert') >> ... >> >> class SubCaCert(CertItem): >> Ca = ForeignKey('CaCert') >> ... > > That's apparently wrong. In order to work such the name of the column > *has* to be the same as the referenced object (case insensitive?). While > the documentation gives a perfectly valid example ( person = > ForeignKey('Person')) it was not clear to me that those strings have to > be equal. The documentation notes the correspondence of the 'Person' > string with another class in the db nothing more. Maybe it's just me > knowing almost nothing about db/sql/whatever ... ;) You did encounter a bug. There's already a bug reported that is, I think, related to this -- basically an issue with the automatic naming with MultipleJoins. When I started using attributes instead of giving the names in the MultipleJoin constructor, I didn't convert everything over properly. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
From: Hendrik M. <he...@ma...> - 2004-09-19 15:07:35
|
> Author.createTable(ifNotExists=True) IMO, it would still be very handy to be able to have SQLObject check if a table exists. In fact, I think it would be very cool if SQLObject provided a method that compares an existing database table scheme to the scheme defined in an SQLObject class and returns True if they match. - Hendrik -- http://www.mans.de |
From: <pa...@su...> - 2004-09-19 13:43:29
|
Markus Jais wrote: > hello > > what is the best way in SQLObject to check if > a table already exists. > > lets say I have a table of authors and a > class Author. > > for creating the table I would call > Author.createTable() > > now I want to check everytime I start my programm > if the table already exists and if not it should > be created. Author.createTable(ifNotExists=True) hth Paul |
From: Markus J. <mar...@ya...> - 2004-09-19 09:38:45
|
hello what is the best way in SQLObject to check if a table already exists. lets say I have a table of authors and a class Author. for creating the table I would call Author.createTable() now I want to check everytime I start my programm if the table already exists and if not it should be created. is there a way to this ? I could't find anything in the documentation. thanks regards Markus ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de |
From: <pa...@su...> - 2004-09-18 19:33:39
|
paul k=F6lle wrote: just for the record: > class CaCert(CertItem): > SignedCaCerts =3D MultipleJoin('SubCaCert') > ... >=20 > class SubCaCert(CertItem): > Ca =3D ForeignKey('CaCert') > ... That's apparently wrong. In order to work such the name of the column=20 *has* to be the same as the referenced object (case insensitive?). While=20 the documentation gives a perfectly valid example ( person =3D=20 ForeignKey('Person')) it was not clear to me that those strings have to=20 be equal. The documentation notes the correspondence of the 'Person'=20 string with another class in the db nothing more. Maybe it's just me=20 knowing almost nothing about db/sql/whatever ... ;) :P |
From: <pa...@su...> - 2004-09-17 08:02:37
|
Hi folks, I'm stuck ATM wrt sqlobject and MultipleJoin. My classes: class CaCert(CertItem): SignedCaCerts = MultipleJoin('SubCaCert') ... class SubCaCert(CertItem): Ca = ForeignKey('CaCert') ... class EmailSubCa(SubCaCert): SignedCerts = MultipleJoin('EmailCert') _table = "sub_ca_cert" ... ----test test test----- rootca = CaCert.new(**rootca_params) ... emailca_params['CA'] = rootca emailca = EmailSubCa.new(**emailca_params) ... print rootca.Serial --> fine ;) print emailca.Serial --> fine ;) print emailca.Ca --> fine ;) (shows the CaCert instance) however, the backreference doesn't work: print rootca.SignedCaCerts Traceback (most recent call last): File "certs.py", line 408, in ? print rootca.SignedCaCerts File "<string>", line 1, in <lambda> File "/usr/lib/python2.2/site-packages/SQLObject/Join.py", line 104, in performJoin inst.id) File "/usr/lib/python2.2/site-packages/SQLObject/DBConnection.py", line 309, in _SO_selectJoin return self.queryAll("SELECT %s FROM %s WHERE %s = %s" % File "/usr/lib/python2.2/site-packages/SQLObject/DBConnection.py", line 139, in queryAll return self._runWithConnection(self._queryAll, s) File "/usr/lib/python2.2/site-packages/SQLObject/DBConnection.py", line 74, in _runWithConnection val = meth(conn, *args) File "/usr/lib/python2.2/site-packages/SQLObject/DBConnection.py", line 132, in _queryAll c.execute(s) File "/usr/lib/python2.2/site-packages/sqlite/main.py", line 243, in execute self.rs = self.con.db.execute(SQL) _sqlite.DatabaseError: no such column: ca_cert_id I'd expect that SignedCaCerts = MultipleJoin('SubCaCert') will create a "sub_ca_cert_id" column which in turn will be asked for and not "ca_cert_id". Any ideas? Thanks Paul |
From: David M. C. <da...@da...> - 2004-09-16 18:51:04
|
I might be trying to do something unsupported here, but I'm trying to build subselects with SQLBuilder.Select, and the queries mutate everytime they are used: >>> from SQLObject.SQLBuilder import Select >>> q = Select([Work.q.composerID], where=Work.q.id==5) >>> q SELECT work.composer_id FROM work WHERE (work.id = 5) >>> q SELECT work.composer_id, (work.id = 5) FROM work WHERE (work.id = 5) >>> q SELECT work.composer_id, (work.id = 5), (work.id = 5) FROM work WHERE (work.id = 5) This is with SQLObject 0.5. Dave Cook |
From: David M. C. <da...@da...> - 2004-09-15 03:18:29
|
On Tue, Sep 14, 2004 at 04:58:40PM -0700, David M. Cook wrote: > SELECT id FROM composer WHERE id IN (SELECT composer_id FROM work) Got it! r = Composer.select(IN(Composer.q.id, [SQLBuilder.Select(Work.q.composerID)])) In [87]: r.clause Out[87]: (composer.id IN (SELECT work.composer_id FROM work)) In [88]: r.count() Out[88]: 1420 Dave Cook |
From: David M. C. <da...@da...> - 2004-09-14 23:58:47
|
On Tue, Sep 14, 2004 at 10:49:37AM -0500, Ian Bicking wrote: > SELECT composer.all columns... FROM composer WHERE EXISTS (SELECT * FROM > work WHERE work.composer_id = composer.id); Using IN works as well, and is probably more universal (tested in postgres and sqlite) SELECT id FROM composer WHERE id IN (SELECT composer_id FROM work) Dave Cook |
From: Ian B. <ia...@co...> - 2004-09-14 15:49:37
|
David M. Cook wrote: > On Mon, Sep 13, 2004 at 06:01:09PM -0500, Ian Bicking wrote: > > >>I'm still a little confused about what distinct really means. No two >>rows can be indistinct if you are including the primary key in the >>select. So what does distinct accomplish? If you could select a subset > > > I think you're thinking of distinct in the sense of distinguishable. SQL > distinct returns a set of rows without duplications like the unix uniq > command. This is most useful when combined with count(distinct) (or the > sqlite workaround of using a subselect) when you need a count of distinct rows > in a set without the upfront cost of iterating through the whole set and > removing duplicates. For example, > > res = Composer.select(Work.q.composerID==Composer.q.id) OK, that makes more sense to me. It feels a little odd still; it would be most natural to do this with a query like: SELECT composer.all columns... FROM composer WHERE EXISTS (SELECT * FROM work WHERE work.composer_id = composer.id); Not all databases can do that, of course (particularly MySQL), but maybe it would be better to make the SELECT DISTINCT a workaround, and expose something like EXISTS. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
From: David M. C. <da...@da...> - 2004-09-14 06:57:25
|
On Mon, Sep 13, 2004 at 06:01:09PM -0500, Ian Bicking wrote: > I'm still a little confused about what distinct really means. No two > rows can be indistinct if you are including the primary key in the > select. So what does distinct accomplish? If you could select a subset I think you're thinking of distinct in the sense of distinguishable. SQL distinct returns a set of rows without duplications like the unix uniq command. This is most useful when combined with count(distinct) (or the sqlite workaround of using a subselect) when you need a count of distinct rows in a set without the upfront cost of iterating through the whole set and removing duplicates. For example, res = Composer.select(Work.q.composerID==Composer.q.id) returns a set of musical composers who have musical works in the database. It takes about 1.9 seconds on my machine to iterate through the resultset to get the actual count of distinct composers (the additional time to keep track of duplicates in a dict is not significant), which makes a big difference in the responsiveness (or lack thereof) of an interactive application. Dave Cook |
From: Andrew B. <and...@pu...> - 2004-09-14 00:53:27
|
On Mon, Sep 13, 2004 at 06:01:09PM -0500, Ian Bicking wrote: [...] > > I'm still a little confused about what distinct really means. No two > rows can be indistinct if you are including the primary key in the > select. So what does distinct accomplish? If you could select a subset > of the columns, then distinct would be useful. That could be useful, > probably as another method (e.g., MyClass.selectColumns(['firstName', > 'lastName'])); and there distinct would make sense. That would be good too. But distinct on all columns can still be useful if you're doing a join that might include the same row multiple times. -Andrew. |
From: Jeremy F. <je...@go...> - 2004-09-13 23:31:57
|
On Mon, 2004-09-13 at 18:01 -0500, Ian Bicking wrote: > I'm still a little confused about what distinct really means. No two > rows can be indistinct if you are including the primary key in the > select. So what does distinct accomplish? If you could select a subset > of the columns, then distinct would be useful. That could be useful, > probably as another method (e.g., MyClass.selectColumns(['firstName', > 'lastName'])); and there distinct would make sense. Well, one example is when joining. I had a join table with a particular pairing appearing multiple times, so when joining with it, I got the corresponding other tables multiple times. Also, I think I've observed MySQL returning a single row multiple times if you use a select statement containing an OR, and the row matches multiple predicates (but I may be mistaken). One deficiency in this patch is that there's no way to apply "distinct" to SQLObject joins (ones done via join columns). The other, as Marcin pointed out, that it doesn't apply to count(), but that seems to require larger structural changes. Also, this patch copies a little too much from the way reverse() works. Reverse is its own opposite, so it makes sense for select().reverse(). reverse() to be a no-op, but distinct() shouldn't toggle like this (updated patch attached). > The index patch looks good and makes sense to me. Great, thanks. We still need to create indexes on SQLObject's automatically created join tables. J |
From: Ian B. <ia...@co...> - 2004-09-13 23:16:08
|
Sorry I took so long to reply... Cyril Elkaim wrote: >> Anytime you commit a transaction, all the objects in the parent >> transaction are expired. Anytime you rollback all objects in the >> transaction are expired. This leaves out what I think you want: when >> you commit, you want all objects in *other* transactions to expire. >> > > What's happen actually is, when you commit a rollback a transaction, > it's _own_ cache is updated but _not_ the cache of its parent > connection. If I've read the code correctly the parent's cache is never > modified. A simple solution is, of course, to instanciate a Transaction > object at the start of the application and never use its 'standard' > parent connection. This is what we do and that works. Yes, when I look at the code I see that is true. I really meant to do it the right way, but I guess I never actually implemented it. > But if we want multiple users to make transactions it can't be used. The > problem is that the DBMS must maintains the same connection during a > transaction lifetime and the connection pool (that is now shared by all > our sessions because we have now one Transaction) in dbConnection cannot > guaranty that. Each Transaction is bound to a single database connection. That's most of what Transaction actually does, by kind of dynamically overriding query, queryAll, queryOne, and queryInsertID to use its own database connection instead of a connection from the pool. >> Another way of thinking of it that I'd like, but may be hard to >> implement, is a hierarchy of caches and connections. When a >> transaction is started, it has an empty cache. On a fetch, it checks >> its parent's cache, and if necessary adds to its parent's cache. When >> it modifies the object, it writes to its personal cache. When it >> rolls back, it deletes from its personal cache. When it commits, it >> writes its personal cache to its parent's cache. >> > > Seems to be a good concept and what i am beginning to work on. > > Just a question, why is it necessary to have a separate Transaction > class? Shouldn't be possible to have only the dbConnection and use it in > Transactionnal mode if we want for example? Well, there has to be some object that indicates which transaction the object is part of. This object is a connection currently, because that was most obvious since DB-API connections and transactions are bound to each other. It probably makes more sense for transactions and connections to be entirely separate. Another way of phrasing this might be an "editing context" (I think Modeling uses that term), which is a transaction (along with a cache and some other stuff). >> Though the objects being cached couldn't be SQLObject instances, >> they'd have to be record sets. Each transaction would still have its >> own instance. >> >> Would that fit what you are thinking of? A more expedient solution >> would be for transaction commits to expire objects in other >> transactions. Well, with a bit of care, but something like that. >> > > Yes. but we must now have a ConnectionSet, or something like that, and > create new dbConnection objects through this object, just an idea. Hmm... I'm not following. Though it may be because "connection" is being used too many times. What would ConnectionSet do? -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
From: Ian B. <ia...@co...> - 2004-09-13 23:06:06
|
Ian Sparks wrote: >> Does SQL-Object check for reserved words prior to the creation of a >> table? Not only those in the SQL standards, but those specific to >> a database. If so, this list should include words from all >> supported databases and cross check these. > > > We talked in the past about reserved words for databases. It was felt > that it would be better to use fieldname quoting. For instance you > can't have fieldname called SELECT in Firebird but you can have one > called 'select'. > > The problem with quoting is that it makes your fieldnames case > sensitive.. I think in most cases that would be mostly okay, since all the databases (AFAIK) do case-folding when you don't have quoting. So the change in semantics isn't too great, unless you were relying on the way SQLObject created tables, which is easier to control. I'm not 100% sure that's true. The test could be something like: CREATE TABLE test ( "Col" INT ); SELECT col FROM test SELECT "col" FROM test SELECT Col FROM test SELECT "Col" FROM test I would expect all but the last query to fail. But if the database were truly case-insensitive when there was no quoting, then everything but "col" should work. > But I don't know whether there was ever a concensus to actually > implement the quoting scheme (maybe not all DB's support it? I know > that Firebird, Postgresql and Oracle? do). I think they all do. That would be okay. I've loosened the restrictions on column names at the moment, so you can give a name like Col(dbName='"binary"') (in Postgres, for instance). That, however, is clearly a hack. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
From: Ian B. <ia...@co...> - 2004-09-13 23:01:10
|
Jeremy Fitzhardinge wrote: > On Fri, 2004-09-10 at 12:05 +0200, Marcin Wojdyr wrote: > >>Hi, >>I needed to answer question like this: >> >>-- How many people have at least one address with given zip >>SELECT COUNT(DISTINCT person.id) FROM person, address >>WHERE address.person_id = person.id AND address.zip = 50482 > > > I thought about this, but SQLite doesn't support the count(distinct ...) > syntax - you need to use a sub-select. So I punted and left it to stuff > which should be common to all databases. > > >>BTW, are there any plans to include distinct and index patches to SQLObject? > > > I haven't got any feedback about them. I guess I should stick them in > the SF patch manager... Sorry, I've been moving and haven't had good internet access. I'm still a little confused about what distinct really means. No two rows can be indistinct if you are including the primary key in the select. So what does distinct accomplish? If you could select a subset of the columns, then distinct would be useful. That could be useful, probably as another method (e.g., MyClass.selectColumns(['firstName', 'lastName'])); and there distinct would make sense. The index patch looks good and makes sense to me. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
From: Ian S. <Ian...@et...> - 2004-09-13 18:35:28
|
> Does SQL-Object check for reserved words prior to the creation of a =20 > table? Not only those in the SQL standards, but those specific to a =20 > database. If so, this list should include words from all supported =20 > databases and cross check these. We talked in the past about reserved words for databases. It was felt = that it would be better to use fieldname quoting. For instance you can't = have fieldname called SELECT in Firebird but you can have one called = 'select'. The problem with quoting is that it makes your fieldnames case = sensitive.. But I don't know whether there was ever a concensus to actually = implement the quoting scheme (maybe not all DB's support it? I know that = Firebird, Postgresql and Oracle? do). > -----Original Message----- > From: Brian Ray [mailto:br...@se...] > Sent: Monday, September 13, 2004 1:31 PM > To: sql object > Subject: [SQLObject] Reserved Words >=20 >=20 > Does SQL-Object check for reserved words prior to the creation of a =20 > table? Not only those in the SQL standards, but those specific to a =20 > database. If so, this list should include words from all supported =20 > databases and cross check these. >=20 > For example, I used the word 'leading' in my SQLite database. When =20 > switching the connection to MySQL, I got an error. The error was not =20 > all that helpful. However I see on the MySQL site that=20 > 'leading' is a =20 > reserved word. >=20 > Not a big deal, but thought I would let you know. >=20 > Thanks, Brian >=20 > SQLite keywords: http://www.sqlite.org/lang.html > MySQL: http://dev.mysql.com/doc/mysql/en/Reserved_words.html > Postgres: http://www.postgresql.org/docs/7/interactive/syntax.htm > firebird:http://www.ibexpert.info/firebird/documentation/=20 > Firebird%20Release%20Notes%20v1.5/New%20Reserved%20Words/18057.html >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your=20 > judgement on > who ports your project to Linux PPC the best. Sponsored by IBM.=20 > Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss >=20 |
From: Brian R. <br...@se...> - 2004-09-13 17:30:56
|
Does SQL-Object check for reserved words prior to the creation of a table? Not only those in the SQL standards, but those specific to a database. If so, this list should include words from all supported databases and cross check these. For example, I used the word 'leading' in my SQLite database. When switching the connection to MySQL, I got an error. The error was not all that helpful. However I see on the MySQL site that 'leading' is a reserved word. Not a big deal, but thought I would let you know. Thanks, Brian SQLite keywords: http://www.sqlite.org/lang.html MySQL: http://dev.mysql.com/doc/mysql/en/Reserved_words.html Postgres: http://www.postgresql.org/docs/7/interactive/syntax.htm firebird:http://www.ibexpert.info/firebird/documentation/ Firebird%20Release%20Notes%20v1.5/New%20Reserved%20Words/18057.html |
From: Hendrik M. <he...@ma...> - 2004-09-12 13:32:00
|
> Am I doing somthing wrong ? or is it those permissions acting up again ? I'm getting server errors, too. Looks like the repository is indeed broken, as the error message I'm getting says: "Berkeley DB error while opening environment for filesystem /var/lib/subversion/repository/db: DB_RUNRECOVERY: Fatal error, run database recovery" :-( - Hendrik -- http://blog.mans.de |
From: Jeremy F. <je...@go...> - 2004-09-10 22:02:45
|
On Fri, 2004-09-10 at 12:05 +0200, Marcin Wojdyr wrote: > Hi, > I needed to answer question like this: > > -- How many people have at least one address with given zip > SELECT COUNT(DISTINCT person.id) FROM person, address > WHERE address.person_id = person.id AND address.zip = 50482 I thought about this, but SQLite doesn't support the count(distinct ...) syntax - you need to use a sub-select. So I punted and left it to stuff which should be common to all databases. > BTW, are there any plans to include distinct and index patches to SQLObject? I haven't got any feedback about them. I guess I should stick them in the SF patch manager... J |
From: Marcin W. <wo...@un...> - 2004-09-10 10:01:27
|
Hi, I needed to answer question like this: -- How many people have at least one address with given zip SELECT COUNT(DISTINCT person.id) FROM person, address WHERE address.person_id =3D person.id AND address.zip =3D 50482 I modified main.py with applied distinct patch and it worked (with MySQL)= . Perhaps someone will find it useful or will find an error in it: def count(self): """ Counting elements of current select results """ - count =3D self.accumulate('COUNT(*)') + if self.ops.get('distinct'): + count =3D self.accumulate('COUNT(DISTINCT %s.%s)' % ( + self.sourceClass._table, + self.sourceClass._idName)) + else: + count =3D self.accumulate('COUNT(*)') if self.ops.get('start'): count -=3D self.ops['start'] BTW, are there any plans to include distinct and index patches to SQLObje= ct? BTW 2, in docs/News.txt it is written about cascade: The constraints are only implemented in the DBMS, not in SQLObject (i.e., they will not work in databases like MySQL and SQLite). but they seem to be implemented also in SQLObject and they work in MySQL. At least I hope so :-). I rely on it. Marcin --=20 Marcin Wojdyr | http://www.unipress.waw.pl/~wojdyr |
From: Martin <mar...@ge...> - 2004-09-09 08:13:58
|
> Aside from the obvious solution (ie the target machine > really *is* actively refusing the connection) I tend > to get this when the local firewall is blocking the > Subversion port (whatever number it is, I can't remember) > and svn sees this as a refusal by the remote machine. > > TJG Sounds like a likely explanation, I just got a new router a long with my new xDSL subscription. Thanks for the hint, I will have to fiddle with the router configuration. Martin |
From: Tim G. <tim...@vi...> - 2004-09-09 07:55:51
|
[Martin] | When I try to check-out the latest version, I get the error | message below. | | svn co svn://colorstudy.com/trunk/SQLObject/ | svn: Can't connect to host 'colorstudy.com': No connection | could be made because | the target machine actively refused it. | | Am I doing somthing wrong ? or is it those permissions acting | up again ? Aside from the obvious solution (ie the target machine really *is* actively refusing the connection) I tend to get this when the local firewall is blocking the Subversion port (whatever number it is, I can't remember) and svn sees this as a refusal by the remote machine. TJG ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ |
From: Martin <mar...@ge...> - 2004-09-09 07:40:57
|
When I try to check-out the latest version, I get the error message below. svn co svn://colorstudy.com/trunk/SQLObject/ svn: Can't connect to host 'colorstudy.com': No connection could be made because the target machine actively refused it. Am I doing somthing wrong ? or is it those permissions acting up again ? Martin |
From: Predrag P. <pe...@cg...> - 2004-09-03 21:09:55
|
when you try to insert new row in firebrid database using svn 210 you get: ------------------------------ File "sqlobject\firebird\firebirdconnection.py", line 59, in _runWithConnection val = meth(conn, *args) TypeError: _queryInsertID() takes exactly 7 arguments (6 given) ------------------------------ solution is to change 82 line from file "sqlobject\firebird\firebirdconnection.py" old bad line is: ------------------------------ def _queryInsertID(self, conn, table, idName, id, names, values): ------------------------------ new 82 line look like: ------------------------------ def _queryInsertID(self, conn, soInstance, id, names, values): ------------------------------ and svn repository don't work again, By |