Skip to content

fresioAS/sqlglot-feldera-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sqlglot-feldera-plugin

Feldera dialect plugin for SQLGlot.

This package keeps the Feldera dialect outside SQLGlot core and registers it through SQLGlot's dialect plugin entry point system, so feldera becomes available as a normal SQLGlot dialect after installation.

Installation

pip install sqlglot-feldera-plugin

Usage

After installation, the feldera dialect is available automatically in SQLGlot with no extra imports:

import sqlglot

sqlglot.parse_one("SHOW TABLES", read="feldera").sql(dialect="feldera")
# -> SHOW TABLES

sqlglot.transpile("SELECT 1 MINUS SELECT 2", read="feldera", write="postgres")[0]
# -> SELECT 1 EXCEPT SELECT 2

sqlglot.parse_one("DECLARE RECURSIVE VIEW v (id INT)", read="feldera").sql(dialect="feldera")
# -> DECLARE RECURSIVE VIEW v (id INT)

What It Supports

The current plugin covers the Feldera syntax prototyped in the upstream SQLGlot branch, including:

  • SHOW TABLES
  • EXPLAIN SELECT ...
  • DECLARE RECURSIVE VIEW
  • REMOVE FROM ... VALUES (...)
  • top-level LATENESS ...
  • column constraints like INTERNED, LATENESS, and WATERMARK
  • CREATE LOCAL VIEW
  • CREATE LINEAR AGGREGATE
  • Feldera type aliases such as BOOL, INT2, BYTEA, and DATETIME
  • Feldera-specific generation for EXCLUDE, COUNTIF, ARG_MAX, ARG_MIN, and SAFE_CAST

Scope

This plugin is focused on Feldera SQL parsing and generation inside SQLGlot. It is intended to cover the syntax needed for transpilation, formatting, and AST-based tooling. It is not coupled to any Feldera server runtime and does not attempt to validate server-side semantics beyond SQLGlot's normal parsing and generation model.

Development

git clone <your-plugin-repo>
cd sqlglot-feldera-plugin
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest

CI

The repository includes a minimal GitHub Actions workflow that installs the package and runs the standalone test suite on pull requests and pushes.

Publishing

Before publishing to GitHub or PyPI, update the placeholder URLs in pyproject.toml to point at your actual repository.

If you publish to PyPI, the typical flow is:

python -m pip install build
python -m build
python -m pip install twine
python -m twine upload dist/*

Repository Layout

  • src/sqlglot_feldera/: plugin package
  • tests/: standalone plugin tests

Notes

This package is meant to live in a standalone repository rather than inside the SQLGlot repository. That keeps ownership, release cadence, compatibility policy, and issue triage with the plugin maintainer.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors