Re: [sqlalchemy] HOW TO HANDLE SPECIAL CHARACTERS WITH ENGINE.EXECUTE

2012-02-12 Thread Krishnakant Mane
On 11/02/12 21:10, Michael Bayer wrote: def execproc(procname, engine, queryParams=[]): function = getattr(func, procname) function_with_params = function(*queryParams) return engine.execute(function_with_params.execution_options(autocommit=True)) Hi Michael, I tryed this

Re: [sqlalchemy] HOW TO HANDLE SPECIAL CHARACTERS WITH ENGINE.EXECUTE

2012-02-12 Thread Krishnakant Mane
On 12/02/12 22:01, Michael Bayer wrote: On Feb 12, 2012, at 5:22 AM, Krishnakant Mane wrote: On 11/02/12 21:10, Michael Bayer wrote: def execproc(procname, engine, queryParams=[]): function = getattr(func, procname) function_with_params = function(*queryParams) return

Re: [sqlalchemy] HOW TO HANDLE SPECIAL CHARACTERS WITH ENGINE.EXECUTE

2012-02-12 Thread Krishnakant Mane
wrote: On Feb 12, 2012, at 5:22 AM, Krishnakant Mane wrote: On 11/02/12 21:10, Michael Bayer wrote: def execproc(procname, engine, queryParams=[]): function = getattr(func, procname) function_with_params = function(*queryParams) return engine.execute

Re: [sqlalchemy] HOW TO HANDLE SPECIAL CHARACTERS WITH ENGINE.EXECUTE

2012-02-12 Thread Krishnakant Mane
, UPDATE, or DELETE and return the results as a named result set.The result rows here are not quite the same thing as out parameters which are an Oracle concept but fortunately this is much easier to do than Oracle out parameters. On Feb 12, 2012, at 12:31 PM, Krishnakant Mane wrote: Hi

Re: [sqlalchemy] HOW TO HANDLE SPECIAL CHARACTERS WITH ENGINE.EXECUTE

2012-02-12 Thread Krishnakant Mane
the functions or any sql for that matter. You could also say conn = engine.connect().execution_options(autocommit=True). Ah, meaning the connection object is just a formal requirement is it? Happy hacking. Krishnakant. On Feb 12, 2012, at 2:18 PM, Krishnakant Mane wrote: Hi Michael, Excelent work

[sqlalchemy] HOW TO HANDLE SPECIAL CHARACTERS WITH ENGINE.EXECUTE

2012-02-11 Thread Krishnakant Mane
Hello all, I have an interesting problem for which I am sure some simple solution must be existing. I have made a Python function which I will paist below. Basically what the function does is that it takes 3 parameters, namely the name of a stored procedure, engine instance and a set of

Re: [sqlalchemy] HOW TO HANDLE SPECIAL CHARACTERS WITH ENGINE.EXECUTE

2012-02-11 Thread Krishnakant Mane
Thanks Michael, I will see if this works perfectly with postgresql. I had tryed func before but did not get any success. May be this time it will work. Happy hacking. Krishnakant. On 11/02/12 21:10, Michael Bayer wrote: On Feb 11, 2012, at 8:02 AM, Krishnakant Mane wrote: Hello all, I have

Re: [sqlalchemy] Re: How long should it take to load a data base into memory?

2011-12-18 Thread Krishnakant Mane
May be I am wrong, But I guess you have not used stored procedures? If speed and performance is important along with scalability, then forget database independence and use stored procedurs. I have built a small function called execProc() which I can send you off the list. It just makes use of

[sqlalchemy] is there a problem in $ and % in a query using engine.execute?

