langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Gfrenkel/sql columns option

Open Gil-Frenkel opened this issue 1 year ago • 3 comments

Add column names to SQLDatabase.run() result

Description: Current state: SQLDatabase.run() method returns a result from the database after executing a SQL query but there is no option of adding the column names as well to the returned result.

PR offer the following solution:

Adding a argument "include_column_names_on_query" to the SQLDatabase constructor. By default, this argument will be set to False, but when set to True, SQLDatabase.run() method will add the column names to the result (if the result is not empty).

Would love to hear some feedback!

  • @hwchase17
  • @vowelparrot

Gil-Frenkel avatar May 31 '23 07:05 Gil-Frenkel

i tried to resolve merge conflicts with master, i think i did it okay?

hwchase17 avatar Jun 03 '23 22:06 hwchase17

@hwchase17 Yup! Looks great! Had to make an important fix.. see last commit (dumb mistake on my end)

Gil-Frenkel avatar Jun 04 '23 12:06 Gil-Frenkel

@hwchase17 There was a formatting issue in the lint workflow fixed that (last commit)

Gil-Frenkel avatar Jun 15 '23 12:06 Gil-Frenkel

@Gil-Frenkel Hi , could you, please, resolve the merging issues? After that ping me and I push this PR for the review. Thanks!

leo-gan avatar Sep 13 '23 20:09 leo-gan

Closing because the PR wouldn't line up with the current directory structure of the library (would need to be in /libs/langchain/langchain instead of /langchain). Feel free to reopen against the current head if it's still relevant!

efriis avatar Nov 07 '23 04:11 efriis