[sqlalchemy] Re: [PROPOSE] Integrate migration support in SQLAlchemy

2010-03-04 Thread Lele Gaifax
(a DAG, introduced by script's metadata) (thanks to Michael's topological sort, btw!) and execute the missing one on a target database. Double value: good documentation, and automatic upgrade of custom's databases. It's GPL, just ask if interested! ciao, lele. -- nickname: Lele Gaifax| Quando

[sqlalchemy] Re: How to get server or dialect version or properties?

2013-04-13 Thread Lele Gaifax
, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: views declarative?

2013-04-17 Thread Lele Gaifax
the reference to the recipe, I assume you are asking whether you can map a view onto a Python class using the declarative layer. If so, yes, SQLAlchemy does not care about how the underlying table is implemented, it will issue the same SQL in either cases. ciao, lele. -- nickname: Lele Gaifax

[sqlalchemy] Re: Selecting across columns with func.min()

2013-08-20 Thread Lele Gaifax
yet to show the proper SA syntax :) hth, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- You received this message because you

[sqlalchemy] Re: Session() and UnboundLocalError: local variable 'Session' referenced before assignment

2013-08-25 Thread Lele Gaifax
the not recommended idiom of *redefining* a symbol in that way, you should import/define the session maker function from somewhere before you can use it. As said, I'd recommend using different names, to avoid confusion, for example session = SessionMaker() hth, ciao, lele. -- nickname: Lele Gaifax

[sqlalchemy] Re: SQLAlchemy 0.9.0 Released

2013-12-31 Thread Lele Gaifax
] is it really drink a toast? :) -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- You received this message because you are subscribed

[sqlalchemy] Creating a partial unique index on SQLite

2014-09-01 Thread Lele Gaifax
please point me in the right direction? Thanks in advance, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- You received

[sqlalchemy] Re: Creating a partial unique index on SQLite

2014-09-01 Thread Lele Gaifax
statement I used is more like event.listen(MyModel.__table__, after_create, DDL(CREATE UNIQUE INDEX model_c1_vs_c2 ON model (id, idc1, idc2) WHERE flag=0)) ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele

[sqlalchemy] Re: Mysql issue with big composite primary keys

2014-11-10 Thread Lele Gaifax
is written to permanent storage). hth, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- You received this message because you

[sqlalchemy] Re: Firebird engine - support for embedded version

2007-11-12 Thread Lele Gaifax
On Mon, 12 Nov 2007 13:22:25 +0100 Werner F. Bruhin [EMAIL PROTECTED] wrote: - kinterbasdb 3.2 with a patch from Pavel Cisar to __init__.py to make it work with FB 2.1beta Do you have an URL for that patch? thank you, ciao, lele. -- nickname: Lele Gaifax| Quando vivrò di quello che ho

[sqlalchemy] Re: Type of calculated columns

2007-12-02 Thread Lele Gaifax
! :-) and thus can be reused freely... ciao, lele. -- nickname: Lele Gaifax| Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas| comincerò ad aver paura di chi mi copia. [EMAIL PROTECTED] | -- Fortunato Depero, 1929

[sqlalchemy] Firebird status and some testsuite issues

2007-12-17 Thread Lele Gaifax
onupdate/ondelete? What do you think? Thank you, ciao, lele. -- nickname: Lele Gaifax| Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas| comincerò ad aver paura di chi mi copia. [EMAIL PROTECTED] | -- Fortunato Depero, 1929

[sqlalchemy] Sane rowcount

2007-12-19 Thread Lele Gaifax
of sane_multi_rowcount? And given new results on sane_rowcount, is it right turning it to True on Firebird too? thank you, ciao, lele. -- nickname: Lele Gaifax| Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas| comincerò ad aver paura di chi mi copia. [EMAIL PROTECTED

[sqlalchemy] Re: Sane rowcount

2007-12-19 Thread Lele Gaifax
*only* activating sane_multi_rowcount. thank you, ciao, lele. -- nickname: Lele Gaifax| Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas| comincerò ad aver paura di chi mi copia. [EMAIL PROTECTED] | -- Fortunato Depero, 1929

[sqlalchemy] Re: Sane rowcount

2007-12-19 Thread Lele Gaifax
]! You're welcome anyway!! ciao, lele. -- nickname: Lele Gaifax| Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas| comincerò ad aver paura di chi mi copia. [EMAIL PROTECTED] | -- Fortunato Depero, 1929. --~--~-~--~~~---~--~~ You

