[sqlalchemy] select .group_by

2010-04-27 Thread jo

Hi all,

In version 0.6 seems the group_by property does nothing...

(Pdb) sql = 
select([Verifica.c.codice,func.sum(Prestazione.c.importo).label('importo')])


(Pdb) print sql
SELECT verifica.codice, sum(prestazione.importo) AS importo
FROM verifica, prestazione

(Pdb) sql.group_by(Verifica.c.codice)
sqlalchemy.sql.expression.Select at 0x706b6d0; Select object

(Pdb) print sql
SELECT verifica.codice, sum(prestazione.importo) AS importo
FROM verifica, prestazione
(Pdb)  




I expected a query like this:

SELECT verifica.codice, sum(prestazione.importo) AS importo
FROM verifica, prestazione
GROUP BY verifica.codice

How it works in 0.6?

j


--
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] select .group_by

2010-04-27 Thread Lance Edgar

On 4/27/2010 5:22 AM, jo wrote:

Hi all,

In version 0.6 seems the group_by property does nothing...

(Pdb) sql =
select([Verifica.c.codice,func.sum(Prestazione.c.importo).label('importo')])


(Pdb) print sql
SELECT verifica.codice, sum(prestazione.importo) AS importo
FROM verifica, prestazione

(Pdb) sql.group_by(Verifica.c.codice)
sqlalchemy.sql.expression.Select at 0x706b6d0; Select object

(Pdb) print sql
SELECT verifica.codice, sum(prestazione.importo) AS importo
FROM verifica, prestazione
(Pdb)


I expected a query like this:

SELECT verifica.codice, sum(prestazione.importo) AS importo
FROM verifica, prestazione
GROUP BY verifica.codice

How it works in 0.6?


I believe the group_by() method will return a new selectable instead of 
changing your current one in-place.  So perhaps try:

sql_grouped = sql.group_by(Verifica.c.codice)

print sql_grouped

Lance

--
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] select .group_by

2010-04-27 Thread jo

Lance Edgar wrote:

On 4/27/2010 5:22 AM, jo wrote:

Hi all,

In version 0.6 seems the group_by property does nothing...

(Pdb) sql =
select([Verifica.c.codice,func.sum(Prestazione.c.importo).label('importo')]) 




(Pdb) print sql
SELECT verifica.codice, sum(prestazione.importo) AS importo
FROM verifica, prestazione

(Pdb) sql.group_by(Verifica.c.codice)
sqlalchemy.sql.expression.Select at 0x706b6d0; Select object

(Pdb) print sql
SELECT verifica.codice, sum(prestazione.importo) AS importo
FROM verifica, prestazione
(Pdb)


I expected a query like this:

SELECT verifica.codice, sum(prestazione.importo) AS importo
FROM verifica, prestazione
GROUP BY verifica.codice

How it works in 0.6?


I believe the group_by() method will return a new selectable instead 
of changing your current one in-place.  So perhaps try:


sql_grouped = sql.group_by(Verifica.c.codice)

print sql_grouped

Lance


You are right, Lance,
Thank you.
j

--
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



[sqlalchemy] database error.

2010-04-27 Thread dhanil anupurath
Am geting the error for using ORACLE database for MYSQL its fine.
the out put tracebackl is geting as.

Traceback (most recent call last):
  File /root/tg2env/bin/paster, line 7, in ?
