Re: Plans for 2.8 - Mailing list psycopg

From Federico Di Gregorio
Subject Re: Plans for 2.8
Date
Msg-id 3e4f0570-863a-6dfd-aaa9-d0b406af9d76@dndg.it
Whole thread Raw
In response to Plans for 2.8  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Responses Re: Plans for 2.8  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
List psycopg
On 10/04/2018 02:38 PM, Daniele Varrazzo wrote:
> A tiny improvement to SQL generation is already ready^W merged in
> #732: it will be possible to use `Identifier("schema", "name")` which
> would be rendered in dotted notation in the query. Currently
> `Identifier()` takes a single param so this extension is backward
> compatible and there is no need to introduce a new `Composable` type
> to represent dotted sequences of identifiers.

I understand that from a compatibility point of view everything works 
with the "schema", "name" order of arguments (you just switch on the 
number of arguments) but usually such approach causes infinite headaches 
when you remove or add the namespace from the call.

`Identifier(name, schema=None)` is better, IMHO because makes explicit 
that the mandatory and first argument is always the identifier itself, 
while the schema is optional.

federico

-- 
Federico Di Gregorio                         federico.digregorio@dndg.it
DNDG srl                                                  http://dndg.it
      One key. One input. One enter. All right. -- An american consultant
            (then the system crashed and took down the *entire* network)


psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Plans for 2.8
Next
From: Rory Campbell-Lange
Date:
Subject: Re: Plans for 2.8