[sqlalchemy] Re: sqlalchemy object serialization / deserialization

2007-12-21 Thread Lele Gaifax
, but really a (little) specialized language able to reconstruct a Python object, maintaining its relations with other objects in the stream. See this blog: http://peadrop.com/blog/2007/06/18/pickle-an-interesting-stack-language/ ciao, lele. -- nickname: Lele Gaifax| Quando vivrò di quello

[sqlalchemy] Re: SQLAlchemy and Interbase 7.5

2008-01-31 Thread Lele Gaifax
support IB. The problem is, I don't have any recent version of IB at hand, so it's difficult for me to understand what's going wrong. What is the problem, anyway? Does it raise an error (and thus there's some traceback), or simply the table isn't autoloaded? ciao, lele. -- nickname: Lele Gaifax

[sqlalchemy] Re: dynamic Tableclasses

2008-04-02 Thread Lele Gaifax
, key, kw[key]) instead. hth, ciao, lele. -- nickname: Lele Gaifax| Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas| comincerò ad aver paura di chi mi copia. [EMAIL PROTECTED] | -- Fortunato Depero, 1929

[sqlalchemy] Re: Using substring function

2008-04-11 Thread Lele Gaifax
fairly easy to implement it for 0.4.x, see revision 4490: dunno about 0.3.x but it shouldn't be any harder. ciao, lele. -- nickname: Lele Gaifax| Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas| comincerò ad aver paura di chi mi copia. [EMAIL PROTECTED

[sqlalchemy] Re: Extension proposal

2008-04-14 Thread Lele Gaifax
On Mon, 14 Apr 2008 11:49:40 +0100 Paul Johnston [EMAIL PROTECTED] wrote: There's an old version of my code here: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/ProcHash It's an nice function to have around: care to update the version on the wiki? ciao, lele. -- nickname: Lele Gaifax

[sqlalchemy] (auto-)flush issue

2008-04-16 Thread Lele Gaifax
) ... cross = CrossObj(id=1, index=1) cross.ref = session.query(RefObj).get(1) newobj.other_objs.append(cross) What am I missing? Thanks in advance, ciao, lele. -- nickname: Lele Gaifax| Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas| comincerò ad aver paura di

[sqlalchemy] Re: Sqlautocode error

2008-04-18 Thread Lele Gaifax
On Fri, 18 Apr 2008 01:06:41 -0700 (PDT) Vortexmind [EMAIL PROTECTED] wrote: On 17 Apr, 18:10, Lele Gaifax [EMAIL PROTECTED] wrote: On Thu, 17 Apr 2008 07:40:02 -0700 (PDT) Either get the trunk of autocode, ... I tried, but http://sqlautocode.googlecode.com/svn/trunk/ grabs the 0.3 SA

[sqlalchemy] Re: database definitions - was sqlalchemy migration/schema creation

2008-05-09 Thread Lele Gaifax
/UsageRecipes/AutoCode (but note that the current version is not the one attached to the page, but rather lives in a repository on code.google.com). ciao, lele. -- nickname: Lele Gaifax| Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas| comincerò ad aver paura di chi mi copia

[sqlalchemy] Re: Defining common columns for a group of tables

2008-05-10 Thread Lele Gaifax
-generated value (they are effectively overwritten by a database trigger, at insert/update time), possibly without resorting to marking them defer on each mapped entity... Any magical shortcut to achieve that? :-) hth, ciao, lele. -- nickname: Lele Gaifax| Quando vivrò di quello che ho pensato ieri

[sqlalchemy] Obtaining primitive columns from a select

2008-07-15 Thread Lele Gaifax
Hi all, I'd like to have a generic function that executes a given SQL query filtering it with conditions passed as keyword args, but I do not find a clean way to refer to the primitive columns (on the underlying table) instead of those already bound to the select. Given a simple select::

[sqlalchemy] Re: Performance of data mapping and plain access

2006-12-27 Thread Lele Gaifax
Michael Bayer wrote: the ORM is going to be slower in all cases since there is the overhead of creating new object instances and populating them, as well as initializing their attribute instrumentation and also a copy of their attributes for the purposes of tracking changes when you issue a

[sqlalchemy] Order of constraints at creation time

