Live data from Hacker News

Instant SQL for results as you type in DuckDB UI

motherduck.com

11–20 of 124 posts

Re: Instant SQL for results as you type in DuckDB UI

#11
post #7
post #4

I hope this doesn't work with DELETE queries.

Maybe in the next version they could also implement support for DROP, with autocorrect for the nearest (not yet dropped) table name.

LLM powered queries that run in Agent mode so it can answer questions of your data before you know what to ask.

Re: Instant SQL for results as you type in DuckDB UI

#16
post #11
post #7

Earlier quoted context omitted.

Maybe in the next version they could also implement support for DROP, with autocorrect for the nearest (not yet dropped) table name.

LLM powered queries that run in Agent mode so it can answer questions of your data before you know what to ask.

That's actually not a bad idea, to have LLM autocomplete when you write queries, especially if you first add a comment at the top saying what you want to achieve:

// Select all orders for users registered in last year, and compute average earnings per user

SELECT ...

Re: Instant SQL for results as you type in DuckDB UI

#18
a fun function in duckdb (which I think they're using here) is `json_serialize_sql`. It returns a JSON AST of the SQL

    SELECT json_serialize_sql('SELECT 2');



    [
        {
            "json_serialize_sql('SELECT 2')": {
                "error": false,
                "statements": [
                    {
                        "node": {
                            "type": "SELECT_NODE",
                            "modifiers": [],
                            "cte_map": {
                                "map": []
                            },
                            "select_list": [
                                {
                                    "class": "CONSTANT",
                                    "type": "VALUE_CONSTANT",
                                    "alias": "",
                                    "query_location": 7,
                                    "value": {
                                        "type": {
                                            "id": "INTEGER",
                                            "type_info": null
                                        },
                                        "is_null": false,
                                        "value": 2
                                    }
                                }
                            ],
                            "from_table": {
                                "type": "EMPTY",
                                "alias": "",
                                "sample": null,
                                "query_location": 18446744073709551615
                            },
                            "where_clause": null,
                            "group_expressions": [],
                            "group_sets": [],
                            "aggregate_handling": "STANDARD_HANDLING",
                            "having": null,
                            "sample": null,
                            "qualify": null
                        },
                        "named_param_map": []
                    }
                ]
            }
        }
    ]

Re: Instant SQL for results as you type in DuckDB UI

#19

Will this be available in duckdb -ui ? Is mother duck editor features available on-prem? My understanding is that mother duck is a data warehouse sass.

It is already available in the local DuckDB UI! Let us know what you think!

-Customer software engineer at MotherDuck

Post reply on HN