The docs on Select's where() method say:
return a new select() construct with the given expression added to its WHERE
clause, joined to the existing clause via AND, if any.
But this doesn't seem to happen.
This is my code:
def posts_per_dow(self, start_date=None, end_date=None):
Yesterday I was working with some code that needed a select ... for
update concept to avoid a race condition.
Adding .with_lockmode('update') works a treat on InnoDB and Postgres,
but for sqlite I end up having to sneak in a if session.bind.name ==
'sqlite'; session.execute('begin immediate
-Original Message-
From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com]
On Behalf Of Luka Novsak
Sent: 27 April 2011 05:32
To: sqlalchemy
Subject: [sqlalchemy] Appending a where clause to a query
The docs on Select's where() method say:
return a new select()
I want to some updates before doing any insert. So I needed the
above.
Now the issue I am facing is that I need all these updates and the
current insert to be in a transaction. That is either all should be
successful or none.
How is that possible with a connection proxy (something like below)?
SQLite doesn't have support for SELECT..FOR UPDATE, and with_lockmode()
ultimately has no impact when using SQLite as nothing is rendered. SQLite's
concurrency model is based on a lock of the entire database file - hardly a row
lock - I wouldn't think such a strategy applies on that backend ?
Is this pysqlite issue about SELECT not starting a transaction related?
http://code.google.com/p/pysqlite/issues/detail?id=21
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To
The Query should return to you tuples that have names like row_num and
test_msg, which are linked to the anon names that it generates:
for row in myquery:
print row.row_num, row.test_msg
that is, the anon_x names do not matter. they are an artifact of how
the Query does its work and the
On Apr 27, 2011, at 10:58 AM, monster jacker wrote:
The Query should return to you tuples that have names like row_num and
test_msg, which are linked to the anon names that it generates:
for row in myquery:
print row.row_num, row.test_msg
that is, the anon_x names do
On Apr 27, 2011, at 10:58 AM, monster jacker wrote:
The Query should return to you tuples that have names like row_num and
test_msg, which are linked to the anon names that it generates:
for row in myquery:
print row.row_num, row.test_msg
that is, the anon_x names do
On Apr 27, 9:19 am, Michael Bayer mike...@zzzcomputing.com wrote:
SQLite doesn't have support for SELECT..FOR UPDATE, and with_lockmode()
ultimately has no impact when using SQLite as nothing is rendered.
IDK why sqlite doesn't support a way to elevate the lock on a select
in the middle of
On Apr 27, 2011, at 11:18 AM, Clay Gerrard wrote:
On Apr 27, 9:19 am, Michael Bayer mike...@zzzcomputing.com wrote:
SQLite doesn't have support for SELECT..FOR UPDATE, and with_lockmode()
ultimately has no impact when using SQLite as nothing is rendered.
IDK why sqlite doesn't
On Apr 27, 9:37 am, Daniel Holth dho...@gmail.com wrote:
Is this pysqlite issue about SELECT not starting a transaction
related?http://code.google.com/p/pysqlite/issues/detail?id=21
Hrmmm... well... that's interesting... it might be related, but maybe
not? I'm not setting the isolation
On Apr 25, 2011, at 9:10 PM, Andrey Petrov wrote:
One more thought:
Is there a sane way to hide a schema object within another schema object?
Specifically, I want to make a factory method (or maybe a class decorator)
which generates these Tag schemas onto specific tables. Something
this works (been working on getting this kind of thing into recipes/docs/books)
from sqlalchemy import Column, Integer, ForeignKey, String
from sqlalchemy.ext.declarative import declarative_base, declared_attr
from sqlalchemy.orm import relationship
Base = declarative_base()
class
On Apr 27, 10:41 am, Michael Bayer mike...@zzzcomputing.com wrote:
then yes, for your case this is exactly the pysqlite bug Daniel mentions:
http://code.google.com/p/pysqlite/issues/detail?id=21. Pysqlite doesn't open
the transaction until DML is encountered specifically to reduce file
Ah I was really close. This worked:
class TagMixin(object):
@declared_attr
def tags(cls):
class Tag(BaseModel):
__tablename__ = tag_%s % cls.__tablename__
id = Column(types.Integer, primary_key=True)
time_created = Column(types.DateTime,
Hi,
I am getting an error accessing MSSQL database using
sqlalchemy/pyodbc/TDS driver. After narrowing the case, looks like it
has something to do with datetime datatype. If I deldete the
created_at column (datetime) then the same code will work.
Any suggestion for further debugging? Thanks in
that error is generated by TDS/pyodbc and is not related to SQLAlchemy.
Here's your test case with pyodbc alone, the pyodbc or FreeTDS lists might have
further info:
import pyodbc
conn =
pyodbc.connect(DRIVER={FreeTDS};SERVER=myserver;DATABASE=mydatabase;PORT=1435;UID=MYUSER;PWD=MYPASS1)
I have a problem with oracle column names that are oracle reserved
words (http://download.oracle.com/docs/cd/B19306_01/em.102/b40103/
app_oracle_reserved_words.htm). I read through the archive and found:
19 matches
Mail list logo