Skip to content

Commit c848f3e

Browse files
authored
Add Fusion SQL engine (#12)
This commit adds the Fusion SQL processor that allows you to extend SQL commands beyond database operations. See the README.md file in the fusion directory for more information.
1 parent 3974dd0 commit c848f3e

File tree

19 files changed

+1688
-46
lines changed

19 files changed

+1688
-46
lines changed

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
- "3.9"
1414
- "3.10"
1515
- "3.11"
16+
- "3.12"
1617

1718
steps:
1819
- uses: actions/checkout@v3
@@ -25,7 +26,7 @@ jobs:
2526
- name: Install dependencies
2627
run: |
2728
python -m pip install --upgrade pip
28-
pip install pre-commit==2.17
29+
pip install pre-commit
2930
3031
- name: Analysing the code with pre-commit checks
3132
run: |

.github/workflows/smoke-test.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v3
1616

17+
- name: Set up Python 3.11
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: 3.11
21+
cache: "pip"
22+
1723
- name: Install dependencies
1824
run: |
1925
python --version
@@ -47,6 +53,7 @@ jobs:
4753
- "3.9"
4854
- "3.10"
4955
- "3.11"
56+
- "3.12"
5057
driver:
5158
- mysql
5259
- https
@@ -132,6 +139,12 @@ jobs:
132139
steps:
133140
- uses: actions/checkout@v3
134141

142+
- name: Set up Python 3.11
143+
uses: actions/setup-python@v4
144+
with:
145+
python-version: 3.11
146+
cache: "pip"
147+
135148
- name: Install dependencies
136149
run: |
137150
python --version

.pre-commit-config.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v4.5.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
@@ -15,31 +15,32 @@ repos:
1515
- id: double-quote-string-fixer
1616
- id: requirements-txt-fixer
1717
- repo: https://github.com/PyCQA/flake8
18-
rev: 6.0.0
18+
rev: 6.1.0
1919
hooks:
2020
- id: flake8
2121
exclude: singlestoredb/clients/pymysqlsv/
2222
additional_dependencies: [flake8-typing-imports==1.12.0]
23-
- repo: https://github.com/pre-commit/mirrors-autopep8
24-
rev: v2.0.2
23+
- repo: https://github.com/hhatto/autopep8
24+
rev: v2.0.4
2525
hooks:
2626
- id: autopep8
27+
args: [--diff]
2728
- repo: https://github.com/asottile/reorder_python_imports
28-
rev: v3.10.0
29+
rev: v3.12.0
2930
hooks:
3031
- id: reorder-python-imports
3132
args: [--py36-plus]
3233
- repo: https://github.com/asottile/add-trailing-comma
33-
rev: v3.0.0
34+
rev: v3.1.0
3435
hooks:
3536
- id: add-trailing-comma
3637
args: [--py36-plus]
3738
- repo: https://github.com/asottile/setup-cfg-fmt
38-
rev: v2.4.0
39+
rev: v2.5.0
3940
hooks:
4041
- id: setup-cfg-fmt
4142
- repo: https://github.com/pre-commit/mirrors-mypy
42-
rev: v1.4.1
43+
rev: v1.6.1
4344
hooks:
4445
- id: mypy
4546
additional_dependencies: [types-all]

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build
2+
parsimonious
23
PyJWT
34
requests
45
sqlparams

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ packages = find:
2121
install_requires =
2222
PyJWT
2323
build
24+
parsimonious
2425
requests
2526
sqlparams
2627
wheel
@@ -73,6 +74,8 @@ max-complexity = 30
7374
max-line-length = 90
7475
per-file-ignores =
7576
singlestoredb/__init__.py:F401
77+
singlestoredb/fusion/__init__.py:F401
78+
singlestoredb/fusion/grammar.py:E501
7679
singlestoredb/http/__init__.py:F401
7780
singlestoredb/management/__init__.py:F401
7881
singlestoredb/mysql/__init__.py:F401

setup.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22
"""SingleStoreDB package installer."""
3+
import os
34
import platform
45
from typing import Tuple
56

@@ -11,6 +12,8 @@
1112
py_limited_api = '0x03080000'
1213
# py_limited_api = False
1314

15+
build_extension = bool(int(os.environ.get('SINGLESTOREDB_BUILD_EXTENSION', '1')))
16+
1417
universal2_flags = ['-arch', 'x86_64', '-arch', 'arm64'] \
1518
if (
1619
platform.platform().startswith('mac') and
@@ -33,16 +36,21 @@ def get_tag(self) -> Tuple[str, str, str]:
3336
return python, abi, plat
3437

3538

36-
setup(
37-
ext_modules=[
38-
Extension(
39-
'_singlestoredb_accel',
40-
sources=['accel.c'],
41-
define_macros=[('Py_LIMITED_API', py_limited_api)] if py_limited_api else [],
42-
py_limited_api=bool(py_limited_api),
43-
extra_compile_args=universal2_flags,
44-
extra_link_args=universal2_flags,
45-
),
46-
],
47-
cmdclass={'bdist_wheel': bdist_wheel_abi3 if py_limited_api else bdist_wheel},
48-
)
39+
if build_extension:
40+
setup(
41+
ext_modules=[
42+
Extension(
43+
'_singlestoredb_accel',
44+
sources=['accel.c'],
45+
define_macros=[
46+
('Py_LIMITED_API', py_limited_api),
47+
] if py_limited_api else [],
48+
py_limited_api=bool(py_limited_api),
49+
extra_compile_args=universal2_flags,
50+
extra_link_args=universal2_flags,
51+
),
52+
],
53+
cmdclass={'bdist_wheel': bdist_wheel_abi3 if py_limited_api else bdist_wheel},
54+
)
55+
else:
56+
setup()

0 commit comments

Comments
 (0)