2007-01-01 Thread Lele Gaifax
Hi all, I spent a moment at fixing here and there to make some test work under firebird. I'm out of luck figuring out the proper solution for engine.ReflectionTest.testbasic: FB2 fails here because the test tries to create a table with a primary key and a foreign key to itself, but the issued

[sqlalchemy] Order of constraints at creation time

2007-01-01 Thread Lele Gaifax
Hi all, I spent a moment at fixing here and there to make some test work under firebird. I'm out of luck figuring out the proper solution for engine.ReflectionTest.testbasic: FB2 fails here because the test tries to create a table with a primary key and a foreign key to itself, but the

[sqlalchemy] Re: Update on MS-SQL work

2007-01-08 Thread Lele Gaifax
Paul Johnston wrote: 3) unicode fields Ticket #298 had been created for this, but is not a complete solution. I have re-opened the ticker, with this comment: Unicode columns are still created as VARCHAR. The problem is that Unicode is a TypeDecorator

[sqlalchemy] Re: fetchmany() vs sqlite

2007-03-08 Thread Lele Gaifax
Michael Bayer wrote: FB - ?? I confirm that the kinterbasdb follows the DBAPI here, and thus its Cursor.fetchmany() accepts an optional positional argument for the size. ciao, lele. --~--~-~--~~~---~--~~ You received this message because you are subscribed

[sqlalchemy] Re: fetchmany() vs sqlite

2007-03-08 Thread Lele Gaifax
Michael Bayer wrote: FB - ?? For what is worth, it actually accepts either a single positional argument or a `size` keyword argument. ciao, lele. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy

[sqlalchemy] Firebird backend

2007-03-19 Thread Lele Gaifax
Hi all, I attached a snapshot of my current source of the Firebird backend for SA to ticket #410. This version passes several more unittests, in particular wrt the supported types: BLOBs and Unicode should work now. Since I'd be very sad knowing I'm breaking someone else project, I'd like to

[sqlalchemy] Re: Quoting column names on table create?

2007-03-19 Thread Lele Gaifax
Karlo Lozovina wrote: I was just wondering, why does SA quote column names that have mixed case in them, and leaves them unquoted for lowercase column names? Because in general SQL engines tend to be case-insensitive, that is, under most of them the query SELECT column_a, column_b FROM table

[sqlalchemy] Re: Firebird backend

2007-03-31 Thread Lele Gaifax
Oleg Deribas wrote: Hello, Lele Gaifax said the following on 19.03.2007 17:03: Since I'd be very sad knowing I'm breaking someone else project, I'd like to hear a voice from some other FB user, before asking Michael to accept this work. Here is simple code which works with the stock

[sqlalchemy] Re: Firebird backend

2007-04-01 Thread Lele Gaifax
Oleg Deribas wrote: No, I mean - I've got exception when executing that code with the new backend: http://paste.turbogears.org/paste/1177 Uhm, this is really strange: the backend is involvend only marginally in your example as the traceback shows, I thought it was a problem of applying

[sqlalchemy] Re: Firebird can't print an insert() statement

2007-06-01 Thread Lele Gaifax
johnbraduk Using SQLAlchemy-0.3.7-py2.4 released with Turbogears johnbraduk Traceback (most recent call last): File johnbraduk /var/tmp/sqlatest.py, line 3, in -toplevel- fbdb = johnbraduk create_engine(dbstr) File johnbraduk

[sqlalchemy] Re: last_inserted_ids()

2007-07-09 Thread Lele Gaifax
could i make the sqlalchemy subdirectory updateable by svn, or should i re-egg the updated package after every significant change? setuptools has a notion of PYTHONPATH thats not compatible with Python's notion of itits usually easiest to python setup.py on whatever version

[sqlalchemy] Re: engine.execute

2007-10-11 Thread Lele Gaifax
At Thu, 11 Oct 2007 18:28:10 +0200, Werner F Bruhin wrote: My first go at this did not work, it might have to do with FB/kinterbasdb as it expects the stored procedures to be called in one of these ways. cur.execute(select output1, output2 from the_proc(?, ?), (input1, input2))

[sqlalchemy] Re: TypeDecorators and raw inserts

2015-07-01 Thread Lele Gaifax
Mike Bayer mike...@zzzcomputing.com writes: On 6/30/15 6:56 PM, Lele Gaifax wrote: With the approach above custom column types used by the new_table are not playing their magic, and I currently must repeat it within the adapt() function. I assume you mean the data you're getting back from