sys.exit(
  File /root/tg2env/lib/python2.4/site-packages/PasteScript-1.7.3-
py2.4.egg/paste/script/command.py, line 84, in run
invoke(command, command_name, options, args[1:])
  File /root/tg2env/lib/python2.4/site-packages/PasteScript-1.7.3-
py2.4.egg/paste/script/command.py, line 123, in invoke
exit_code = runner.run(args)
  File /root/tg2env/lib/python2.4/site-packages/PasteScript-1.7.3-
py2.4.egg/paste/script/appinstall.py, line 68, in run
return super(AbstractInstallCommand, self).run(new_args)
  File /root/tg2env/lib/python2.4/site-packages/PasteScript-1.7.3-
py2.4.egg/paste/script/command.py, line 218, in run
result = self.command()
  File /root/tg2env/lib/python2.4/site-packages/PasteScript-1.7.3-
py2.4.egg/paste/script/appinstall.py, line 455, in command
installer.setup_config(
  File /root/tg2env/lib/python2.4/site-packages/PasteScript-1.7.3-
py2.4.egg/paste/script/appinstall.py, line 597, in setup_config
self._call_setup_app(
  File /root/tg2env/lib/python2.4/site-packages/PasteScript-1.7.3-
py2.4.egg/paste/script/appinstall.py, line 612, in _call_setup_app
func(command, conf, vars)
  File /svnee/trunk/src/convirt/web/convirt/convirt/websetup.py,
line 95, in setup_app
 
model.metadata.create_all(bind=config['pylons.app_globals'].sa_engine)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/schema.py, line 1796, in create_all
bind.create(self, checkfirst=checkfirst, tables=tables)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/engine/base.py, line 1129, in create
self._run_visitor(self.dialect.schemagenerator, entity,
connection=connection, **kwargs)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/engine/base.py, line 1154, in _run_visitor
conn = self.contextual_connect(close_with_result=False)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/engine/base.py, line 1229, in contextual_connect
return self.Connection(self, self.pool.connect(),
close_with_result=close_with_result, **kwargs)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 142, in connect
return _ConnectionFairy(self).checkout()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 304, in __init__
rec = self._connection_record = pool.get()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 161, in get
return self.do_get()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 639, in do_get
con = self.create_connection()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 122, in create_connection
return _ConnectionRecord(self)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 198, in __init__
self.connection = self.__connect()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 261, in __connect
connection = self.__pool._creator()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/engine/strategies.py, line 80, in connect
raise exc.DBAPIError.instance(None, None, e)
sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-12505: TNS:listener
does not currently know of SID given in connect descriptor
 None None

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



[sqlalchemy] oracle database error.

2010-04-27 Thread dhanil anupurath
I am using Sqlalchemy with Oracle backend in my project.
I am running into listener issues with the Oracle database.

Here are the steps that I am following:

1. My connection string.
  sqlalchemy.url=oracle://root::password@localhost:1521/orcdb

2. Environment variables .
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/
server
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_SID=orc10g

The following is the error that I get when my project tries to connect
to the Oracle db.

Traceback (most recent call last):

  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/schema.py, line 1796, in create_all
bind.create(self, checkfirst=checkfirst, tables=tables)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/engine/base.py, line 1129, in create
self._run_visitor(self.dialect.schemagenerator, entity,
connection=connection, **kwargs)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/engine/base.py, line 1154, in _run_visitor
conn = self.contextual_connect(close_with_result=False)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/engine/base.py, line 1229, in contextual_connect
return self.Connection(self, self.pool.connect(),
close_with_result=close_with_result, **kwargs)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 142, in connect
return _ConnectionFairy(self).checkout()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 304, in __init__
rec = self._connection_record = pool.get()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 161, in get
return self.do_get()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 639, in do_get
con = self.create_connection()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 122, in create_connection
return _ConnectionRecord(self)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 198, in __init__
self.connection = self.__connect()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 261, in __connect
connection = self.__pool._creator()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/engine/strategies.py, line 80, in connect
raise exc.DBAPIError.instance(None, None, e)
sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-12505: TNS:listener
does not currently know of SID given in connect descriptor
 None None

Please give suggestions.

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



[sqlalchemy] database error

2010-04-27 Thread dhanil anupurath
Am using the Oracle database to my project after setu is done i have
an error ...

The tracebacks are the following.

 File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/schema.py, line 1796, in create_all
bind.create(self, checkfirst=checkfirst, tables=tables)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/engine/base.py, line 1129, in create
self._run_visitor(self.dialect.schemagenerator, entity,
connection=connection, **kwargs)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/engine/base.py, line 1154, in _run_visitor
conn = self.contextual_connect(close_with_result=False)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/engine/base.py, line 1229, in contextual_connect
return self.Connection(self, self.pool.connect(),
close_with_result=close_with_result, **kwargs)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 142, in connect
return _ConnectionFairy(self).checkout()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 304, in __init__
rec = self._connection_record = pool.get()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 161, in get
return self.do_get()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 639, in do_get
con = self.create_connection()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 122, in create_connection
return _ConnectionRecord(self)
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 198, in __init__
self.connection = self.__connect()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/pool.py, line 261, in __connect
connection = self.__pool._creator()
  File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/engine/strategies.py, line 80, in connect
raise exc.DBAPIError.instance(None, None, e)
sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-12541: TNS:no
listener
 None None


My listner is working and the oracle database is connected

Please make good suggestions...

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] oracle database error.

2010-04-27 Thread Michael Bayer
dhanil anupurath wrote:
 I am using Sqlalchemy with Oracle backend in my project.
 I am running into listener issues with the Oracle database.

 Here are the steps that I am following:

 1. My connection string.
   sqlalchemy.url=oracle://root::password@localhost:1521/orcdb

 2. Environment variables .
 export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/
 server
 export PATH=$PATH:$ORACLE_HOME/bin
 export LD_LIBRARY_PATH=$ORACLE_HOME/lib
 export ORACLE_SID=orc10g

 The following is the error that I get when my project tries to connect
 to the Oracle db.

what does sqlplus give you ?This is likely a connection issue outside
the realm of SQLAlchemy.



 Traceback (most recent call last):

   File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
 py2.4.egg/sqlalchemy/schema.py, line 1796, in create_all
 bind.create(self, checkfirst=checkfirst, tables=tables)
   File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
 py2.4.egg/sqlalchemy/engine/base.py, line 1129, in create
 self._run_visitor(self.dialect.schemagenerator, entity,
 connection=connection, **kwargs)
   File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
 py2.4.egg/sqlalchemy/engine/base.py, line 1154, in _run_visitor
 conn = self.contextual_connect(close_with_result=False)
   File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
 py2.4.egg/sqlalchemy/engine/base.py, line 1229, in contextual_connect
 return self.Connection(self, self.pool.connect(),
 close_with_result=close_with_result, **kwargs)
   File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
 py2.4.egg/sqlalchemy/pool.py, line 142, in connect
 return _ConnectionFairy(self).checkout()
   File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
 py2.4.egg/sqlalchemy/pool.py, line 304, in __init__
 rec = self._connection_record = pool.get()
   File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
 py2.4.egg/sqlalchemy/pool.py, line 161, in get
 return self.do_get()
   File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
 py2.4.egg/sqlalchemy/pool.py, line 639, in do_get
 con = self.create_connection()
   File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
 py2.4.egg/sqlalchemy/pool.py, line 122, in create_connection
 return _ConnectionRecord(self)
   File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
 py2.4.egg/sqlalchemy/pool.py, line 198, in __init__
 self.connection = self.__connect()
   File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
 py2.4.egg/sqlalchemy/pool.py, line 261, in __connect
 connection = self.__pool._creator()
   File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
 py2.4.egg/sqlalchemy/engine/strategies.py, line 80, in connect
 raise exc.DBAPIError.instance(None, None, e)
 sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-12505: TNS:listener
 does not currently know of SID given in connect descriptor
  None None

 Please give suggestions.

 --
 You received this message because you are subscribed to the Google Groups
 sqlalchemy group.
 To post to this group, send email to sqlalch...@googlegroups.com.
 To unsubscribe from this group, send email to
 sqlalchemy+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/sqlalchemy?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] oracle database error.

2010-04-27 Thread dhanil anupurath

 SQLPLUS shows no error .

   I am able to connect to oracle database.

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] oracle database error.

