Live data from Hacker News

Instant SQL for results as you type in DuckDB UI

motherduck.com

31–40 of 124 posts

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

#31

Delete From dbo.users w... (129304 rows affected)

The blog specifically says that they're getting the SQL AST so presumably they would not execute something like a DELETE.

Cool. Now, there's this thing called a joke...

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

#32

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": { "t…

This is a very cool feature. I don't know how useful it is or how I'd use it right now but I think I am going to get into some benchmarking and performance tweaking soon and this could be handy.

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

#33
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.

DELETED 0 rows. Did you mean `where 1=1`? (click accept to re-run with new where clause)

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

#34

Please finally add q language with proper integration to your tables so that our precious q-SQL is available there. Stop reinventing the wheel, let's at least catch up to the previous generation (in terms of convenience). Make the final step.

What is q-SQL?

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

#37
I really like duckdb's notebooks for exploration and this feature makes them even more awesome, but the fact that I can't share, export or commit them into a git repo feels extremely limiting. It's neat-ish that it dodfoods and store them in a duckdb database. It even seems to stores historical versions, but I can't really do anything with it..

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

#38

This is such a bizarre feature.

On first glance possibly, on second glance not at all.

First, repeat data analyst queries are a usage driver in SQL DBs. Think iterating the code and executing again.

Another huge factor in the same vein is running dev pipelines with limited data to validate a change works when modelling complex data.

This is currently a FE feature, but underneath lies effective caching.

The underlying tech is driving down usage cost which is a big thing for data practitioners.

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

#39
post #2

In DuckDB UI and MotherDuck. Awesome video of feature: https://youtu.be/aFDUlyeMBc8 Disclaimer: I’m a co-founder at MotherDuck.

Thanks for sharing this update with the world and including it on the local ui too.

Feature request: enable the tuning of when Instant SQL is run and displayed. The erroring out with flashing updates at nearly every keystoke while expanding on a query is distracting for me personally (my brain goes into troubleshooting vs thinking mode). I like the feature (so I will keep it on by default), but I’d like to have a few modes for it depending on my working context (specifically tuning of update frequency at separation characters [space, comma], end of statement [semicolon/newline], and injections [paste/autocomplete]).

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

#40
post #22

First time seeing the from at the top of the query and I am not sure how I feel about it. It seems useful but I am so used to select...from. I'm assuming it's more of a user preference like commas in front of the field instead of after field?

Yes it comes from a desire to impose intuition from other contexts onto something instead of building intuition with that thing. SQL is a declarative language. The ordering of the statements was carefully thought through. I will say it's harmless though, the clauses don't have any dependency in terms of meaning so it's fine to just allow them to be reordered in terms of the meaning of the query, but that's true of lo…

[deleted]
Post reply on HN