MarkyMan4/filequery

Feature Requests

johnnadratowski opened this issue · 2 comments

@MarkyMan4 - thanks for making that update. I was able to load my files at this point. I thought I'd chime in with a couple of feature requests. If you don't like this you can just close it, just thought I'd help.

  1. Having a -V option to output the version would be helpful. I had the wrong version installed after upgrade and I didn't realize, but I had no way to check.
  2. Having a spinner for when a query is running would be helpful as well. I ended up killing the program because I didn't realize it was running at some point
  3. While I think having it start sample size as -1 is good, I think it's really easy to allow this configuration and other DuckDB configurations using environment variables. For example, it's pretty easy to start it up like this: SAMPLE_SIZE=100 filequery -d . -e for a quicker startup time. You could also just default to a lower row count and detect the error and let the user know to start up with the env var.
  4. I added a semicolon at the end of the query and ran it, but it reported "No query to be ran". I had to remove the semicolon to run it.
  5. When opening the dialog for saving output, hitting Esc should cancel it. Right now I always have to hit enter
  6. It's a much larger request, but having autocomplete for table and field names (at least) would be huge.
  7. I'm not sure how to select other windows w/o using the mouse. It would be great to me able to use the keyboard for navigation. You could do ctrl+(j,k,h,l) for navigating to different panels, and (j,k,h,l) for navigating in the tables/query results panels.
  8. Being able to edit the output in the query results panel before saving would be a nice feature, but definitely low priority.
  9. Making each table in the tables dialog expandable to show the columns + their types would be nice. It could also show table metadata (# rows and size on disk)
  10. Selfishly would like VIM mode bindings for the query editor :-)
  11. Tabbed results output would be super nice. That way you could even run multiple queries separated by semicolons and have them come out in their own tabs
  12. Being able to copy selected columns or even entire rows from query results as a CSV delimited text
  13. This is a more advanced feature but super useful. Lets say you run a query and get query results. Having a feature where, you have a separate panel that a user can type in python code to do something with the results, or change the results themselves. You might even be able to get fancy with this and build it into the existing editor along side of the SQL. Maybe something like this:
SELECT * FROM foo PYTHON(
def preprocess(row):        # This function gets called for every row that the SQL matches
    if row['foo'] == 'bar':
        row['foo'] = 'foobar'  # Updates the row column that will be displayed in output
        return True                 # Keep the row int he output
    return False                    # Filter row from output


def postprocess(row):                                                 # This function gets called after the finalized results
     requests.post(row['url'] + /update, {json: row})  # After query runs, make an API call for each row

These are all just ideas I'm spitballing with you. They aren't in what I'd consider priority order. I understand it's difficult to be an open source maintainer. I'm just actually trying to help. If you never implement any of these, it's all good! I appreciate your contribution.

Thanks for all the suggestions, these are great! For my own organization, I'll open issues for these and I can prioritize them from there.

Regarding #4, I'm guessing your cursor was probably after the semicolon. If you keep the semicolon but have your cursor so that it's before the semicolon, it should work. The reason it works this way at the moment is that if you have multiple queries in the editor separated by semicolons and you hit F9, it runs whatever query your cursor is on. I'm working on refining this to make it a little more intuitive.

I've created most of these as their own issues so I'm going to go ahead and close this one.

One more thing regarding point 5 in your list, pressing ctrl+p will close the dialog. In the footer section I have the verbiage as "close all popups". Maybe I'll reword this to something like "close dialog" to make it more clear.