DashQL is a library for creating and analyzing a compact version of the PostgreSQL AST. It builds around a Bison parser that materializes AST Nodes into a single Flatbuffer vector. It can be compiled to WebAssembly and has been originally built for lightweight SQL instrumentation, running on every user keystroke in DashQL.
Each AST node is packed into 24 bytes and references matched substrings in the original script text. This encoding is compact and efficient for simple passes, but is not directly suited for a full semantic analysis.
# Dev servers.
# Hot module reloading for anything bundled with Vite.
# dashql-native:dev connects to dashql-app:dev, so run them in separate terminals.
bazel build //packages/dashql-app:dev # Run HMR dev server
bazel build //packages/dashql-native:dev # Native -> dashql-app:dev
# We bundle the web app with two routers
# - '/'-paths for GitHub pages -> :pages (CDN URL rewrite to /)
# - '#/'-paths for native apps -> :reloc
bazel build //packages/dashql-app:pages
bazel build //packages/dashql-app:reloc
# The native app can be cross-compiled for arm and x86
bazel build //packages/dashql-native:mac_universal_dmg
# Test everything
bazel test //...
# Generate compile commands for clangd in dashql-core
bazel build //:compile_commands
# Many tests are backed by snapshots / fixtures
# /snapshots/*.tpl.yaml are the input to generate /snapshots/*.yaml
# Update them using:
bazel run //snapshots/analyzer:update
bazel run //snapshots/completion:update
bazel run //snapshots/formatter:update
bazel run //snapshots/parser:update
bazel run //snapshots/plans/hyper/tests:update
bazel run //snapshots/registry:update