2010-04-27 Thread Mariano Mara
Excerpts from dhanil anupurath's message of Tue Apr 27 07:22:45 -0300 2010:
 I am using Sqlalchemy with Oracle backend in my project.
 I am running into listener issues with the Oracle database.
 
 Here are the steps that I am following:
 
 1. My connection string.
   sqlalchemy.url=oracle://root::password@localhost:1521/orcdb
 
 2. Environment variables .
 export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/
 server
 export PATH=$PATH:$ORACLE_HOME/bin
 export LD_LIBRARY_PATH=$ORACLE_HOME/lib
 export ORACLE_SID=orc10g
 
 The following is the error that I get when my project tries to connect
 to the Oracle db.
 
 Traceback (most recent call last):
 
   File /root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
 py2.4.egg/sqlalchemy/engine/strategies.py, line 80, in connect
 raise exc.DBAPIError.instance(None, None, e)
 sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-12505: TNS:listener
 does not currently know of SID given in connect descriptor
  None None
 
 Please give suggestions.
 

AFAIK, Oracle XE SID by default is XE. Are you sure yours is
orc10g?

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] Storing Nested Lists

2010-04-27 Thread David Gardner
What database are you using? Postgres (and possibly others) support an 
array type.



On 04/25/2010 02:58 PM, greg wrote:

Hi All,

I'm new to sqlalchemy.  I've been reading the documentation and group
archives, but can't really find an answer to my question.  I suspect
it's a question of terminology, and that I don't really know the term
for what I'm looking for.
Can I map a nested list to one column, and have my nested list
returned to me intact?  A simple example is a list like:

['a','b','c', ['x','y','z',['m','n','o']]]

If anyone can point me in the right direction, I'd much appreciate it.
Thanks.

   



--
David Gardner
Pipeline Tools Programmer
Jim Henson Creature Shop
dgard...@creatureshop.com


--
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] Using SQLAlchemy to call stored procedures

2010-04-27 Thread David Gardner

Not sure about Oracle, but you should be able to do something like:

