davidhamann / python-fmrest

Python wrapper around the FileMaker Data API
MIT License
100 stars 27 forks source link

Provide access to the 'dataInfo' returned with each query #17

Closed steveWinter closed 4 years ago

steveWinter commented 4 years ago

In the JSON returned by FileMaker is response.dataInfo which contains details about the query just performed. Of most interest to me at this time is the foundCount which gives the number of records matching the performed query.

Knowing this allows for the records to be loaded in batches which reduces the amount of data which is sent in any given payload from FileMaker.

davidhamann commented 4 years ago

Thannks for the PR! The dataInfo, however, is already part of a Foundset instance (both regular foundsets and portal foundsets). I recently implemented this as part of v.1.2.1 (https://github.com/davidhamann/python-fmrest/issues/12#issuecomment-554668986).

Maybe you haven't seen the latest release yet? Or did I miss something?

steveWinter commented 4 years ago

You're correct that I didn't have the latest version - and now that I have it I find this shiny new feature...

Is there any documentation anywhere which might reveal other such hidden gems?

davidhamann commented 4 years ago

The docs/notebooks in examples are a bit dated and don't cover everything, unfortunately, but should still be compatible/executable in the way described.

I haven't gotten around to updating the notebooks for years. This means, for some things (dataInfo, the new perform script functionality, etc.) the code itself is the only documentation at the moment (which is a bad answer).

I'd need to go through all the examples in one session, I guess, and update them with the new stuff.

Out of curiosity: what's your take on using example notebooks as docs? Helpful or would you prefer a real documentation/wiki to look things up?

steveWinter commented 4 years ago

I know how it goes - so long as it's working for you, and you know how it work's it's all good (not a criticism - I have several open source libraries in exactly that boat :-)

While the examples are useful, I personally don't find them very good for knowing what can be done. Once I have some idea of that, then they are helpful for knowing the how.

Ideally I'd like to see an API reference which lists the various properties / methods of the various classes, so that there was some reference to look at for things like knowing the dataInfo is present (and where it is because as you saw by what I implemented that wasn't where I expected to find it), or even as simple as my previous request (#15) where you pointed out that server.last_error existed.