I've added a PR for full=True in outerjoin(), join() and Join():
https://github.com/zzzeek/sqlalchemy/pull/167
FULL OUTER JOIN, besides other uses, is very useful in ETLs for doing
transformations on top of table differences. Using two outer joins, as
suggested in one of the above posts, un
C-5, Michael Bayer wrote:
>
> why don’t you use a NOT EXISTS correlated subquery? that way the subquery
> can refer to the outer table completely, rather than having just one column
> where you can call IN.
>
>
>
> > On Dec 3, 2014, at 12:36 PM, Stefan Urbanek > wrot
Hi,
How can I reference a table that I am deleting from in an inner/nested
statement?
Here is my simplified oritinal version, no inner condition:
rownum = sql.expression.over(sql.func.row_number(),
partition_by=table.c.some_id,
Hi,
How can I specify relative date on a column where the component is a month?
Something like "date_column - interval '3 months'" The python `timedelta()`
does not contain the month component.
Cheers,
Stefan
--
You received this message because you are subscribed to the Google Groups
"sqla
custom function?
On Friday, August 22, 2014 11:50:01 AM UTC-4, Stefan Urbanek wrote:
>
> Hi,
>
> I have a custom PostgreSQL function that takes two JSON-type arguments:
>
> CREATE OR REPLACE FUNCTION "update_json"(original json, update_obj json)
>
>
> When I
Hi,
I have a custom PostgreSQL function that takes two JSON-type arguments:
CREATE OR REPLACE FUNCTION "update_json"(original json, update_obj json)
When I try to use the function in sqlalchemy:
a_dictionary = dict(...)
value = sqlalchemy.sql.func.update_json(a_json_column, a_dictionary)
ta
sense.
if you just put it in the first element that will work also:
>
>
> data = [
> {"id": 1, "value": "foo", "adate":sql.func.now()},
> {"id": 2, "value": "bar"}
> ]
>
> stmt = table.insert(
3, 2014 5:40:38 PM UTC-4, Stefan Urbanek wrote:
>
> Hi,
>
> I'm trying to multi-insert records which contain a function:
>
> record = {
>
> "some_date": sql.func.now()
>
> key: value, ...
>
> }
>
>
> When I execute table insert
Postgres.
On Tuesday, June 3, 2014 5:44:16 PM UTC-4, Jonathan Vanasco wrote:
>
> Which database are you using?
>
--
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 s
Hi,
I'm trying to multi-insert records which contain a function:
record = {
"some_date": sql.func.now()
key: value, ...
}
When I execute table insert with list of records where len(records) > 1
then I get an error:
“sqlalchemy.exc.ProgrammingError: (ProgrammingError) can't adapt
Hi,
First, happy new year to you all and thanks for the great work on
SQLAlchemy.
I just would like to share a bit of news. Cubes – Python Lightweight OLAP
framework is approaching 1.0 with quite a few new things. Cubes is using
SQLAlchemy for the SQL ROLAP backend. The notable SQL related cha
Thank you, this solves my problem.
On Saturday, April 13, 2013 2:53:15 PM UTC-5, Michael Bayer wrote:
>
> there should be engine.dialect.server_version_info available, once at
> least one connection has been made.
>
>
>
>
> On Apr 13, 2013, at 12:26 PM, Stefan Urban
Hi,
In Cubes I would like to optionally use the upcoming CREATE MATERIALIZED
VIEW [1] feature in Postgres 9.3 (or any other database that supports
it). There will be plain alternative "CREATE TABLE" for Postgres < 9.3.
[1]
http://michael.otacoo.com/postgresql-2/postgres-9-3-feature-highlight-m
On 27.12.2012, at 23:21, Michael Bayer wrote:
>
>
> On Dec 27, 2012, at 4:55 PM, Stefan Urbanek wrote:
>
>> Hi,
>>
>> I am trying to pass multiple rows as tuples into an INSERT statement.:
>>
>> # buffer is list of lists/tuples, like: [ [
Hi,
I am trying to pass multiple rows as tuples into an INSERT statement.:
*# buffer is list of lists/tuples, like: [ [1, "foo"], [2, "bar"], ... ]
*
insert = self.table.insert()
engine.execute(insert, buffer)
This fails with:
File
"/opt/local/Library/Frameworks/Python.framework/Ve
AM UTC-5, Michael Bayer wrote:
>
> there's the quote() method which doesn't expect any schema object, just
> the name and a flag "force" which you can leave as None to have it
> determine quoting automatically.
>
> On Oct 22, 2012, at 12:58 AM, Stefan Urbanek
Hi,
I am creating some custom compiled constructions and I need to create
properly quoted schema and table, however I have both only as strings
because the table does not exist yet (for example: CREATE TABLE ... AS
SELECT ...). It looks like all table quote_* methods in IdentifierPreparer
expe
On 8.5.2012, at 0:18, Michael Bayer wrote:
>
> On May 7, 2012, at 6:09 PM, Stefan Urbanek wrote:
>
>>
>> p.s.: On the other hand, Table.is_view might be a good flag - to maintain
>> consistency with the fact that Table() can reflect a view. However, I am not
>
On 7.5.2012, at 20:27, Michael Bayer wrote:
>
> On May 7, 2012, at 2:03 PM, Stefan Urbanek wrote:
>
>> Thanks, this is partially helpful. However, in the example there is:
>>
>> stuff_view = view("stuff_view"...
>>
>> and not:
>>
>
e compilation of
> sqlalchemy.schema.DropTable which would somehow have to check those Table
> objects you have which are actually views, maybe if you put a flag on them
> table.isview=True or something like that.
>
>
>
> On May 6, 2012, at 7:07 AM, Stefan Urbanek wrote:
using SQLAlchemy?
As for workaround, is there a way how I can at least determine whether the
Table object is a view and issue manual DROP VIEW statement by myself?
Stefan Urbanek
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To view this
On 28.4.2012, at 18:39, Michael Bayer wrote:
>
> On Apr 28, 2012, at 5:52 AM, Stefan Urbanek wrote:
>
>> This is what I used as workaround [1]:
>>
>> # select is sqlalchemy.sql.expression.select()
>> # each selected column was derived as colu
expect the sqlalchemy.sql.expression.select.column always return final
list of selected columns. I haven't tested yet whether this will work with
aggregations or any other computed expressions as well, but I see no reason
why it should not.
Regards,
Stefan
[1] https://github.com/St
Hi,
I had this problem ~year ago (see [1]). Now with SQLAlchemy 0.7.6 I am
having this same problem back again. Here is a piece of code that shows
this behaviour, in comparison to other backends as well:
https://gist.github.com/2506388
Verbosity and non-reusing instances is intentional.
Is th
t; statements
># so they can be pasted and run in sql developer!
>out.write(('%s' %
> sql.compile(dialect=engine.dialect)).strip()+';\n/\n')
>engine = create_engine('oracle://', strategy='mock', executor=dump)
>
&
Hi,
How can I get a string that is going to be executed without executing it?
Example code:
from sqlalchemy import create_engine, MetaData, Table, Column, Integer,
String
engine = create_engine("sqlite://")
metadata = MetaData(engine)
table = Table("foo", metadata)
table.append_column(Column(
? Obviously you're passing 'cards.id' as a string so that the
> order doesn't matter, but have you tried it anyway?
>
>
>
>
>
>
>
> -Original Message-
> From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On
> Behalf Of Stefa
Hi,
I am trying to create a simple many-to-many relationship using
PostgreSQL in a specific schema ('cards'). I do it like this:
class BaseObject(object):
id = Column(Integer, primary_key=True)
date_created = Column(DateTime)
date_modified = Column(DateTime)
collection_cards = Table
esign decisions and bugs).
Regards,
Stefan Urbanek
data analyst and data brewmaster
Twitter: @Stiivi
Home: http://stiivi.com
Brewery: http://databrewery.org
Github: https://github.com/Stiivi
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
Hi,
I have a quite "niche" problem: I am trying to create a stand-alone
mac application with py2app - just wraped a web service in an app
bundle. My app uses sqlalchemy and postgres (psycopg2). When I try to
run the application I get (in Console):
...
File "sqlalchemy/engine/url.pyc", line 116, i
I apologize for replying to my own post, just found out that it works
as expected with the latest fresh release 0.7b2 -downloaded and
installed manually. it does not work with the version installed by
easy_install, i think it was 0.6.6.
On Mar 3, 12:18 am, Stefan Urbanek wrote:
> Hi,
>
&g
Hi,
I have a table with column names that contain dots, like
"category.name" or "category.desc". When I do:
stmt = table.select(whereclause = condition)
cursor = connection.execute(stmt)
print cursor.keys()
I will get just [ ... "name", "desc" ] - nothing before the dot
'.'.
Whe
you have any suggestions,
comments? If anyone would like to try it and will have any troubles,
just drop me a line and I will help.
Regards,
Stefan Urbanek
--
Twitter: @Stiivi
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to
33 matches
Mail list logo