pgspider / sqlite_fdw

SQLite Foreign Data Wrapper for PostgreSQL
Other
219 stars 37 forks source link

"sqlite_fdw_version" function to return current extension version #37

Closed AmebaBrain closed 3 years ago

AmebaBrain commented 3 years ago

Thank you for the created extension.

I woul ask you to introduce sqlite_fdw_version function which will return current extension version. The same approach is done for example for mysql_fdw extension.

hrkuma commented 3 years ago

Thank you for request.

We'd like to support version check function like mysql_fdw in next time.

AmebaBrain commented 3 years ago

If I got you correctly and you plan to implement it please find below details how it is implemented in mentioned mysql_fdw extension

postgres=# \df mysql_fdw.
                                List of functions
  Schema   |        Name         | Result data type | Argument data types | Type 
-----------+---------------------+------------------+---------------------+------
 mysql_fdw | mysql_fdw_handler   | fdw_handler      |                     | func
 mysql_fdw | mysql_fdw_validator | void             | text[], oid         | func
 mysql_fdw | mysql_fdw_version   | integer          |                     | func
(3 rows)

postgres=# select * from mysql_fdw.mysql_fdw_version();
 mysql_fdw_version 
-------------------
             20504
(1 row)

sqlite_fdw has the following layout

postgres=# \df sqlite_fdw.
                                 List of functions
   Schema   |         Name         | Result data type | Argument data types | Type 
------------+----------------------+------------------+---------------------+------
 sqlite_fdw | sqlite_fdw_handler   | fdw_handler      |                     | func
 sqlite_fdw | sqlite_fdw_validator | void             | text[], oid         | func
(2 rows)
hrkuma commented 3 years ago

I think it would be like followings. Please let me know if it is not as your expectation.

testdb=# create extension sqlite_fdw;
create extension sqlite_fdw;
CREATE EXTENSION
testdb=# \df sqlite*
                               List of functions
 Schema |         Name         | Result data type | Argument data types | Type
--------+----------------------+------------------+---------------------+------
 public | sqlite_fdw_handler   | fdw_handler      |                     | func
 public | sqlite_fdw_validator | void             | text[], oid         | func
 public | sqlite_fdw_version   | integer          |                     | func
(3 rows)

testdb=# select * from public.sqlite_fdw_version();
select * from public.sqlite_fdw_version();
 sqlite_fdw_version
--------------------
              10301
(1 row)
AmebaBrain commented 3 years ago

Yes, exactly!

hrkuma commented 3 years ago

Thank you for confirmation. I have added sqlite_fdw_version in 2e71a9b79cb4f2cd725dc16a5d6e87ddc7d07883 . In next release the function will return released version.