Libraries in this repository are not usable without building the necessary files with setup_grammar.py,
this is because the generated parser is not uploaded to the repository. Every target language, e.g:
Python or JavaScript, needs to be built independently.
The build script should not have any side effect, meaning you should be able to re-build with a different CrateDB version without any extra work.
git clone git@github.com:crate/cratedb-sqlparse.git
cd cratedb-sqlparseuv is used across the project and is the recommended dependency tool, both for building the project's grammar and the development of the Python target.
macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | shWindows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"If those options don't work, see https://docs.astral.sh/uv/getting-started/installation/
pip install -r requirements.txtor uv
uv pip install -r requirements.txtPython:
uv run python setup_grammar.py pythonJavascript:
uv run python setup_grammar.py javascriptNow libraries that were built are ready to use, every library e.g. cratedb_sqlparse_js
are on themselves different projects, with their own dependencies and
dependency management systems.
In ./cratedb_sqlparse_py run
uv sync --all-groupsuv run pytestuv run poe formatIn ./cratedb_sqlparse_js run:
npm installnpm testReleases are done on GitHub, by creating a new release every library will be built and published.
- Make sure that in
setup_grammar.pythe CrateDB version matches the one you want. - On GitHub create a new release, creating the appropriate tag and adapting the changelog.
Releases to https://pypi.org/project/cratedb-sqlparse/
Overview:
- Versioning happens automatically based on the
versioningitpackage.
Optionally, build the package and upload to PyPI manually.
uv run poe releaseReleases to https://www.npmjs.com/package/@cratedb/cratedb-sqlparse
Overview:
- Versioning is manual.
Make sure to run poe generate on the root folder first and adjust version number in package.json.
Then run:
npm install --package-lock-only &&
npm run build &&
npm login &&
npm publish