MySQL function timediff might be appropriate:
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
-
ct, I have the query wrong and so want an exception.
.count() would seem to be your friend here, at least in case that a lot of
rows might be returned.
Is there something already available that meets this need?
Only if you can express that need as a query.
Charlie
--
Charlie Clark
Managin
e
unpredictable.
The MySQL vs PostgreSQL holy war is completely irrelevant to this issue
Indeed, but you started it! ;-)
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
--
You
recommend Postgres over MySQL but I don't see what
the choice of backend has to do with this problem, except how well
reflection works with Postgres. From a developer's perspective MySQL's
biggest problem, apart from MyASM, is that its behaviour can be
unpredictable.
Charlie
Also, SERIAL? You must be using a real database engine.
Well, er, yes. When it comes to modelling that's where you should start.
And Oracle is making progress with MySQL now that InnoDB with separate
files pro table and 5.6 even seems to have some kind of vacuuming built-in.
Charlie
--
Ch
Am 10.06.2013, 18:54 Uhr, schrieb Michael Bayer :
Page.__table__.update()
Duh! Just didn't see that.
or agnostic of declarative:
from sqlalchemy import inspect
pages = inspect(Page).local_table
pages.update()
That looks nicer to me, thanks.
Charlie
--
Charlie Clark
Managing Dir
te 'update'"
How should I be doing this instead?
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
--
You received this message because you are subscribed to the Google
so that I have access to .insert(),
.update() for my models?
Chrlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
--
You received this message because you are subscribed to the
written an interesting checker for Python 3
http://code.activestate.com/recipes/578528-type-checking-using-python-3x-annotations/
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-
ly dense and missing something obvious.
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
--
You received this message because you are subscribed to the Google Groups
"sqla
a
sub-class of groups.
Am I missing something big in the original question as to why this isn't a
reasonable solution?
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178
Am 06.06.2013, 23:36 Uhr, schrieb Michael Bayer :
On Jun 6, 2013, at 5:18 PM, Charlie Clark
wrote:
Am 06.06.2013, 20:21 Uhr, schrieb Andy :
IOW I have things and groups. The rel table is a many-to-many relation
between things and groups. A thing also may have a favorite group; if
normalise to Favourites with strict 1:1
with things and groups?
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
--
You received this message because you are subscribed to
th Python seems a weird way of striding through the
results but maybe that's just SQL.
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
--
You received this message b
functions. You can either try
wrapping the SELECT in correlated subquery as the example shows or simply
use HAVING rownum % 2 = 1 (I think this is best approach but I'm far from
an expert). Try the SQL directly in the DB to see which works.
Charlie
--
Charlie Clark
Managing Director
up.buildingCode =
restroom.buildingCode) AS rr
from user
join userGroup
on user.userGroupId = userGroup.userGroupId
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
--
You received t
avoid this with a join between your tables?
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
--
You received this message because you are subscribed to the Google Groups
&quo
e the
relationship explicit, note dump, truncate, alter, import is often the
only way to do this and enjoy the, er, show.
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
the database, SQLAlchemy gives you the flexibility to decide how you want
your queries processed.
With a persistent connection I wouldn't have thought it made much
difference where the servers are.
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
the mxODBC documentation which provides detailed
information for the most common backends and a unified Python interface to
them.
http://www.egenix.com/products/python/mxODBC/doc/
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 4021
8)
session.query(Descriptiontype).get(-2147483648)
session.query(Descriptiontype).get(-2147483648)
Each call to session.query() is creating a new query object, thus, a new
query will run on the DB.
Try:
q = session.query(Descriptiontype)
q.get(-24…)
Charlie
--
Charlie Clark
Managing Direc
r "table functions" like Postgres
http://www.postgresql.org/docs/9.1/static/tablefunc.html ie. a view on a
normalised table which transposes rows into columns, the dynamic nature of
which causes I problems for the ORM, I think.
Charlie
--
Charlie Clark
Managing Director
Clark Consulting &a
mmend
completely bypassing SQLa for this sort of thing? I found I was doing that
anyway because of the inability to map the results to any models.
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile
Hi,
I have created a stored procedure on a MySQL database to create a "pivot
table". To reduce network traffic the procedure generates some SQL and then
executes a statement. It has no return value. I have had trouble calling
the procedure from sqlachemy using the mysq-connector driver. From th
24 matches
Mail list logo