Skip to content

Conversation

@nightscape
Copy link
Contributor

Hi @okennedy, here comes the big one 😄

This PR introduces comprehensive multi-dialect support and a powerful CLI application for parsing SQL files.

Key Features

Multi-Dialect Support

  • Oracle SQL, PostgreSQL, and ANSI SQL dialects
  • Extensible parser architecture allowing easy addition of new dialects
  • Dialect-specific parsing rules and syntax handling

CLI Application

  • Parse SQL files with configurable output formats (text, JSON, JQ queries)
  • Glob pattern support for batch processing
  • Error recovery for unparseable statements with accurate line number tracking
  • Flexible output destinations (console or file)

Architecture Improvements

  • Refactored package structure under sparsity.common.* for better organization
  • Moved parser logic from Elements to SQLBase for better extensibility
  • Added Circe-based JSON encoding for all AST types

Build System

  • Updated to SBT 1.11.7 with assembly plugin for standalone JARs
  • Cross-compilation for Scala 2.12, 2.13, and 3.3
  • Added scalafmt for consistent code formatting

Breaking Changes

The package structure has been reorganized:

  • Core types moved to sparsity.common.*
  • Parser classes in sparsity.common.parser.*
  • Dialect-specific implementations in separate packages

Testing

Comprehensive test suite including Oracle-specific tests with real-world SQL examples.

@nightscape nightscape force-pushed the dialects branch 4 times, most recently from 2c10a5a to 3d188c7 Compare December 1, 2025 11:59
@okennedy
Copy link
Member

Sorry for the delay. End of semester is sucking up a lot of my time. I will get to this soon™.

@okennedy
Copy link
Member

okennedy commented Jan 5, 2026

Hi @nightscape . My goal with sparsity was to create something fairly lightweight and limited in scope. This PR adds a ton of functionality (this is good), but also a substantial number of dependencies (this is less good).

I strongly encourage you to fork Sparsity as a base for your efforts! However, I am reluctant to merge additional dependencies (particularly ones that involve system binaries) here.

@okennedy okennedy closed this Jan 5, 2026
@nightscape nightscape deleted the dialects branch January 5, 2026 16:56
@nightscape
Copy link
Contributor Author

nightscape commented Jan 5, 2026

Hi @okennedy , I already assumed so.
I created a fork called sequala and mentioned sparsity as the base for my fork. Its feature set and code size has grown substantially, my plan is to make it a Swiss army knife for all things SQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants