dreamfactorysoftware / dreamfactory

DreamFactory API Management Platform
https://www.dreamfactory.com
Apache License 2.0
1.56k stars 314 forks source link

Changing max_records_returned doesn't have any effect on returned data #20

Closed alexarraiza closed 8 years ago

alexarraiza commented 8 years ago

Hi,

I'm working with dreamfactory 2.0.1. When querying a SQL Server through the API, it only returns 1000 records. Searching online we found that you can change the maximum number of returned records in config/df.php modifying the following line: 'max_records_returned' => env('DF_DB_MAX_RECORDS_RETURNED', 1000), but if we modify that to 4000, we still get 1000 records.

We then found the .env file and tried uncommenting and editing this line: ##DF_DB_MAX_RECORDS_RETURNED=1000 to something higher, but it didn't work.

Oh, and we also tried decreasing the value to something like 500 on both files and it still returned 1000.

So now what? Is it even possible to change the number of returned records or will it always be 1000 per query?

Thank you!

df-arif commented 8 years ago

Please try clearing the system cache. Admin console -> config -> cache -> Flush system wide cache.

drewpearce commented 8 years ago

This is a bug that was resolved in the 2.0.3 release. You should update your installation. Instructions are available on http://wiki.dreamfactory.com

alexarraiza commented 8 years ago

Thank you!

esval commented 8 years ago

Hello!

I'm working with dreamfactory 2.0.3 and when I query a SQL Server through the API always returns the first 1000 records . As alexarraiza , I modified the following line entering 4000 as the value of config / df.php file without success.

'max_records_returned' => env('DF_DB_MAX_RECORDS_RETURNED', 4000),

I also modified and uncommented this line of .env and .env-dis files without any apparent result.

DF_DB_MAX_RECORDS_RETURNED=4000

After each change I cleaned the system cache to apply the changes . I 've also tried to restart the entire server without success. Could you tell me if I'm missing something or if I'm missing something ?

thanks!!

drewpearce commented 8 years ago

you should only have to change the value in the .env file. After you make changes to your .env file you need to run php artisan cache:clear in the the main directory (the directory where the .env file is.) Then restart the web server processes.

esval commented 8 years ago

Thank you for responding drewpearce ,

I tried to do just as you said , leaving config / df.php and .env -dist as originally , running php artisan cache: clear and restarting server processes , but the problem remains .

Any idea why it keeps happening ?

drewpearce commented 8 years ago

Best guess would be that your update wasn't fully successful. When you perform the upgrade, composer pulls in specific versions of many repositories. I'd check the repos for df-core and df-sqldb to see if they are up to date. (vendor/dreamfactory/df-core, vendor/dreamfactory/df-sqldb) You can check the changelog file in each to see what version it is. For DreamFactory 2.0.4, df-core should be on 0.1.12, and df-sqldb should be on 0.1.4. If you find this is not the case, you need to repeat the update process, outlined here: Upgrade Bitnami Upgrade Manual Install

alexarraiza commented 8 years ago

Thank you very much drewpearce, now we can set any value we want and it returns that amount, but we encountered a different problem :(

When we use more than one filter as "FIELD_1 = '%' AND FIELD_2 = '%'" it doesn't give us any results (before upgrading it returned data, and the data itself hasn't changed), but when we user only one ("FIELD_1 = '%'") it works fine.

We had to upgrade manually df-core and df-sqldb as they were not upgraded when we updated the whole dreamfactory, maybe that's the problem? The upgrade we did was simply a "git checkout master" and "git pull" on each module, and after that "php artisan cache:clear".

Any ideas? Thanks!

drewpearce commented 8 years ago

Off topic. If you have a specific bug you need addressed, you can open a new issue. However, this is not a bug. Quick answers: upgrades need to be performed using composer. See the documentation linked above. It is essential! The many repos work together in tandem. Second, filter conditions need to be enclosed in parentheses. See dox here: http://wiki.dreamfactory.com/DreamFactory/Tutorials/Querying_records_with_logical_filters (just updated)

esval commented 8 years ago

Thank you very much drewpearce, that was the problem . We had an old version both df-core and df- sqldb . After upgrading works correctly .

thanks for your time!