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 [email protected]:crate/cratedb-sqlparse.git
cd cratedb-sqlparse
uv 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 | sh
Windows:
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.txt
or uv
uv pip install -r requirements.txt
Python:
uv run python setup_grammar.py python
Javascript:
uv run python setup_grammar.py javascript
Now 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-groups
uv run pytest
uv run poe format
In ./cratedb_sqlparse_js
run:
npm install
npm test
Releases are done on GitHub, by creating a new release every library will be built and published.
- Make sure that in
setup_grammar.py
the 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
versioningit
package.
Optionally, build the package and upload to PyPI manually.
uv run poe release
Releases 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