Hi,
One easy/obvious improvement would be to delete all user's
"identifiers" and "groups" at once without iterating over them for
every user. Actually, iterating over the list of user_ids is not
necessary too I think.
session.query(Identifier).filter(Identifier.user_id.in_(user_ids)).delete()
se
sure, you'd use the "mock" executor as in the second example here:
http://www.sqlalchemy.org/trac/wiki/FAQ#HowcanIgettheCREATETABLEDROPTABLEoutputasastring
On Jun 1, 2011, at 8:01 PM, Randy Syring wrote:
> I'd like to be able to dump an MS SQL server's objects to text on the
> local file system
In the FAQ...sorry:
http://www.sqlalchemy.org/trac/wiki/FAQ#HowcanIgettheCREATETABLEDROPTABLEoutputasastring
On Jun 1, 8:01 pm, Randy Syring wrote:
> I'd like to be able to dump an MS SQL server's objects to text on the
> local file system. I have a working solution for views, stored
> procedur
I'd like to be able to dump an MS SQL server's objects to text on the
local file system. I have a working solution for views, stored
procedures, and functions, but tables are a different story. Can i
use SA's reflection and table creation abilities to write create table
DDL to a text file?
--
Y
On Jun 1, 2011, at 7:00 PM, Jon Nelson wrote:
> On Wed, Jun 1, 2011 at 4:47 PM, Michael Bayer
> wrote:
>> metadata.reflect() would close() the connection used for reflection as it
>> assumed it was passed an Engine, not a Connection, fixed in r926ee70b67ff.
>> Nothing to do with begin_neste
On Wed, Jun 1, 2011 at 6:00 PM, Jon Nelson wrote:
> On Wed, Jun 1, 2011 at 4:47 PM, Michael Bayer
> wrote:
>> metadata.reflect() would close() the connection used for reflection as it
>> assumed it was passed an Engine, not a Connection, fixed in r926ee70b67ff.
>> Nothing to do with begin_ne
On Wed, Jun 1, 2011 at 4:47 PM, Michael Bayer wrote:
> metadata.reflect() would close() the connection used for reflection as it
> assumed it was passed an Engine, not a Connection, fixed in r926ee70b67ff.
> Nothing to do with begin_nested() or anything like that.
Why did this work in 0.6.[1,
metadata.reflect() would close() the connection used for reflection as it
assumed it was passed an Engine, not a Connection, fixed in r926ee70b67ff.
Nothing to do with begin_nested() or anything like that.
On Jun 1, 2011, at 5:10 PM, Jon Nelson wrote:
> I've got a chunk of code that starte
I've got a chunk of code that started failed as soon as I started
testing with 0.7.
The failure is:
sqlalchemy.exc.StatementError: This Connection is closed '\nCREATE
TABLE bar (\n\ta TEXT NOT NULL\n)\n\n' None
I'll note that the logging indicates that the connection was returned
to the pool *un*
As discussed on IRC, for those reading the list, the difference here is between
SQLite's ability to embed native functions (and in turn Pysqlite's ability to
use Python functions in this way), and other databases that don't run as
embedded libraries. The functions need to be expressed as SQL
Hi,
I'm using SQLAlchemy 0.6.6 for a web application. At this point, the
app uses SQLite3 as the underlying database; I'm currently working on
abstracting this out to work with others (PostgreSQL, MySQL).
At a high level, the application receives CGI queries which are parsed
and sent to SQLAlche
Hi M,
Thanks very much for your help. Adding ".with_lockmode('update')" to my
session.query statement worked like a charm!
Now I just need to figure out how to catch exceptions that occur in the work
unit in the thread, but that's a topic for another list...
Cheers,
Demitri
--
You received t
Hello,
I want to introduce logging to my SA application, so the users with
elevated privileges can control what "normal" users change in the
database. The log should go to the database not to a file.
I have been thinking about a logger table like:
table action:
- column: datetime_of_action
On Jun 1, 2011, at 12:56 AM, thatsanicehatyouh...@mac.com wrote:
> Hi,
>
> I'm working on a script using SQLAlchemy against a PostgreSQL database and
> using Python's multiprocessing. The pattern is for each thread to:
>
> - start a transaction (session.begin())
> - retrieve the "next row in t
Hi,
I have three tables (user, identifiers, groups) with 'many to one' and
'many to many' relationships. My code for deleting a user works
correctly but I would like to have it run faster. What improvements do
you suggest ?
def delete_list(self, user_ids):
"""Delete a list of users b
15 matches
Mail list logo