[sqlalchemy] TypeDecorators and raw inserts

2015-06-30 Thread Lele Gaifax
an insert using its ORM layer, so that I can simplify the adapt() function applying the DRY principle? Thank you in advance for any hints, bye, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l

[sqlalchemy] A glitch: is it SA's, cymysql's or mine only?

2015-07-20 Thread Lele Gaifax
be catched anyway, either by fixing the driver (cymysql) or SA itself. Thank you, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929

[sqlalchemy] Re: A glitch: is it SA's, cymysql's or mine only?

2015-07-20 Thread Lele Gaifax
. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- You received this message because you are subscribed to the Google Groups sqlalchemy group

[sqlalchemy] Re: Dealing with l10n fields

2015-07-12 Thread Lele Gaifax
: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- You received this message because you are subscribed to the Google Groups sqlalchemy group

[sqlalchemy] Dinamically adding an outer join to an existing select

2015-10-24 Thread Lele Gaifax
rjoin(pad, sa.text('true'))) it instead emits the right SQL, that is: SELECT p.id, p.description, p.idkind, pad.price AS price, pad.discount AS discount FROM products AS p LEFT OUTER JOIN price_and_discount(p.id, %(idcustomer)s) AS pad ON true So, is there a "correct way" to dynamicall

[sqlalchemy] Dealing with l10n fields

2015-07-12 Thread Lele Gaifax
to get there, or other approaches I missed? Thanks a lot, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- You received

[sqlalchemy] Re: There is any chance to SQLAlchemy works with syncio?

2015-09-20 Thread Lele Gaifax
non-blocking > operations too. In the very same context, I'm using a port of the twisted-based Alchimia to asyncio: https://gitlab.com/arstecnica/arstecnica.sqlalchemy.async It only works at the core level of SA, though. hth, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho

[sqlalchemy] Re: Reflection of table/columns comments

2015-12-16 Thread Lele Gaifax
ne! ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- You received this message because you are subscribed to the Google Groups &qu

[sqlalchemy] Reflection of table/columns comments

2015-12-15 Thread Lele Gaifax
er if there is a better way hidden somewhere (... it wouldn't be a great surprise! :-). What would you suggest? Thanks for any hint, ciao, lele. [*] https://pypi.python.org/pypi/metapensiero.sqlalchemy.proxy -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | cominc

[sqlalchemy] Re: Should RowProxy behave as a standard Python sequence?

2016-01-28 Thread Lele Gaifax
Mike Bayer <mike...@zzzcomputing.com> writes: > reinstate the whole thing in 516a442f233d90eb7b8bb844e2dea7865bb21f66... Ok, see https://github.com/zzzeek/sqlalchemy/pull/231 thank you, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanue

[sqlalchemy] Re: Should RowProxy behave as a standard Python sequence?

2016-01-27 Thread Lele Gaifax
Mike Bayer <mike...@zzzcomputing.com> writes: > On 01/27/2016 05:32 AM, Lele Gaifax wrote: >> Here is the diff implementing the third option: it still need to touch also >> the C implementation, because that does not use the metadata keymap when the >> key is an integer

[sqlalchemy] Re: Should RowProxy behave as a standard Python sequence?

2016-01-27 Thread Lele Gaifax
Lele Gaifax <l...@metapensiero.it> writes: > Let me know how you prefer me going forward: I can easily try out your (now > reverted) change, but it's up to you. The following patch: -- You received this message because you are subscribed to the Google Groups "sqlalchemy"

[sqlalchemy] Re: Should RowProxy behave as a standard Python sequence?

2016-01-25 Thread Lele Gaifax
undant index computation under Py2). Thank you, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- You received this message becaus

[sqlalchemy] Re: Should RowProxy behave as a standard Python sequence?

2016-01-24 Thread Lele Gaifax
Mike Bayer <mike...@zzzcomputing.com> writes: > On 01/24/2016 11:11 AM, Lele Gaifax wrote: >> I wonder whether there is an underlying reason or if it's just an oversight. > > both? the rowproxy is addressable by lots of things like strings, > Column objects. if we wa

[sqlalchemy] Should RowProxy behave as a standard Python sequence?

2016-01-24 Thread Lele Gaifax
pure Python version) class or into the ResultMetaData._key_fallback() method? Thank you, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato De

