Giter Club home page Giter Club logo

airtable-php's Issues

Record retrieval queries longer than 16,000 chars not handled

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:

  • Let 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.
  • Let users force "POST" on 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.

Add View on Query Param

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.

Set $this->handler in Request within the construct

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.

There is a critical issue in your code.

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.

Include invalid URI in Request::setUri invalid URI Exception

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);

Add debug options to Client

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.

Invalid Request URI and table names

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);

Date format is not working with where method

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.