20 Commits

Author SHA1 Message Date
6be7829acf SQL Expressions: Allow IS keyword (#102841) 2025-03-26 09:05:42 +00:00
0f6aff2057 SQL Expressions: allow ParenSelect in queries (#102807)
sql_expressions: allow ParenSelect
2025-03-25 16:19:52 +00:00
1b1f626edd SQL Expressions: Fix error handling (#102650) 2025-03-21 18:47:00 -04:00
d7aeebe5e3 Sql Expressions: State when error is from GMS (#102112) 2025-03-18 22:41:42 +00:00
21b9d45ca6 SQL Expressions: Add CASE/WHEN nodes and fixes (and test) for functions just added to allowlist (#102040)
* SQL Expressions: Add CASE/WHEN SQL nodes to allowlist

* Fixed and test for functions added in #102011

* Add remaining functions to the test-case

These are mostly aliases, so the LLM chose to omit them originally.
But adding now for completeness

* Fix ordering of allowed nodes
2025-03-12 15:57:50 +00:00
4bd5f29e05 SQL Expressions: Allow more functions (#102011)
I used Cursor and Claude 3.7 thinking to expand the list of functions
we allow. Specifically I needed `abs`.

TODO: Check each of these in the official MySQL docs to ensure they
are all safe:
eg. this doc: https://dev.mysql.com/doc/refman/8.4/en/flow-control-functions.html#operator_case
2025-03-12 11:39:48 +00:00
4d7b9a3c77 SQL Expressions: Improve response to frame conversion handling (#100625)
- use types.Convert to get a more normalized type returned from GMS. After syncing with GMS maintainers, the underlying type of the row could be different things (e.g. int when unit32, so this calls the Convert method from the GMS types library to normalize the interface.
- Clean up fieldValFromRow more
- Use IsText to capture different string types
- Add more types to test, also update test to use same cmp.Diff method as others

---------

Co-authored-by: Sam Jewell <2903904+samjewell@users.noreply.github.com>
2025-02-14 17:21:08 +02:00
f7588376df SQL Expressions: (Chore) Update code for latest plugin-sdk data pkg (#100425)
Use new NilAt and SetRefId methods
2025-02-11 15:15:54 +00:00
6dc98dbbcc SQL Expressions: Add str_to_date function and unskip test (#100226) 2025-02-07 11:51:55 +02:00
d196b789e2 SQL Expressions: Add more SQLNodes and funcs to allow list (#100227)
sql_expr: Add more Nodes and funcs to allow list
2025-02-07 09:44:17 +00:00
d64f41afdc SQL Expressions: Re-implement feature using go-mysql-server (#99521)
* Under feature flag `sqlExpressions` and is experimental
* Excluded from arm32
* Will not work with the Query Service yet
* Does not have limits in place yet
* Does not working with alerting yet
* Currently requires "prepare time series" Transform for time series viz
 
---------

Co-authored-by: Sam Jewell <sam.jewell@grafana.com>
2025-02-06 07:27:28 -05:00
1915efbc95 SQL Expressions: Simplify where code is being stubbed out (#96227)
* Rename from DuckDB

* Remove unused function
2024-11-18 12:05:08 +00:00
ea71201ddc ServerSideExpressions: Disable SQL Expressions to prevent RCE and LFI vulnerability (#94942)
* disable sql expressions

remove duckdb ref

* Run `make update-workspace`

---------

Co-authored-by: Scott Lepper <scott.lepper@gmail.com>
2024-10-18 11:28:26 +01:00
cac40795a5 sql expressions - logging (#88193)
* sql expressions - logging
2024-05-22 17:18:46 -04:00
93acc0c932 sqlexpressions - fix escape quote (#87921) 2024-05-15 10:55:58 -04:00
14a814a280 [sql expressions] fix: use ast to read tables (#87867)
* [sql expressions] fix: use ast to read tables

* can't run tests during ci yet.  need to install duckdb

* skip for now.  need duckdb cli
2024-05-14 17:05:29 -04:00
1a2bbd61fd sql expressions: improve parser (#87277)
sql expressions: improve parser
2024-05-03 08:08:07 -04:00
cbe3e3a5e0 fix: sql expressions parser with join (#87263) 2024-05-02 14:48:05 -04:00
4fd2cb6014 fix: sql expressions - sql parser table name case (#87196)
* fix: sql parser table name case
2024-05-02 08:43:20 -04:00
70009201d4 Expressions: Sql expressions with Duckdb (#81666)
duckdb temp storage of dataframes using parquet and querying from sql expressions
---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-02-27 16:16:00 -05:00