Re: Using LibPq in TAP tests via FFI - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Using LibPq in TAP tests via FFI
Date
Msg-id a0d25b9b-3c4f-4205-80f1-79cd007877b2@dunslane.net
Whole thread Raw
In response to Re: Using LibPq in TAP tests via FFI  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Using LibPq in TAP tests via FFI
List 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

pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: [PATCH] Refactor pqformat.{c,h} and protocol.h
Next
From: Alexander Korotkov
Date:
Subject: Re: Removing unneeded self joins