supabase / wrappers

Postgres Foreign Data Wrapper development framework in Rust.
http://fdw.dev
Apache License 2.0
559 stars 55 forks source link

Improve Airtable docs #170

Open pangolingo opened 1 year ago

pangolingo commented 1 year ago

Improve documentation

Link

I referenced these docs: https://supabase.github.io/wrappers/airtable/ (The same as the Supabase.com ones I think: https://supabase.com/docs/guides/database/extensions/wrappers/airtable)

Describe the problem

Here's the trouble I ran into:

Describe the improvement

Add documentation to address my confusion above.

Additional context

Airtable API description of my table:

Screen Shot 2023-10-10 at 1 19 28 PM

Some commands I ran (secrets removed):


create extension if not exists wrappers;

create foreign data wrapper airtable_wrapper
  handler airtable_fdw_handler
  validator airtable_fdw_validator;

-- Save your Airtable API key in Vault and retrieve the `key_id`
insert into vault.secrets (name, secret)
values (
  'airtable',
  '<Airtable API Key or PAT>' -- Airtable API key or Personal Access Token (PAT)
)
returning key_id;

create server airtable_server
  foreign data wrapper airtable_wrapper
  options (
    api_key_id '<key_ID>' -- The Key ID from above.
  );

create foreign table my_foreign_table (
  "Business Name" text,
  "City" text,
  "State" text
  --"Whatever" text
  --"Industry" text[],
  -- other fields
)
server airtable_server
options (
  base_id 'appxxxx',
  table_id 'tblxxxx'
);

SELECT 
*
 FROM my_foreign_table;

Result from that SELECT *

Business Name City State
null null null
null null null
imor commented 1 year ago

Thank you @pangolingo for your feedback. We will work on improving the docs. For now I'll share what I know here:

You have also uncovered a bug which I have reported as a separate issue. To workaround this bug, for now do not quote your column names in the create foreign table command. Unfortunately even with this workaround any columns with a space in them will not be usable from the FDW.

pangolingo commented 1 year ago

Thanks for sharing @imor, and for filing that bug!

jacobwilson41 commented 11 months ago

Hello! Is there an update on additional supported field types? Or at least a list of the current supported field types?

lij55 commented 9 months ago
  • Arrays are not supported.

Hi @imor , pgrx seems support RawArray type and some array format. is there any plan for array support for this fdw wrappers? some applications save the embeddings as array of real/double.

lij55 commented 9 months ago
impl<T: IntoDatum + FromDatum> IntoDatum for Array<'_, T> 

it seems Array of pgrx support both into and from Datum.

datoiashvili713 commented 3 months ago

so also image/attachments are not supported