eugenezadorin / airtable-php Goto Github PK
View Code? Open in Web Editor NEWSimple PHP client for Airtable API
Simple PHP client for Airtable API
Hi,
I really appreciate your client and I would like to use it for a project but there is an edge case that is not handled: for record retrieval requests longer than 16,000 chars (e.g. when having lots of conditions or fields to retrieve) the GET will fail, the 16,000 GET request is an Airtable limit and the only possible documented workaround is to do the request as a POST with the parameters in the body
See https://airtable.com/developers/web/api/list-records :
Note Airtable's API only accepts request with a URL shorter than 16,000 characters. Encoded formulas may cause your requests to exceed this limit. To fix this issue you can instead make a POST request to /v0/{baseId}/{tableIdOrName}/listRecords while passing the parameters within the body of the request instead of the query parameters.
I think this is something specific of SelectQuery
so this code should go there. Unfortunately there is no way currently to know if the final URI will be > 16,000 chars so I think there are 2 ways:
Client
provide this information adding a getBaseUri()
(which is what is missing to calculate the complete uri length) or getCompleteUri(string $uri)
to Client or getCompleteUriLength(string $uri)
method. This way the decision whether to switch to POST could be done transparently by SelectQuery
by looking at the final URI length.SelectQuery
If you are ok with any of these two methods (I think the first is more in line with the library) I can provide a patch.
Hi!
I wanted to provide some pull requests for this library.
I copied the readonly database to my own account after forking this repo and 11 of the 83 tests failed.
Is there something wrong with the database or are the tests also failing on your end?
Please let me know.
It will be extra package containing Laravel service provider, I guess.
Hi,
Is there any plan to migrate the deprecated API keys to Personal Access Token usage?
It seems like there is no option to add a view name on the query.
Something like
$query = $client->table($able)->view("my view")->execute()
would be very handy.
It would be helpful if you set $this->handler to initialize curl within the construct instead of within the send method so that the entire send method does not have to be replaced just to use different curl options.
How are you?
Nice to meet you.
I found a critical issue in your code. You mentioned only >, !=, =, <, and so on in Query builder.
But for example, if I want to find data that contains a specific string from A column, then how can I build a Query?
Please let me know.
Thanks.
when throwing the InvalidArgument Exception for an invalid URI in Request::setURI it would be nice to have the invalid URI for debug purposes in the exception message:
Request, line 22:
throw new Errors\InvalidArgument('Invalid URI: ' . $uri);
It would be useful to debug request/response from to the Client.
My proposal is to add a third optional $options = array()
parameter to the Client contructor and use "http_debug" and "http_debug_file" options to use curl debug features.
Something like...
Airtable::macro('whereSomethingDomainSpecific', function ($val) {
return $this->whereRaw('...');
});
Currently when using a table name using a non valid URI string (e.g. $client->table('NAME WITH SPACE')
) an Exception is thrown when on Request::setUri
method
in my opinion it should be Client responsability to automatically url encode table names that may easily contain non URI valid chars, line 122 sould be
$baseUri = sprintf('%s/%s/%s', self::BASE_URL, $this->databaseName, urlencode($this->tableName));
instead of
$baseUri = sprintf('%s/%s/%s', self::BASE_URL, $this->databaseName, $this->tableName);
I have a column that contains dates but I can't fetch the arrays based on the date format.
$dataFDU = $client->table($tableName) ->select('*') ->where(["Deadline" => "2022-04-02"]) ->execute();
Here is my workaround which returns an empty array. Some help will be appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.