2011-11-21 Thread Krishnakant Mane
Hello all. I am trying to write some code which after creating tables and related views trys to create the stored procedures (plpgsql). code goes some thing like this engine.execute(create or replace function addRecord(f1 text, f2 t1.fieldname%type ) returns bit as $$ ... begin ... end; $$

[sqlalchemy] is None converted to null using engine.execute?

2011-10-24 Thread Krishnakant Mane
Hello all. I have come across an interesting problem with sqlalchemy. I am using 0.6.8 and plan to shift obviously to the .7 series. But what ever the version is, I find this is really very interesting. I have to execute stored procedures written in plpgsql (for postgresql 9.0). The problem

Re: [sqlalchemy] still unclear how to invoke stored procedures with sqlalchemy

2011-10-15 Thread Krishnakant Mane
On 12/09/11 03:09, Michael Bayer wrote: On Sep 11, 2011, at 3:43 PM, Krishnakant Mane wrote: On 12/09/11 00:56, Michael Bayer wrote: You use the func construct to invoke a function. This can be passed to an execute() method directly where it should embed itself into a SELECT: from

Re: [sqlalchemy] still unclear how to invoke stored procedures with sqlalchemy

2011-10-15 Thread Krishnakant Mane
Thanks michael, But my problem here is different. Let me give you the exact stored procedure that we have here for execution. create or replace function getGroupByCode(group_code groups.groupcode%type) returns setof groups as $$ declare res groups; begin for res in select * from groups

Re: [sqlalchemy] still unclear how to invoke stored procedures with sqlalchemy

2011-10-15 Thread Krishnakant Mane
On 15/10/11 22:17, Michael Bayer wrote: that sounds like an issue in the procedure itself, such as running it on the wrong database, or the wrong groups table otherwise. there could be many schemas/databases that contain a groups table. Get the procedure to work with psql first using

[sqlalchemy] can't find a way to index field with orm.

2011-10-14 Thread Krishnakant Mane
Hello all, I feel I am seriously missing some point here. suppose I am creating a class representing a table through orm. I will asume that it is using declarative syntax. I wish to know how do we index a field? that is to say, I need to have indexes on a few fields so that they are applied to

[sqlalchemy] still unclear how to invoke stored procedures with sqlalchemy

2011-09-11 Thread Krishnakant Mane
I think the subject line makes it pritty clear. I want to know how i can use the expression api to make calls to postgresql stored procedures written in plpgsql. For example how to pass input parameters and how to manipulate cursor objects etc. happy hacking. Krishnakant. -- You received this

Re: [sqlalchemy] still unclear how to invoke stored procedures with sqlalchemy

2011-09-11 Thread Krishnakant Mane
, %(param3)s), {'param1':1, 'param2':2, 'param3':3}) hope this helps ! On Sep 11, 2011, at 1:48 PM, Krishnakant Mane wrote: I think the subject line makes it pritty clear. I want to know how i can use the expression api to make calls to postgresql stored procedures written in plpgsql

[sqlalchemy] any tips on balancing between performance and ease of use?

2011-09-01 Thread Krishnakant Mane
hello all, I am thinking of programming a lot of stored procedures for my postgresql based application. I would like to know if using the expression API is a way that can give me the power of sqlalchemy's eas and comfort, at the same time make use of the performance bennifits I will get from

Re: [sqlalchemy] any tips on balancing between performance and ease of use?

2011-09-01 Thread Krishnakant Mane
Thanks a lot. On 01/09/11 19:16, Michael Bayer wrote: I have some interest in working out ways to integrate stored procedures with SQLAlchemy though at the moment the points of integration are very rudimental.You can invoke a stored procedure, get results, and also create a selectable

[sqlalchemy] Fwd: [Gnukhata-devel] not able to put in account name field

2011-08-07 Thread Krishnakant Mane
Hello all. This might be interesting. I don't know if we are doing some thing wrong. We use session.query on a table and for adding records we use the orm. But look at the forwarded email, I don't know what's wrong. happy hacking. Krishnakant. Original Message Subject:

Re: [sqlalchemy] Fwd: [Gnukhata-devel] not able to put in account name field

2011-08-07 Thread Krishnakant Mane
. and the constructor of the table instance takes all the parameter hence the way in which session.add is coded. Happy hacking. Krishnakant. On 07/08/11 21:11, Michael Bayer wrote: On Aug 7, 2011, at 8:19 AM, Krishnakant Mane wrote: Hello all. This might be interesting. I don't know if we are doing some thing

[sqlalchemy] how to get last record from a resultset

2011-07-20 Thread Krishnakant Mane
Hello all, Subject line says it all. Basically what I want to do is to get last record from a result set. I am dealing with a situation where given a date I need to know the last record pertaining to transaction on a given account. yes, it is an accounting/ book keeping software. So I

Re: [sqlalchemy] how to get last record from a resultset

2011-07-20 Thread Krishnakant Mane
. But again, I don't want the entire set of rows in the first place. I just want that particular row. Happy hacking. Krishnakant. On 20/07/11 19:20, Timuçin Kızılay wrote: I think, reversing the sort and getting the first record will do. 20-07-2011 16:32, Krishnakant Mane yazmış: Hello all

Re: [sqlalchemy] which documentation to read?

2011-07-17 Thread Krishnakant Mane
On 16/07/11 19:51, Michael Bayer wrote: On Jul 16, 2011, at 6:08 AM, Krishnakant Mane wrote: I am still not sure if all performance enhancements of 0.7 have been backported to 0.6.8. No performance enhancements have been backported to 0.6.8. Ok, So is the current 0.6 documentation uptodate

Re: [sqlalchemy] which is the current version for mission critical applications on production

2011-07-12 Thread Krishnakant Mane
On 12/07/11 20:34, Michael Bayer wrote: Hi Krishnakant - 0.7.1 is the current stable production release which is where the focus of development also lies. 0.6 is in maintenance releases at this point. In that case will I have to change my code if I want to shift from 0.6 to 0.7? I use

Re: [sqlalchemy] which is the current version for mission critical applications on production

2011-07-12 Thread Krishnakant Mane
On 12/07/11 23:36, Michael Bayer wrote: On Jul 12, 2011, at 1:57 PM, Krishnakant Mane wrote: On 12/07/11 20:34, Michael Bayer wrote: Hi Krishnakant - 0.7.1 is the current stable production release which is where the focus of development also lies. 0.6 is in maintenance releases

