Instant SQL for results as you type in DuckDB UI
MotherDuck has launched Instant SQL, a feature that offers real-time result previews, immediate feedback on queries, supports multiple data sources, and includes AI suggestions, currently in preview mode for users.
Read original articleMotherDuck has introduced Instant SQL, a new feature designed to enhance the SQL query writing experience by providing real-time result previews as users type. This innovation aims to address the tedious nature of traditional SQL interactions, which often involve a repetitive cycle of drafting, running, and waiting for results. Instant SQL allows users to explore data dynamically, making it easier to debug complex queries and visualize changes instantly. Key functionalities include real-time previews of result sets, immediate feedback on Common Table Expressions (CTEs), and the ability to dissect complex column expressions. Additionally, it supports querying various data sources beyond just DuckDB tables, such as parquet files and databases like Postgres and MySQL. The feature also integrates AI suggestions for query edits, allowing users to see the impact of changes immediately. Instant SQL is currently available in preview mode for MotherDuck and DuckDB Local UI users, promising to streamline the SQL workflow significantly.
- Instant SQL provides real-time result previews as users type, enhancing query building.
- It allows for immediate feedback on CTEs and complex column expressions, simplifying debugging.
- The feature supports querying multiple data sources, not limited to DuckDB tables.
- AI-powered suggestions can be applied instantly, improving the editing process.
- Instant SQL is available in preview mode for users of MotherDuck and DuckDB Local UI.
Related
pg_duckdb: Splicing Duck and Elephant DNA
MotherDuck launched pg_duckdb, an open-source extension integrating DuckDB with Postgres to enhance analytical capabilities while maintaining transactional efficiency, supported by a consortium of companies and community contributions.
DuckDB 1.1.0 Released
DuckDB 1.1.0, codenamed "Eatoni," introduces significant updates including new SQL functionalities, improved community extensions, and performance enhancements, aiming to enhance user experience and efficiency in data analysis.
The Prompt() Function: Use the Power of LLMs with SQL
MotherDuck's prompt() function integrates small language models into SQL, enabling efficient bulk text summarization and structured data extraction, significantly reducing processing times and allowing customizable output formats.
DuckDB and WebAssembly = WhatTheDuck
WhatTheDuck is a browser-based tool for running DuckDB using WebAssembly, allowing users to analyze data quickly and privately by uploading CSV files and executing SQL queries without local installations.
The DuckDB Local UI
DuckDB has released a local web user interface in version 1.2.1, enabling users to run SQL queries locally with features like interactive notebooks, column exploration, and cloud integration options.
- Users praise the craftsmanship and ingenuity behind the feature, highlighting its potential for enhancing SQL usability.
- There is a strong desire for a pipe syntax in SQL, with several users expressing that it would improve code readability and completion.
- Concerns are raised about limitations in sharing and exporting notebooks, which some users find restrictive.
- Feedback on the feature's performance with complex queries and the handling of CTEs indicates a need for further refinement.
- Overall, users appreciate the instant feedback capability, noting its potential to ease the learning curve for SQL beginners.
Awesome video of feature: https://youtu.be/aFDUlyeMBc8
Disclaimer: I’m a co-founder at MotherDuck.
Example:
FROM orders |> WHERE order_date >= '2024-01-01' |> AGGREGATE SUM(order_amount) AS total_spent GROUP BY customer_id |> WHERE total_spent > 1000 |> INNER JOIN customers USING(customer_id) |> CALL ENRICH.APOLLO(EMAIL > customers.email) |> AGGREGATE COUNT(*) high_value_customer GROUP BY company.country
Why is it a killer feature? First of all, LLMs complete text from left to right. That alone is a killer feature.
But for us meatboxes with less compute power, pipe syntax allow (much better) code completion.
Pipe syntax is delightful to work with and makes going back to SQL a real bummer moment (please insert meme of Kate Perry kissing the earth here).
1. https://github.com/manifold-systems/manifold/blob/master/man...
Except for system performance data.
You can checkout our sandbox at
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": []
}
]
}
}
]
I'm assuming it's more of a user preference like commas in front of the field instead of after field?
Is mother duck editor features available on-prem? My understanding is that mother duck is a data warehouse sass.
I think this would be better if it was combined with information about valid words in the cursor position, which would likely be a bit more involved but achievable through querying the schema and settling on a subset of SQL. It would help people that aren't already fluent in SQL to extract the data they want. Perhaps allow them to click the suggestions to add them to the query.
I've done partial implementations of this too, that query the schema for table or column names. It's very cheap even on large, complex schemas, so it's fine to just throw every change at the database and check what drops out. In practice I didn't get much out of either beyond the fun of hacking up an ephemeral tool, or I would probably have built some small product around it.
I spent the first two quarters of 2024 working on observability for a build-the-plane-as-you-fly-it style project. I can’t express how useful the cte preview would have been for debugging.
(129304 rows affected)
Related
pg_duckdb: Splicing Duck and Elephant DNA
MotherDuck launched pg_duckdb, an open-source extension integrating DuckDB with Postgres to enhance analytical capabilities while maintaining transactional efficiency, supported by a consortium of companies and community contributions.
DuckDB 1.1.0 Released
DuckDB 1.1.0, codenamed "Eatoni," introduces significant updates including new SQL functionalities, improved community extensions, and performance enhancements, aiming to enhance user experience and efficiency in data analysis.
The Prompt() Function: Use the Power of LLMs with SQL
MotherDuck's prompt() function integrates small language models into SQL, enabling efficient bulk text summarization and structured data extraction, significantly reducing processing times and allowing customizable output formats.
DuckDB and WebAssembly = WhatTheDuck
WhatTheDuck is a browser-based tool for running DuckDB using WebAssembly, allowing users to analyze data quickly and privately by uploading CSV files and executing SQL queries without local installations.
The DuckDB Local UI
DuckDB has released a local web user interface in version 1.2.1, enabling users to run SQL queries locally with features like interactive notebooks, column exploration, and cloud integration options.