Re: Using LibPq in TAP tests via FFI

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Using LibPq in TAP tests via FFI
Date: 2024-07-16 14:27:17
Message-ID: a0d25b9b-3c4f-4205-80f1-79cd007877b2@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2024-06-17 Mo 10:01 AM, Andrew Dunstan wrote:
>
>>
>>> I agree with you that falling back on BackgroundPsql is not a terribly
>>> satisfactory solution.
>> I'm somewhat doubtful we'll just agree on making FFI::Platypus a hard
>> dependency, but if we agree to do so...
>>
>>
>
> Maybe not. If so your other suggestion of a small XS wrapper might
> make sense.

Here's the latest version of this patch. It removes all use of
background_psql(). Instead it uses libpq's async interface, which seems
to me far more robust. There is one remaining use of interactive_psql(),
but that's reasonable as it's used for testing psql itself.

I spent yesterday creating an XS wrapper for just the 19 libpq functions
used in Session.pm. It's pretty simple. I have it passing a very basic
test, but haven't tried plugging it into Session.pm yet.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

Attachment Content-Type Size
pqffi-poc-4.patch text/x-patch 64.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2024-07-16 14:30:47 Re: Removing unneeded self joins
Previous Message Вардан Погосян 2024-07-16 14:26:40 Re: Removing unneeded self joins