[sqlalchemy] Re: Should RowProxy behave as a standard Python sequence?

2016-01-25 Thread Lele Gaifax
ires.cextensions: how can I exercise both implementations (that is, C and pure Python)? Thanks for any feedback, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it |

[sqlalchemy] Re: Should RowProxy behave as a standard Python sequence?

2016-01-27 Thread Lele Gaifax
opping after 25 failures !! === 1 failed, 1161 passed, 617 skipped, 24 error in 67.09 seconds === Py3 *with* C speedups, and Py2 in either contexts do not exhibit these errors/failures... Let me know which of the options you like most, or if there is anything else I can do/try. Thanks for

[sqlalchemy] Assertion error on deleting one end of many-to-many relation

2016-03-03 Thread Lele Gaifax
nks in advance, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- You received this message because you are subscribed to the Goo

[sqlalchemy] Re: Assertion error on deleting one end of many-to-many relation

2016-03-03 Thread Lele Gaifax
e person instance. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- You received this message because you are subscri

[sqlalchemy] Handling "generic" relations

2016-10-20 Thread Lele Gaifax
: newaddr = Address(street='somewhere') person.addresses.append(newaddr) so I have to do this instead:: newaddr = Address(street='somewhere', attached_kind='Person', attached_id=person.id) Is there any trick hidden somewhere, or do I need a add_address() method on each entity? Thank you for any hint, ciao,

[sqlalchemy] Re: Handling "generic" relations

2016-10-21 Thread Lele Gaifax
Simon King <si...@simonking.org.uk> writes: > There are a few examples of different ways of doing this at > http://docs.sqlalchemy.org/en/latest/orm/examples.html#module-examples.generic_associations. Excellent, thank you for pointing me there! bye, lele. -- nickname: Lele Gai

[sqlalchemy] Re: Using psql commands (i.e. \d) through sqlalchemy.core

2016-10-31 Thread Lele Gaifax
pi/pgspecial, used for example by pgcli, a Python-based alternative to psql. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- SQLAlchemy

[sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Lele Gaifax
mike bayer <mike...@zzzcomputing.com> writes: > yeah IMO this is a bug in asyncpg but of course your custom dialect can work > around that. Ok, thank you. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver pau

[sqlalchemy] About CASTing query parameters

2017-04-14 Thread Lele Gaifax
, ciao, lele. [1] https://github.com/MagicStack/asyncpg [2] https://github.com/CanopyTax/asyncpgsa/issues/12 [3] https://github.com/MagicStack/asyncpg/issues/32 -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l..

[sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Lele Gaifax
is SELECT users.id FROM users WHERE users.name = 'myself' AND (users.active @> '2017-04-14'::date) ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- F

[sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Lele Gaifax
m(): Yes, I know, but since I need to tweak the representation of positional parameters (that is, $1 instead of :1), I had to touch the BIND_TEMPLATES content. That's why I thought a more generic approach of allowing an arbitrary, user controlled way to render the placeholders could be better. ciao,

[sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Lele Gaifax
as not clear that I was suggesting an enhancement, not a fix :-). ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- SQLAlchemy -

[sqlalchemy] Re: Problems with sqlalchemy and timestamps

2017-03-07 Thread Lele Gaifax
does not reference the correct column but the whole table. Also, I'd try to find a better way to pass the parameter, possibly without transforming it into a string with isoformat(). ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad

[sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Lele Gaifax
Mike Bayer <clas...@zzzcomputing.com> writes: > Right. So why can't asyncpg do that. I bet because it does want to fiddle with the SQL statement parsing, or with the formatting of parameter's values. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato

[sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Lele Gaifax
Lele Gaifax <l...@metapensiero.it> writes: > I bet because it does want to fiddle with the SQL statement parsing, or with > the formatting of parameter's values. ops: ... it does *not* want... ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri re

[sqlalchemy] Re: How do I copy an object and save to database?

2017-12-19 Thread Lele Gaifax
) of the cloned object. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- SQLAlchemy - The Python SQL Toolkit and Object R

[sqlalchemy] Re: How do I copy an object and save to database?

2017-12-20 Thread Lele Gaifax
omeObj.id# assume this is the primary key session.add(someObj) session.commit() assert someObj.id # here is the new PK on the cloned object ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi

[sqlalchemy] Re: Doubt about server_onupdate=FetchedValue()

2018-02-04 Thread Lele Gaifax
o work at the core layer...), and wasn't sure about it being an error on my configuration. > If these columns have a server side behavior for INSERT then you'd also add > server_default=FetchedValue() and then you wouldn't see the None on INSERT. Thank you, ciao, lele. -- nickname: Lele Gaifax |

[sqlalchemy] Re: KeyError when looping thru class objects to try and copy them

2017-12-20 Thread Lele Gaifax
oop above exits db.session.commit() ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- SQLAlchemy - The Python S

[sqlalchemy] Tiny doc clarification request

2018-11-08 Thread Lele Gaifax
as in :: data_table.c.data['some key'] or positional/by integer:: data_table.c.data[3] * Path index operations:: data_table.c.data[('key_1', 'key_2', 5, ..., 'key_n')] or is it just a s/two operations/three operations/ ? Thanks, lele. -- nickname: Lele Gaifax | Quando vivrò di

[sqlalchemy] Re: Tiny doc clarification request

2018-11-08 Thread Lele Gaifax
ot; lookup, be it either by string or by integer b) "iterative"/"nested" lookup, one hop at a time over the provided sequence But maybe I'm missing some detail on the "engine specific" implementations, where, say, "foo['string']" may be considered a very diff

[sqlalchemy] Re: Finding original "type" when using as_mutable()

2019-07-10 Thread Lele Gaifax
info is one place. sorry there is not a better solution. Thank you Mike, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- SQL

[sqlalchemy] Finding original "type" when using as_mutable()

2019-07-10 Thread Lele Gaifax
columns, and then check for that, but I wonder if there is an less intrusive way... knowing and loving SA I bet there is and it's just a matter of pronouncing the right incantation :-) Thank you in advance for any hint, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real:

[sqlalchemy] Re: Continuing support for Firebird database

2019-11-08 Thread Lele Gaifax
going. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper

[sqlalchemy] Re: Usage problem with CTEs and INSERTs

2019-11-05 Thread Lele Gaifax
"Mike Bayer" writes: > On Tue, Nov 5, 2019, at 4:08 AM, Lele Gaifax wrote: >> Hi all, >> >> I'm almost sure I'm missing the obvious, struggling to understand how to use >> a >> CTE with a PG "upsert" statement: I need to modify an exist

[sqlalchemy] Usage problem with CTEs and INSERTs

2019-11-05 Thread Lele Gaifax
nt = (some_sales.amount * %(amount_2)s) == Can anybody shed some light on what I'm doing wrong? Thanks in advance, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it

[sqlalchemy] Adapting a library to SA 1.4b1

2020-09-27 Thread Lele Gaifax
L169 [5] https://gitlab.com/metapensiero/metapensiero.sqlalchemy.proxy/-/blob/master/tests/fixture.py#L35 -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Deper

[sqlalchemy] Re: Adapting a library to SA 1.4b1

2020-09-29 Thread Lele Gaifax
suite! ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlal

[sqlalchemy] Re: Adapting a library to SA 1.4b1

2020-09-27 Thread Lele Gaifax
cky but you can look at > https://github.com/sqlalchemy/sqlalchemy/issues/5614 where I am tracking this. Thank you Mike! ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it |

[sqlalchemy] joinedload().load_only() emits 2.0 warning

2021-07-15 Thread Lele Gaifax
'firstname'))) for pet in query: print(pet.name, pet.person.firstname) -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- SQLAlchemy -

[sqlalchemy] Re: update with in clause from kwargs

