sqlite-parser icon indicating copy to clipboard operation
sqlite-parser copied to clipboard

Get full text of expression

Open aplarsen opened this issue 8 years ago • 2 comments

In a select statement, reconstituting any expression that isn't aliased must take some recursion to drill down and glue it back together. Up at the statement[i].result[i] level, would it be too much to ask to see the full expression here?

For example, in this query:

select
	first_name || ' ' || last_name,
	grade_level
from
	students

I'd love to see this as the return:

{
	"statement": [
		{
			"result": [
				{
					"type": "expression",
					**"fullText": "first_name || ' ' || last_name",**
					"left": "etc"
					"right": "etc"
				},
				{
					"type": "column",
					"name": "grade_level"
				}
			]
		}
	]
}

aplarsen avatar Nov 15 '16 04:11 aplarsen

If #23 gets done, you might be able pass the expression to the query generator in order to get the whole expression as a string.

karlb avatar Jan 29 '18 14:01 karlb

Ooh, definitely. I like that.

aplarsen avatar Jan 29 '18 14:01 aplarsen