Duckdbwasm Vitebrowser

screenshot of Duckdbwasm Vitebrowser
vite

Barebones example of querying with duckdb-wasm using Vite and just the browser (no front-end framework). No dataset file is loaded; the data is created using the generate_series function.

Overview

DuckDB-WASM is an innovative tool that allows developers to run SQL queries directly in the browser using WebAssembly. This barebones example showcases how to query data without relying on a front-end framework, making it an excellent choice for quick prototyping or learning how to integrate SQL directly into web applications. The simplicity of running this example, combined with the power of DuckDB, opens up new avenues for data analysis right in your browser.

In this example, data is generated on-the-fly using the generate_series function, making it convenient for developers who want to work with dynamic datasets without the hassle of loading files. The example provides a user-friendly approach to running DuckDB queries and facilitates an understanding of how to efficiently manage database connections directly from the browser.

Features

  • Simple Setup: Install dependencies easily with npm i, ensuring a hassle-free start to querying data.
  • No Framework Required: Run the example using just a browser and Vite, eliminating the need for complex front-end frameworks.
  • Dynamic Data Generation: Use the generate_series function to create data on-the-fly, perfect for testing and learning without loading dataset files.
  • Basic Querying: Execute simple SQL queries or prepared statements, allowing for a straightforward introduction to SQL within the web environment.
  • Console Output: Query results are printed as JSON outputs to the console, making it easier to visualize and debug the results of database operations.
  • Flexible Bundling: Choose the appropriate bundle based on the browser in use, providing compatibility across various web environments.
  • Connection Management: Simplified lifecycle of DuckDB connections, including instantiation and proper closure, promoting good practices in resource management.
vite
Vite

Vite is a build tool that aims to provide a faster and leaner development experience for modern web projects