Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l99jz-0006xg-Is for psycopg@arkaria.postgresql.org; Mon, 08 Feb 2021 16:50:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l99jy-0008HT-E1 for psycopg@arkaria.postgresql.org; Mon, 08 Feb 2021 16:50:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l99jx-0008HM-Ru for psycopg@lists.postgresql.org; Mon, 08 Feb 2021 16:50:22 +0000 Received: from campbell-lange.net ([178.79.140.51]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l99ju-00062r-UQ for psycopg@postgresql.org; Mon, 08 Feb 2021 16:50:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=campbell-lange.net; s=it; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GUgYZvqICD5VwseDrgaS5diDv0+lISIKnpzC61VF1XY=; b=w4hvwgL71mZUA5KNQhOMSurZ2 IvADi78YIY7peJ5VYWwxQBxfc/aNwiNNS5m7LNqoceQaMFekWRS+g1fponateMaw2dQbU6xrWG6d7 uSMBaLB2glFHlD5YWYRH5FVJ9/yviuYdL5bvktJFp08RjjrDe88xZJyfFo9IMrSP+PiMY=; Received: from 162.164.198.146.dyn.plus.net ([146.198.164.162] helo=rory-t470s) by campbell-lange.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l99jq-0006gF-Ok; Mon, 08 Feb 2021 16:50:14 +0000 Received: from rory by rory-t470s with local (Exim 4.92) (envelope-from ) id 1l99jq-0002AS-Fy; Mon, 08 Feb 2021 16:50:14 +0000 Date: Mon, 8 Feb 2021 16:50:14 +0000 From: Rory Campbell-Lange To: Adrian Klaver Cc: Daniele Varrazzo , Denis Laxalde , psycopg@postgresql.org Subject: Re: Latest developments in psycopg3 Message-ID: <20210208165014.GA8138@campbell-lange.net> References: <4eb4e86a-c813-bb8f-ae93-4f1b9fd46b6b@dalibo.com> <34c98d4f-b26a-bc79-09e4-6567c38e92fa@aklaver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <34c98d4f-b26a-bc79-09e4-6567c38e92fa@aklaver.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 08/02/21, Adrian Klaver (adrian.klaver@aklaver.com) wrote: > On 2/8/21 4:16 AM, Daniele Varrazzo wrote: > > 1) We can provide a feature to select the type of cursor that is not > > much dissimilar from psycopg2 > > 2) Do we need DictCursor/RealDictCursor? ISTM that one of the two > > would be sufficient? Possibly an object inheriting from a Python dict > > instead of emulating it so that e.g. json.dumps() > > RealDictCursor is what I use primarily as it plays well with json.*. I have > used NamedTupleCursor for those things that play better with dot notation. I > very rarely use DictCursor anymore as it's dual nature seemed to get in the > way more then it helped. Your comments also suggests the possibility of having a convenience method, something like ._asjson() perhaps to allow rows or entire result sets json encoded.