2021-08-04 Thread Lele Gaifax
lter_group` with something like attr = getattr(self.model_class, col) filter_group.append(attr.in_(tuple(kwargs['query_params'][col]))) that is, obtain the mapped class member named after "col", and use that to build the filter expression. ciao, lele. -- nickname: Lele Gaifax | Qua

[sqlalchemy] Re: update with in clause from kwargs

2021-08-05 Thread Lele Gaifax
on. I think a full traceback could help in diagnosing the problem. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- SQLAlchemy -

[sqlalchemy] Re: joinedload().load_only() emits 2.0 warning

2021-07-21 Thread Lele Gaifax
Federico Caselli writes: > Updated here https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/2959 Great, thank you! ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero

[sqlalchemy] Re: joinedload().load_only() emits 2.0 warning

2021-07-16 Thread Lele Gaifax
Federico Caselli writes: > There is no difference, it's the documentation that's outdated. > > We should update that I see, thank you for the clarification! ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver pau

[sqlalchemy] Re: joinedload().load_only() emits 2.0 warning

2021-07-16 Thread Lele Gaifax
tached to the generic load_only() function documentation uses the string name. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- SQLA

[sqlalchemy] Re: Relationship backref cascade path

2021-07-24 Thread Lele Gaifax
"Mike Bayer" writes: > On Sat, Jul 24, 2021, at 5:49 AM, Lele Gaifax wrote: >> Hi all, >> >> I need some clarification on the following RemovedIn20Warning >> >> "Pet" object is being merged into a Session along the backref cascade path &

[sqlalchemy] Relationship backref cascade path

2021-07-24 Thread Lele Gaifax
sqlite:///:memory:', echo=True) session = orm.sessionmaker(bind=engine)() metadata.create_all(engine) me = Person(firstname='Lele') session.add(me) yaku = Pet(person=me, name='Yaku') session.add(yaku) session.commit() -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri

[sqlalchemy] Problem with PG ARRAY's ANY() and SA 1.4.36 (maybe related resolution of #6515 ?)

2022-04-29 Thread Lele Gaifax
uld do... but given that the above idiom has worked well for me for so long, this may very well be an unintended side effect of https://github.com/sqlalchemy/sqlalchemy/commit/63191fbef63ebfbf57e7b66bd6529305fc62c605. Thank you for any hint, ciao, lele. -- nickname: Lele Gaifax | Dire che Ema

[sqlalchemy] Re: Problem with PG ARRAY's ANY() and SA 1.4.36 (maybe related resolution of #6515 ?)

2022-05-03 Thread Lele Gaifax
"chunks" generated by common functions, used in several other places. It would be very impractical to carry around the whole set of "parameters" and use the implicit/automatic injection made by SA. Thanks again, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho p

[sqlalchemy] Re: On new native PG Range in SA 2.0

2022-10-24 Thread Lele Gaifax
m the connection.dialect. But hey, I do not expected those arguments will be changing often... :-) ciao, lele -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortun

[sqlalchemy] On new native PG Range in SA 2.0

2022-10-22 Thread Lele Gaifax
return self.active and date.today() in self.validity to something different, that in some way "reaches" the underlying psycopg (say) implementation and uses its logic? Thanks in advance, ciao, lele. -- nickname: Lele Gaifax | Dire che Emacs è "conveniente" è come rea

[sqlalchemy] Re: On new native PG Range in SA 2.0

2022-10-23 Thread Lele Gaifax
Lele Gaifax writes: > I will propose a PR soon. An ethical concern: given that the proposed methods are so simple, is it legal/acceptable to verbatim copy them, and their tests, from the psycopg (LGPL) and asyncpg (Apache license)? ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di que

[sqlalchemy] Re: On new native PG Range in SA 2.0

2022-10-23 Thread Lele Gaifax
directly. I would just disagree with > psycopg2's more nonsensical methods like `__lt__`, `__gt__`, etc. > Thank you for the directions: while I'm not 100% convinced about avoiding __contains__(), which seems very intuitive and practical, I will propose a PR soon. ciao, lele. -- nickname: Lele

[sqlalchemy] Re: On new native PG Range in SA 2.0

2022-10-24 Thread Lele Gaifax
manually coded those values. For that reason I didn't (yet) created an issue and proposed a PR. Mike, can you tell me if this is acceptable or how can I improve it? Thanks, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di

[sqlalchemy] Re: Where is the exactly .db file if I use sqlite code in the example

2022-12-06 Thread Lele Gaifax
tps://docs.sqlalchemy.org/en/14/dialects/sqlite.html#connect-strings, that syntax is equivalent to sqlite://:memory:, and thus there is no file involved. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi

[sqlalchemy] Re: Reflections on the SA 2.0 new PG Range

2022-12-04 Thread Lele Gaifax
py: is_false(bool(Range(empty=True))) test/dialect/postgresql/test_types.py:eq_(data, [(self._data_obj().__class__(empty=True),)]) test/dialect/postgresql/test_types.py:eq_(data, [(self._data_obj().__class__(empty=True),)]) thanks, lele. -- nickname: Lele Gaifax | Quand

  1   2   >