[sqlalchemy] which is the current version for mission critical applications on production

2011-07-09 Thread Krishnakant Mane
Hello all. I have a very quick and short question. which is the current production release of sqlalchemy. I mean this in terms of performance and reliability. let me narrow down the choices as per my knowledge. is it 0.6 or 0.7? And if 0.6 then which minor version? Happy hacking. Krishnakant.

[sqlalchemy] confused on avoiding sql injections using ORM

2011-07-04 Thread Krishnakant Mane
Hello all. I use Pylons 0.9.7 and sqlalchemy. I use the Object Relational Mapper with declarative syntax in a few of my modules. I was reading chapter 7 of the Pylons book and I understood that sql injections can be avoided using the expression api. But can this be also done using ORM? I tryed

Re: [sqlalchemy] Re: confused on avoiding sql injections using ORM

2011-07-04 Thread Krishnakant Mane
On 05/07/11 03:03, Malthe Borch wrote: Think about it this way: There's two kinds of strings when you're dealing with SQL: 1) SQL language, 2) your data input. Don't ever include (2) in (1) –– let the API do it. How does one do this with the orm? I am talking about things like session.add

[sqlalchemy] how to have indexed columns in table definition?

2011-04-24 Thread Krishnakant Mane
Hello all. The subject line says it all. I use declarative syntax in my tables so that I can define and map tables in a single step. Now I want to know how I can add index to a certain column. I understand when we say prymary key it is already indexed or even foreign kay key for that matter.

[sqlalchemy] can some one give me sample on using max with session.query?

2011-02-01 Thread Krishnakant Mane
hello. Can some one give me an example of the said query in the subject line? I have a need to get the max on the id for a given table. and I want to do it on a session.query(table_instance).max() I know that is a wrong way, so what is the right syntax? Happy hacking. Krishnakant. -- You

[sqlalchemy] Fwd: [Gnukhata-devel] Error installing gnukhata

2010-10-13 Thread Krishnakant Mane
Don't know why this might be happening on an Ubuntu 10.04 machine? Can some one help solve this? happy hacking. Krishnakant. Original Message Subject:[Gnukhata-devel] Error installing gnukhata Date: Wed, 13 Oct 2010 11:06:00 +0400 From: pooja bakshi

[sqlalchemy] Is ORM the right choice for large scale data manipulation?

2010-07-07 Thread Krishnakant Mane
Hello all, I will be interested to know if using ORM for a large scale data operation is the right approach when it comes to scalability. Has SQLAlchemy been put to test ever for a select query which involves getting thousands of records and specially when joins are involved? I have a

[sqlalchemy] SQLAlchemy gives QPool limit error, connection times out

2010-06-25 Thread Krishnakant Mane
Hello all, I am using sqlalchemy in an xml rpc based application. It is an API for accounting software. The error given belo is encountered inconsistently on the application and I can't figure out why. raise exc.TimeoutError(QueuePool limit of size %d overflow %d reached, connection timed

[sqlalchemy] sqlalchemy 0.5.8 or 0.6.0?

2010-05-30 Thread Krishnakant Mane
Hello, I am using pylons for my web application development. Currently pylons is in version 1.0 and 0.9.7 is also going stable. I want to know which is the correct version of sqlalchemy for both versions of Pylons. I know it might not make that much of a difference but there are some changes

Re: [sqlalchemy] sqlalchemy 0.5.8 or 0.6.0?

2010-05-30 Thread Krishnakant Mane
use of any deprecated features in SQLAlchemy. On May 30, 2010, at 12:02 PM, Krishnakant Mane wrote: Hello, I am using pylons for my web application development. Currently pylons is in version 1.0 and 0.9.7 is also going stable. I want to know which is the correct version of sqlalchemy

[sqlalchemy] does indexing on database tables have any affect on sqlalchemy mapped classes

2010-03-13 Thread Krishnakant Mane
Hello, This might be a very simple question to answer, but I am not finding any suitable benchmark tests so asking on the mailing list. I want to know if indexing on certain columns impacts the performance of sqlalchemy? for example I am using postgresql with python-psycopg2 and mapping all

[sqlalchemy] connection pooling question, is it possible

2010-03-11 Thread Krishnakant Mane
hello all, I am working on a free software for accounting and rural banking in India. We use Pylons for web application. Now, my question is in reference to the recent threads on this mailing list regarding sqlalchemy connections. I heard that after a certain amount of connections, the library

Re: [sqlalchemy] Re: unable to understand this error

2010-02-16 Thread Krishnakant Mane
On Tuesday 16 February 2010 07:01 PM, avdd wrote: Now the specific problem you see is that the ORM uses the declared ForeignKeys to determine how to join tables for a relation, but on your Detail table you have two foreign keys back to account and the ORM doesn't know which one to use.