from sqlalchemy import func
session.query(Employee).filter(Employee.something.in_(func.retrieveList()).all()

Not sure about how to get the cursor object.



On 04/24/2010 10:38 AM, Mark wrote:

Hi everyone,

I'm currently trying to convert an existing Zope web application over
to Pylons.  My DBA created a whole bunch of stored procedures for the
web application that I would really love to use in my Pylons project.
Some of the stored procedures takes a cursor as an argument.  I'm
not very DB savvy, so please forgive me if whatever I mentioned above
doesn't sound right to you.

My Question is:

Supposing I have a stored procedure in my Oracle DB called
retrieveList, how do I call that stored procedure to return me a
result set in SQLAlchemy??

I know how to do it in the normal ORM way, like:

session.query(Employee).filter(Employee.something == something).all()

Could you please teach me what to import as well?  What are the
necessary modules required for calling stored procedures in
SQLAlchemy?

Thanks a million guys!

   



--
David Gardner
Pipeline Tools Programmer
Jim Henson Creature Shop
dgard...@creatureshop.com


--
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



[sqlalchemy] setting the transaction isolation_level?

2010-04-27 Thread gary clark
Hello,

I'm using SQLAlchemy with sqlite 3.6.23. I would like to know how you set the 
transaction isolation_level=immediate.

I think this will help with the deadlocks I was having. Just dont know how to 
implement this.

Thanks,
Garyc


-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] setting the transaction isolation_level?

2010-04-27 Thread Michael Bayer
gary clark wrote:
 Hello,

 I'm using SQLAlchemy with sqlite 3.6.23. I would like to know how you set
 the transaction isolation_level=immediate.

 I think this will help with the deadlocks I was having. Just dont know how
 to implement this.

I've added ticket 1784 to document this.

We support directly PRAGMA read_uncommitted=%d, via the possible values
READ UNCOMMITTED or SERIALIZABLE:

create_engine('sqlite://', isolation_level='READ UNCOMMITTED')

I don't understand what the Pysqlite docs are referring to when they come
up with three values, “DEFERRED”, “IMMEDIATE” or “EXCLUSIVE” - SQLite's
official documentation only describes two values for PRAGMA
read_uncommitted.   However to set pysqlite specific values, use a
PoolListener.

http://www.sqlalchemy.org/docs/reference/sqlalchemy/interfaces.html?highlight=poollistener#sqlalchemy.interfaces.PoolListener







 Thanks,
 Garyc


 --
 You received this message because you are subscribed to the Google Groups
 sqlalchemy group.
 To post to this group, send email to sqlalch...@googlegroups.com.
 To unsubscribe from this group, send email to
 sqlalchemy+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/sqlalchemy?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] setting the transaction isolation_level?

2010-04-27 Thread gary clark
Thanks Michael.

This is like trudging through knee high mud to find a needle.

oh boy. On I go.

Thanks,
Garyc

--- On Tue, 4/27/10, Michael Bayer mike...@zzzcomputing.com wrote:

 From: Michael Bayer mike...@zzzcomputing.com
 Subject: Re: [sqlalchemy] setting the transaction isolation_level?
 To: sqlalchemy@googlegroups.com
 Date: Tuesday, April 27, 2010, 3:30 PM
 gary clark wrote:
  Hello,
 
  I'm using SQLAlchemy with sqlite 3.6.23. I would like
 to know how you set
  the transaction isolation_level=immediate.
 
  I think this will help with the deadlocks I was
 having. Just dont know how
  to implement this.
 
 I've added ticket 1784 to document this.
 
 We support directly PRAGMA read_uncommitted=%d, via the
 possible values
 READ UNCOMMITTED or SERIALIZABLE:
 
 create_engine('sqlite://', isolation_level='READ
 UNCOMMITTED')
 
 I don't understand what the Pysqlite docs are referring to
 when they come
 up with three values, “DEFERRED”, “IMMEDIATE” or
 “EXCLUSIVE” - SQLite's
 official documentation only describes two values for
 PRAGMA
 read_uncommitted.   However to set pysqlite
 specific values, use a
 PoolListener.
 
 http://www.sqlalchemy.org/docs/reference/sqlalchemy/interfaces.html?highlight=poollistener#sqlalchemy.interfaces.PoolListener
 
 
 
 
 
 
 
  Thanks,
  Garyc
 
 
  --
  You received this message because you are subscribed
 to the Google Groups
  sqlalchemy group.
  To post to this group, send email to sqlalch...@googlegroups.com.
  To unsubscribe from this group, send email to
  sqlalchemy+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/sqlalchemy?hl=en.
 
 
 
 -- 
 You received this message because you are subscribed to the
 Google Groups sqlalchemy group.
 To post to this group, send email to sqlalch...@googlegroups.com.
 To unsubscribe from this group, send email to 
 sqlalchemy+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/sqlalchemy?hl=en.
 
 

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.