eugenezadorin / airtable-php

Simple PHP client for Airtable API
20 stars 7 forks source link

add support for typecast option to insert query #5

Closed andrewmenich closed 2 years ago

andrewmenich commented 2 years ago

Thanks for the great package. While trying to insert a row that links to data in another record, I came across the need for the typecast parameter, which tries its best to match string data to the corresponding record ID. It works great for basic use-cases.

This PR adds a typecast() parameter to the insert() query, which accepts a boolean and defaults to true if left empty. I was going to add a test for this, but I wasn't sure how to retrieve the id of the related data, which is what gets returned upon a successful insert.

Thanks for your consideration!

eugenezadorin commented 2 years ago

Hi. Thanks for your contribution! It's very useful feature.

I noticed in the Airtable documentation that update queries also support typecast option.

Can you please provide same behavior in UpdateQuery? I will take care of the documentation and tests

andrewmenich commented 2 years ago

Absolutely - the PR has been updated with this implemented for the Update query as well. Thanks!