[sqlalchemy] Re: Dialect for Vertica db connectivity ?

2013-04-01 Thread James Casbon
I put a rework of the code posted by Bo into a package 
https://pypi.python.org/pypi/vertica-sqlalchemy/0.1

Selects, joins, table introspection works.   Let me know if you can use it.

Does anyone have an email for Bo so I can attribute him and check the 
license?

thanks,
James


On Saturday, 16 March 2013 22:44:56 UTC, Femi Anthony wrote:

 Jonathan, thanks a lot. I'll test it out using the postgresSQL dialect.

 Femi

 On Friday, March 15, 2013 4:06:33 PM UTC-4, Jonathan Vanasco wrote:

 @Femi - 

 I did a quick search online, but couldn't find any current ( since HP 
 acquisition ) documentation. 

 HOWEVER -- all of the old documentation and QAs that are still online 
 talk about Vertica reimplementing the PostgreSQL syntax and 
 functions.  That's in line with what I remembered earlier, where the 
 psql client was even their recommended command-line interface. 
 ( Also, it was invented/started by the same guy who started 
 PostgreSQL ) 

 It's possible that things have changed, but I would try treating it as 
 PostgreSQL.  Unless they did a HUGE 360 pivot, I think that should 
 work. 



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




[sqlalchemy] mysql + query.execute memory usage

2009-11-18 Thread James Casbon
Hi,

I'm using sqlalchemy to generate a query that returns lots of data.
The trouble is, when calling query.execute() instead of returning
the resultproxy straight away and allowing me to fetch data as I would
like, query.execute blocks and the memory usage grows to gigabytes
before getting killed for too much memory.  This looks to me like
execute is prefetching the entire result.

Is there any way to prevent query.execute loading the entire result?

Thanks,
James

--

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=.




[sqlalchemy] Re: mysql + query.execute memory usage

2009-11-18 Thread James Casbon


On Nov 18, 3:01 pm, Michael Bayer mike...@zzzcomputing.com wrote:
 On Nov 18, 2009, at 9:57 AM, James Casbon wrote:

  Hi,

  I'm using sqlalchemy to generate a query that returns lots of data.
  The trouble is, when calling query.execute() instead of returning
  the resultproxy straight away and allowing me to fetch data as I would
  like, query.execute blocks and the memory usage grows to gigabytes
  before getting killed for too much memory.  This looks to me like
  execute is prefetching the entire result.

  Is there any way to prevent query.execute loading the entire result?

 for ORM look into using yield_per() or applying limit()/offset().  without 
 the ORM no rows are buffered on the SQLA side.  Note however that MySQLdb is 
 likely prefetching the entire result set in any case (this is psycopg2s 
 behavior but haven't confirmed for MySQLdb).

Thanks, but not using the ORM.

Looks like you have to specify a server side cursor - see SSCursor in
http://mysql-python.sourceforge.net/MySQLdb.html

I don't recall any way of forcing sqlalchemy to use a particular
cursor?

James

--

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=.




[sqlalchemy] unexpected behaviour of in_

2008-06-12 Thread casbon

Hi All,

I am seeing something I didn't expect using in_.

Here is a simple example, exactly as I expect:


In [13]: col = Trade.c.TradeId.in_([1,2])

In [14]: sel = select([col])

In [15]: print col
Trade.TradeId IN (?, ?)

In [16]: print sel
SELECT Trade.TradeId IN (?, ?) AS anon_1
FROM Trade


But now, if I use a subselect, I see a problem:



In [17]: col = Trade.c.TradeId.in_(select([Trade.c.TradeId]))

In [18]: sel = select([col])

In [19]: print col
Trade.TradeId IN (SELECT Trade.TradeId
FROM Trade)

In [20]: print sel
SELECT Trade.TradeId IN (SELECT Trade.TradeId
FROM Trade) AS anon_1
FROM Trade, (SELECT Trade.TradeId AS TradeId
FROM Trade)


The column definition (col) is as expected, but the select definition
(sel) is strange.  It selects two things and generates n^2 rows.  How
can I get the select I expect:

SELECT Trade.TradeId IN (SELECT Trade.TradeId
FROM Trade) AS anon_1
FROM Trade

thanks,
James

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: unexpected behaviour of in_

2008-06-12 Thread casbon

Ah, thanks.

Should have searched the bug reports as well as the list.

On Jun 12, 3:27 pm, Michael Bayer [EMAIL PROTECTED] wrote:
 this is ticket #1074.   A slightly klunky workaround for now is:

 col = t1.c.c1.in_([select([t1.c.c1]).as_scalar()])

 On Jun 12, 2008, at 10:04 AM, casbon wrote:



  Hi All,

  I am seeing something I didn't expect using in_.

  Here is a simple example, exactly as I expect:

  In [13]: col = Trade.c.TradeId.in_([1,2])

  In [14]: sel = select([col])

  In [15]: print col
  Trade.TradeId IN (?, ?)

  In [16]: print sel
  SELECT Trade.TradeId IN (?, ?) AS anon_1
  FROM Trade

  But now, if I use a subselect, I see a problem:

  In [17]: col = Trade.c.TradeId.in_(select([Trade.c.TradeId]))

  In [18]: sel = select([col])

  In [19]: print col
  Trade.TradeId IN (SELECT Trade.TradeId
  FROM Trade)

  In [20]: print sel
  SELECT Trade.TradeId IN (SELECT Trade.TradeId
  FROM Trade) AS anon_1
  FROM Trade, (SELECT Trade.TradeId AS TradeId
  FROM Trade)

  The column definition (col) is as expected, but the select definition
  (sel) is strange.  It selects two things and generates n^2 rows.  How
  can I get the select I expect:

  SELECT Trade.TradeId IN (SELECT Trade.TradeId
  FROM Trade) AS anon_1
  FROM Trade
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---