Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g84GX-0000P6-M3 for psycopg@arkaria.postgresql.org; Thu, 04 Oct 2018 14:06:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g84GV-0002y6-Lw for psycopg@arkaria.postgresql.org; Thu, 04 Oct 2018 14:06:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g84GV-0002xj-Gn for psycopg@lists.postgresql.org; Thu, 04 Oct 2018 14:06:07 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g84GS-0007Th-H7 for psycopg@lists.postgresql.org; Thu, 04 Oct 2018 14:06:07 +0000 Received: by mail-lf1-x12a.google.com with SMTP id o21-v6so6893884lfe.0 for ; Thu, 04 Oct 2018 07:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CoY1XYLR5CN2C2f8bxJ2Qetkd+MGnYUaJFkjDb9KP5A=; b=N0nsbdSOfVND0J800Elh5/79eUhA8dgaxwXPyHwJ9dP+Eykih+g72JvcH1dPp22nRT wt7Ar7qJnBnxKNcEzI4v5DGZ36511mQuysrcFlQBfwz7ubC52cb1tAAd6VJ07jTIzkIX CPTvP67voLza+GNv4S/xPXXHCJE+IfqCdjW9PKXRmnNx+c9Ei7vQzkhk0XJjNswtF3Hg iz7cj2jgUxEW6m5HBz7x0QqSkDINtzgtxPlocomTwGtaElcymrSWwkluWwJyx+ip0D2+ EaiXAowXQTBBTQGzIt2Nrn1MhF6FoRr84R4/2tbGUN4vkWo515Ycil439MabSkQQMW1h ZpOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CoY1XYLR5CN2C2f8bxJ2Qetkd+MGnYUaJFkjDb9KP5A=; b=L5HFZudyyNKoMzFzVDbUoj7M8KNJ6VspEe1mCPjdcPTFPFeKkdEmiaaQbdvYkh08zJ 52cGyRvNVfrQ7H3T72tMLK3nePP3MNjeFyEP2qivveI5xiCEQAQDVuLLRSCPBZilngBA dthOvUW4n7LAdFiWPauyYNOvWb843YAZtwiTZGulblUDSnP8TazpvMyRNwagsLSZGsW4 H5c+EoOF1wCdRPoqZO+mYJ/zkgX0Jq86jnOmRPh7lTYaDWpm296+VERcMfX7x1qDrvZC Y9c2h6UcszRpBkwxAqiRAYukQWWc7Kd5P/FNJe9hoI4ZmteHa3CpguKCOl7UXiS7J0m1 OZjg== X-Gm-Message-State: ABuFfog48BNWw/drNgSsvV7a3XVTxp1ZfGCkNEFe7j86IUTj6KduWd1z /nfgnjnxZqdCerVyVz2Hs13sIwuLrgdJSmBDf93oUg== X-Google-Smtp-Source: ACcGV61rs7fZklwBusSBMMW1xeNPe8h1Ec0CXHSMX7NSa17w3wjFq2a4mNql1MJefSUj2h89PXSjh+Xz4EZKL/Df4Zk= X-Received: by 2002:a19:7709:: with SMTP id s9-v6mr1870lfc.84.1538661962522; Thu, 04 Oct 2018 07:06:02 -0700 (PDT) MIME-Version: 1.0 References: <3e4f0570-863a-6dfd-aaa9-d0b406af9d76@dndg.it> In-Reply-To: <3e4f0570-863a-6dfd-aaa9-d0b406af9d76@dndg.it> From: Daniele Varrazzo Date: Thu, 4 Oct 2018 15:05:51 +0100 Message-ID: Subject: Re: Plans for 2.8 To: Federico Di Gregorio Cc: psycopg@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Oct 4, 2018 at 2:27 PM Federico Di Gregorio wrote: > > 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. "schema", "table" is only an example: it could be "table"."field", even "schema"."table"."field", or "extension"."setting"... The object only wants to represent a dotted sequence of identifiers, at lexical level, nothing with semantics attached such as "an optionally schema-qualified table name" or "a field name". If the object was `Table()` or `Field()` rather than `Identifier()` I'd totally agree with you. -- Daniele