sqloxide 0.1.48__tar.gz → 0.1.54__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sqloxide-0.1.48 → sqloxide-0.1.54}/.bumpversion.cfg +1 -1
- {sqloxide-0.1.48 → sqloxide-0.1.54}/.github/workflows/build.yaml +16 -5
- {sqloxide-0.1.48 → sqloxide-0.1.54}/Cargo.lock +94 -87
- {sqloxide-0.1.48 → sqloxide-0.1.54}/Cargo.toml +4 -4
- {sqloxide-0.1.48 → sqloxide-0.1.54}/PKG-INFO +2 -2
- sqloxide-0.1.54/justfile +8 -0
- sqloxide-0.1.54/poetry.lock +7 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/pyproject.toml +1 -1
- sqloxide-0.1.54/sqloxide.pyi +210 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/src/lib.rs +5 -6
- {sqloxide-0.1.48 → sqloxide-0.1.54}/src/visitor.rs +9 -9
- sqloxide-0.1.48/justfile +0 -8
- sqloxide-0.1.48/poetry.lock +0 -7
- {sqloxide-0.1.48 → sqloxide-0.1.54}/.cargo/config.toml +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/.github/dependabot.yml +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/.github/workflows/build-wheels.sh +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/.github/workflows/ci.yml +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/.gitignore +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/CHANGELOG.md +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/LICENSE +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/MANIFEST.in +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/examples/depgraph.py +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/examples/visitor.py +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/readme.md +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/rust-toolchain +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/sqloxide/__init__.py +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/tests/benchmark.py +0 -0
- {sqloxide-0.1.48 → sqloxide-0.1.54}/tests/test_sqloxide.py +0 -0
|
@@ -19,7 +19,7 @@ jobs:
|
|
|
19
19
|
maturin-version: latest
|
|
20
20
|
command: build
|
|
21
21
|
manylinux: auto
|
|
22
|
-
args: --release --sdist -i 3.8 3.9 3.10 3.11 3.12
|
|
22
|
+
args: --release --sdist -i 3.8 3.9 3.10 3.11 3.12 3.13
|
|
23
23
|
- uses: actions/upload-artifact@v4
|
|
24
24
|
with:
|
|
25
25
|
name: linux-wheels-${{ matrix.target }}
|
|
@@ -29,7 +29,7 @@ jobs:
|
|
|
29
29
|
runs-on: macos-latest
|
|
30
30
|
strategy:
|
|
31
31
|
matrix:
|
|
32
|
-
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
|
|
32
|
+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
|
|
33
33
|
steps:
|
|
34
34
|
- uses: actions/checkout@v1
|
|
35
35
|
- uses: actions-rs/toolchain@v1
|
|
@@ -50,6 +50,9 @@ jobs:
|
|
|
50
50
|
|
|
51
51
|
windows-wheels:
|
|
52
52
|
runs-on: windows-latest
|
|
53
|
+
strategy:
|
|
54
|
+
matrix:
|
|
55
|
+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
|
|
53
56
|
steps:
|
|
54
57
|
- uses: actions/checkout@v1
|
|
55
58
|
- uses: actions-rs/toolchain@v1
|
|
@@ -57,13 +60,15 @@ jobs:
|
|
|
57
60
|
toolchain: nightly
|
|
58
61
|
default: true
|
|
59
62
|
- uses: actions/setup-python@v2
|
|
63
|
+
with:
|
|
64
|
+
python-version: ${{ matrix.python-version }}
|
|
60
65
|
- name: Build wheels
|
|
61
66
|
run: |
|
|
62
67
|
python -m pip install maturin
|
|
63
68
|
maturin build --release
|
|
64
69
|
- uses: actions/upload-artifact@v4
|
|
65
70
|
with:
|
|
66
|
-
name: windows-
|
|
71
|
+
name: windows-${{ matrix.python-version }}-wheel
|
|
67
72
|
path: target/wheels
|
|
68
73
|
|
|
69
74
|
push:
|
|
@@ -80,12 +85,18 @@ jobs:
|
|
|
80
85
|
- run: mv ./linux-wheels-x86_64/* wheels
|
|
81
86
|
- run: mv ./linux-wheels-i686/* wheels
|
|
82
87
|
- run: mv ./linux-wheels-aarch64/* wheels
|
|
88
|
+
- run: mv ./osx-3.13-wheel/* wheels
|
|
83
89
|
- run: mv ./osx-3.12-wheel/* wheels
|
|
84
90
|
- run: mv ./osx-3.11-wheel/* wheels
|
|
85
91
|
- run: mv ./osx-3.10-wheel/* wheels
|
|
86
92
|
- run: mv ./osx-3.9-wheel/* wheels
|
|
87
93
|
- run: mv ./osx-3.8-wheel/* wheels
|
|
88
|
-
- run: mv ./windows-
|
|
94
|
+
- run: mv ./windows-3.13-wheel/* wheels
|
|
95
|
+
- run: mv ./windows-3.12-wheel/* wheels
|
|
96
|
+
- run: mv ./windows-3.11-wheel/* wheels
|
|
97
|
+
- run: mv ./windows-3.10-wheel/* wheels
|
|
98
|
+
- run: mv ./windows-3.9-wheel/* wheels
|
|
99
|
+
- run: mv ./windows-3.8-wheel/* wheels
|
|
89
100
|
|
|
90
101
|
|
|
91
102
|
- name: Publish a Python distribution to PyPI
|
|
@@ -93,4 +104,4 @@ jobs:
|
|
|
93
104
|
with:
|
|
94
105
|
password: ${{ secrets.PYPI }}
|
|
95
106
|
packages_dir: wheels/
|
|
96
|
-
verify_metadata: false
|
|
107
|
+
verify_metadata: false
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
# This file is automatically @generated by Cargo.
|
|
2
2
|
# It is not intended for manual editing.
|
|
3
|
-
version =
|
|
3
|
+
version = 4
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "autocfg"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.4.0"
|
|
8
8
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
-
checksum = "
|
|
9
|
+
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
|
|
10
10
|
|
|
11
11
|
[[package]]
|
|
12
|
-
name = "
|
|
13
|
-
version = "2.
|
|
12
|
+
name = "cc"
|
|
13
|
+
version = "1.2.11"
|
|
14
14
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
-
checksum = "
|
|
15
|
+
checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf"
|
|
16
|
+
dependencies = [
|
|
17
|
+
"shlex",
|
|
18
|
+
]
|
|
16
19
|
|
|
17
20
|
[[package]]
|
|
18
21
|
name = "cfg-if"
|
|
@@ -22,9 +25,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|
|
22
25
|
|
|
23
26
|
[[package]]
|
|
24
27
|
name = "heck"
|
|
25
|
-
version = "0.
|
|
28
|
+
version = "0.5.0"
|
|
26
29
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
-
checksum = "
|
|
30
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
28
31
|
|
|
29
32
|
[[package]]
|
|
30
33
|
name = "indoc"
|
|
@@ -34,25 +37,15 @@ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
|
|
|
34
37
|
|
|
35
38
|
[[package]]
|
|
36
39
|
name = "libc"
|
|
37
|
-
version = "0.2.
|
|
40
|
+
version = "0.2.169"
|
|
38
41
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
39
|
-
checksum = "
|
|
40
|
-
|
|
41
|
-
[[package]]
|
|
42
|
-
name = "lock_api"
|
|
43
|
-
version = "0.4.12"
|
|
44
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
45
|
-
checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
|
|
46
|
-
dependencies = [
|
|
47
|
-
"autocfg",
|
|
48
|
-
"scopeguard",
|
|
49
|
-
]
|
|
42
|
+
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
|
|
50
43
|
|
|
51
44
|
[[package]]
|
|
52
45
|
name = "log"
|
|
53
|
-
version = "0.4.
|
|
46
|
+
version = "0.4.25"
|
|
54
47
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
55
|
-
checksum = "
|
|
48
|
+
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
|
|
56
49
|
|
|
57
50
|
[[package]]
|
|
58
51
|
name = "memoffset"
|
|
@@ -65,59 +58,45 @@ dependencies = [
|
|
|
65
58
|
|
|
66
59
|
[[package]]
|
|
67
60
|
name = "once_cell"
|
|
68
|
-
version = "1.
|
|
61
|
+
version = "1.20.2"
|
|
69
62
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
70
|
-
checksum = "
|
|
63
|
+
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
|
|
71
64
|
|
|
72
65
|
[[package]]
|
|
73
|
-
name = "
|
|
74
|
-
version = "
|
|
66
|
+
name = "portable-atomic"
|
|
67
|
+
version = "1.10.0"
|
|
75
68
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
76
|
-
checksum = "
|
|
77
|
-
dependencies = [
|
|
78
|
-
"lock_api",
|
|
79
|
-
"parking_lot_core",
|
|
80
|
-
]
|
|
69
|
+
checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6"
|
|
81
70
|
|
|
82
71
|
[[package]]
|
|
83
|
-
name = "
|
|
84
|
-
version = "0.
|
|
72
|
+
name = "proc-macro2"
|
|
73
|
+
version = "1.0.93"
|
|
85
74
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
86
|
-
checksum = "
|
|
75
|
+
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
|
|
87
76
|
dependencies = [
|
|
88
|
-
"
|
|
89
|
-
"libc",
|
|
90
|
-
"redox_syscall",
|
|
91
|
-
"smallvec",
|
|
92
|
-
"windows-targets",
|
|
77
|
+
"unicode-ident",
|
|
93
78
|
]
|
|
94
79
|
|
|
95
80
|
[[package]]
|
|
96
|
-
name = "
|
|
97
|
-
version = "1.
|
|
98
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
99
|
-
checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265"
|
|
100
|
-
|
|
101
|
-
[[package]]
|
|
102
|
-
name = "proc-macro2"
|
|
103
|
-
version = "1.0.86"
|
|
81
|
+
name = "psm"
|
|
82
|
+
version = "0.1.24"
|
|
104
83
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
105
|
-
checksum = "
|
|
84
|
+
checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810"
|
|
106
85
|
dependencies = [
|
|
107
|
-
"
|
|
86
|
+
"cc",
|
|
108
87
|
]
|
|
109
88
|
|
|
110
89
|
[[package]]
|
|
111
90
|
name = "pyo3"
|
|
112
|
-
version = "0.
|
|
91
|
+
version = "0.22.6"
|
|
113
92
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
114
|
-
checksum = "
|
|
93
|
+
checksum = "f402062616ab18202ae8319da13fa4279883a2b8a9d9f83f20dbade813ce1884"
|
|
115
94
|
dependencies = [
|
|
116
95
|
"cfg-if",
|
|
117
96
|
"indoc",
|
|
118
97
|
"libc",
|
|
119
98
|
"memoffset",
|
|
120
|
-
"
|
|
99
|
+
"once_cell",
|
|
121
100
|
"portable-atomic",
|
|
122
101
|
"pyo3-build-config",
|
|
123
102
|
"pyo3-ffi",
|
|
@@ -127,9 +106,9 @@ dependencies = [
|
|
|
127
106
|
|
|
128
107
|
[[package]]
|
|
129
108
|
name = "pyo3-build-config"
|
|
130
|
-
version = "0.
|
|
109
|
+
version = "0.22.6"
|
|
131
110
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
132
|
-
checksum = "
|
|
111
|
+
checksum = "b14b5775b5ff446dd1056212d778012cbe8a0fbffd368029fd9e25b514479c38"
|
|
133
112
|
dependencies = [
|
|
134
113
|
"once_cell",
|
|
135
114
|
"target-lexicon",
|
|
@@ -137,9 +116,9 @@ dependencies = [
|
|
|
137
116
|
|
|
138
117
|
[[package]]
|
|
139
118
|
name = "pyo3-ffi"
|
|
140
|
-
version = "0.
|
|
119
|
+
version = "0.22.6"
|
|
141
120
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
142
|
-
checksum = "
|
|
121
|
+
checksum = "9ab5bcf04a2cdcbb50c7d6105de943f543f9ed92af55818fd17b660390fc8636"
|
|
143
122
|
dependencies = [
|
|
144
123
|
"libc",
|
|
145
124
|
"pyo3-build-config",
|
|
@@ -147,9 +126,9 @@ dependencies = [
|
|
|
147
126
|
|
|
148
127
|
[[package]]
|
|
149
128
|
name = "pyo3-macros"
|
|
150
|
-
version = "0.
|
|
129
|
+
version = "0.22.6"
|
|
151
130
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
152
|
-
checksum = "
|
|
131
|
+
checksum = "0fd24d897903a9e6d80b968368a34e1525aeb719d568dba8b3d4bfa5dc67d453"
|
|
153
132
|
dependencies = [
|
|
154
133
|
"proc-macro2",
|
|
155
134
|
"pyo3-macros-backend",
|
|
@@ -159,9 +138,9 @@ dependencies = [
|
|
|
159
138
|
|
|
160
139
|
[[package]]
|
|
161
140
|
name = "pyo3-macros-backend"
|
|
162
|
-
version = "0.
|
|
141
|
+
version = "0.22.6"
|
|
163
142
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
164
|
-
checksum = "
|
|
143
|
+
checksum = "36c011a03ba1e50152b4b394b479826cad97e7a21eb52df179cd91ac411cbfbe"
|
|
165
144
|
dependencies = [
|
|
166
145
|
"heck",
|
|
167
146
|
"proc-macro2",
|
|
@@ -172,9 +151,9 @@ dependencies = [
|
|
|
172
151
|
|
|
173
152
|
[[package]]
|
|
174
153
|
name = "pythonize"
|
|
175
|
-
version = "0.
|
|
154
|
+
version = "0.22.0"
|
|
176
155
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
177
|
-
checksum = "
|
|
156
|
+
checksum = "90fcf491425978bd889015d5430f6473d91bdfa2097262f1e731aadcf6c2113e"
|
|
178
157
|
dependencies = [
|
|
179
158
|
"pyo3",
|
|
180
159
|
"serde",
|
|
@@ -182,42 +161,47 @@ dependencies = [
|
|
|
182
161
|
|
|
183
162
|
[[package]]
|
|
184
163
|
name = "quote"
|
|
185
|
-
version = "1.0.
|
|
164
|
+
version = "1.0.38"
|
|
186
165
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
187
|
-
checksum = "
|
|
166
|
+
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
|
|
188
167
|
dependencies = [
|
|
189
168
|
"proc-macro2",
|
|
190
169
|
]
|
|
191
170
|
|
|
192
171
|
[[package]]
|
|
193
|
-
name = "
|
|
194
|
-
version = "0.
|
|
172
|
+
name = "recursive"
|
|
173
|
+
version = "0.1.1"
|
|
195
174
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
196
|
-
checksum = "
|
|
175
|
+
checksum = "0786a43debb760f491b1bc0269fe5e84155353c67482b9e60d0cfb596054b43e"
|
|
197
176
|
dependencies = [
|
|
198
|
-
"
|
|
177
|
+
"recursive-proc-macro-impl",
|
|
178
|
+
"stacker",
|
|
199
179
|
]
|
|
200
180
|
|
|
201
181
|
[[package]]
|
|
202
|
-
name = "
|
|
203
|
-
version = "1.
|
|
182
|
+
name = "recursive-proc-macro-impl"
|
|
183
|
+
version = "0.1.1"
|
|
204
184
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
205
|
-
checksum = "
|
|
185
|
+
checksum = "76009fbe0614077fc1a2ce255e3a1881a2e3a3527097d5dc6d8212c585e7e38b"
|
|
186
|
+
dependencies = [
|
|
187
|
+
"quote",
|
|
188
|
+
"syn",
|
|
189
|
+
]
|
|
206
190
|
|
|
207
191
|
[[package]]
|
|
208
192
|
name = "serde"
|
|
209
|
-
version = "1.0.
|
|
193
|
+
version = "1.0.217"
|
|
210
194
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
211
|
-
checksum = "
|
|
195
|
+
checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70"
|
|
212
196
|
dependencies = [
|
|
213
197
|
"serde_derive",
|
|
214
198
|
]
|
|
215
199
|
|
|
216
200
|
[[package]]
|
|
217
201
|
name = "serde_derive"
|
|
218
|
-
version = "1.0.
|
|
202
|
+
version = "1.0.217"
|
|
219
203
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
220
|
-
checksum = "
|
|
204
|
+
checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
|
|
221
205
|
dependencies = [
|
|
222
206
|
"proc-macro2",
|
|
223
207
|
"quote",
|
|
@@ -225,14 +209,14 @@ dependencies = [
|
|
|
225
209
|
]
|
|
226
210
|
|
|
227
211
|
[[package]]
|
|
228
|
-
name = "
|
|
229
|
-
version = "1.
|
|
212
|
+
name = "shlex"
|
|
213
|
+
version = "1.3.0"
|
|
230
214
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
231
|
-
checksum = "
|
|
215
|
+
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
|
232
216
|
|
|
233
217
|
[[package]]
|
|
234
218
|
name = "sqloxide"
|
|
235
|
-
version = "0.1.
|
|
219
|
+
version = "0.1.54"
|
|
236
220
|
dependencies = [
|
|
237
221
|
"pyo3",
|
|
238
222
|
"pythonize",
|
|
@@ -242,31 +226,45 @@ dependencies = [
|
|
|
242
226
|
|
|
243
227
|
[[package]]
|
|
244
228
|
name = "sqlparser"
|
|
245
|
-
version = "0.
|
|
229
|
+
version = "0.54.0"
|
|
246
230
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
247
|
-
checksum = "
|
|
231
|
+
checksum = "c66e3b7374ad4a6af849b08b3e7a6eda0edbd82f0fd59b57e22671bf16979899"
|
|
248
232
|
dependencies = [
|
|
249
233
|
"log",
|
|
234
|
+
"recursive",
|
|
250
235
|
"serde",
|
|
251
236
|
"sqlparser_derive",
|
|
252
237
|
]
|
|
253
238
|
|
|
254
239
|
[[package]]
|
|
255
240
|
name = "sqlparser_derive"
|
|
256
|
-
version = "0.
|
|
241
|
+
version = "0.3.0"
|
|
257
242
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
258
|
-
checksum = "
|
|
243
|
+
checksum = "da5fc6819faabb412da764b99d3b713bb55083c11e7e0c00144d386cd6a1939c"
|
|
259
244
|
dependencies = [
|
|
260
245
|
"proc-macro2",
|
|
261
246
|
"quote",
|
|
262
247
|
"syn",
|
|
263
248
|
]
|
|
264
249
|
|
|
250
|
+
[[package]]
|
|
251
|
+
name = "stacker"
|
|
252
|
+
version = "0.1.17"
|
|
253
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
254
|
+
checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b"
|
|
255
|
+
dependencies = [
|
|
256
|
+
"cc",
|
|
257
|
+
"cfg-if",
|
|
258
|
+
"libc",
|
|
259
|
+
"psm",
|
|
260
|
+
"windows-sys",
|
|
261
|
+
]
|
|
262
|
+
|
|
265
263
|
[[package]]
|
|
266
264
|
name = "syn"
|
|
267
|
-
version = "2.0.
|
|
265
|
+
version = "2.0.98"
|
|
268
266
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
269
|
-
checksum = "
|
|
267
|
+
checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1"
|
|
270
268
|
dependencies = [
|
|
271
269
|
"proc-macro2",
|
|
272
270
|
"quote",
|
|
@@ -281,9 +279,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
|
|
|
281
279
|
|
|
282
280
|
[[package]]
|
|
283
281
|
name = "unicode-ident"
|
|
284
|
-
version = "1.0.
|
|
282
|
+
version = "1.0.16"
|
|
285
283
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
286
|
-
checksum = "
|
|
284
|
+
checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034"
|
|
287
285
|
|
|
288
286
|
[[package]]
|
|
289
287
|
name = "unindent"
|
|
@@ -291,6 +289,15 @@ version = "0.2.3"
|
|
|
291
289
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
292
290
|
checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
|
|
293
291
|
|
|
292
|
+
[[package]]
|
|
293
|
+
name = "windows-sys"
|
|
294
|
+
version = "0.59.0"
|
|
295
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
296
|
+
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
|
|
297
|
+
dependencies = [
|
|
298
|
+
"windows-targets",
|
|
299
|
+
]
|
|
300
|
+
|
|
294
301
|
[[package]]
|
|
295
302
|
name = "windows-targets"
|
|
296
303
|
version = "0.52.6"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "sqloxide"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.54"
|
|
4
4
|
authors = ["Will Eaton <me@wseaton.com>"]
|
|
5
5
|
edition = "2021"
|
|
6
6
|
|
|
@@ -9,13 +9,13 @@ name = "sqloxide"
|
|
|
9
9
|
crate-type = ["cdylib"]
|
|
10
10
|
|
|
11
11
|
[dependencies]
|
|
12
|
-
pythonize = "0.
|
|
12
|
+
pythonize = "0.22"
|
|
13
13
|
serde = "1.0.171"
|
|
14
14
|
|
|
15
15
|
[dependencies.pyo3]
|
|
16
|
-
version = "0.
|
|
16
|
+
version = "0.22"
|
|
17
17
|
features = ["extension-module"]
|
|
18
18
|
|
|
19
19
|
[dependencies.sqlparser]
|
|
20
|
-
version = "0.
|
|
20
|
+
version = "0.54.0"
|
|
21
21
|
features = ["serde", "visitor"]
|
sqloxide-0.1.54/justfile
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
from typing import Any, Generic, Literal, TypeAlias, TypedDict, TypeVar
|
|
2
|
+
|
|
3
|
+
Dialect: TypeAlias = Literal["generic", "ansi", "sqlite", "postgresql"]
|
|
4
|
+
|
|
5
|
+
def parse_sql(sql: str, dialect: Dialect) -> list[Statement]: ...
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T")
|
|
8
|
+
|
|
9
|
+
ObjectName: TypeAlias = list[Ident]
|
|
10
|
+
"""
|
|
11
|
+
A name of a table, view, custom type, etc.
|
|
12
|
+
(possibly multi-part, i.e. db.schema.obj)
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
Statement: TypeAlias = AstSelect | AstInsert | AstSetVariable | dict[str, Any]
|
|
16
|
+
"""
|
|
17
|
+
A top-level statement (SELECT, INSERT, CREATE, etc.)
|
|
18
|
+
|
|
19
|
+
See https://docs.rs/sqlparser/0.51.0/sqlparser/ast/enum.Statement.html
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
SetExpr: TypeAlias = AstSelect | AstSelect | AstQuery | AstValues | dict[str, Any]
|
|
23
|
+
"""
|
|
24
|
+
A node in a tree, representing a “query body” expression,
|
|
25
|
+
roughly: `SELECT ... [ {UNION|EXCEPT|INTERSECT} SELECT ...]`
|
|
26
|
+
|
|
27
|
+
See https://docs.rs/sqlparser/0.51.0/sqlparser/ast/enum.SetExpr.html
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
Expr: TypeAlias = AstIdentifier | dict[str, Any]
|
|
31
|
+
"""
|
|
32
|
+
A SQL expression of any type.
|
|
33
|
+
|
|
34
|
+
See https://docs.rs/sqlparser/0.51.0/sqlparser/ast/enum.Expr.html
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
Value: TypeAlias = dict[str, Any]
|
|
38
|
+
"""
|
|
39
|
+
Primitive SQL values such as number and string.
|
|
40
|
+
|
|
41
|
+
See https://docs.rs/sqlparser/0.51.0/sqlparser/ast/enum.Value.html
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
TableFactor: TypeAlias = dict[str, Any]
|
|
45
|
+
"""
|
|
46
|
+
A table name or a parenthesized subquery with an optional alias.
|
|
47
|
+
|
|
48
|
+
See https://docs.rs/sqlparser/0.51.0/sqlparser/ast/enum.TableFactor.html
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
JoinOperator: TypeAlias = dict[str, Any]
|
|
52
|
+
"""See https://docs.rs/sqlparser/0.51.0/sqlparser/ast/enum.JoinOperator.html"""
|
|
53
|
+
|
|
54
|
+
class One(TypedDict, Generic[T]):
|
|
55
|
+
One: T
|
|
56
|
+
|
|
57
|
+
class Many(TypedDict, Generic[T]):
|
|
58
|
+
Many: list[T]
|
|
59
|
+
|
|
60
|
+
class AstSelect(TypedDict):
|
|
61
|
+
Select: Select
|
|
62
|
+
|
|
63
|
+
class AstSetVariable(TypedDict):
|
|
64
|
+
SetVariable: SetVariable
|
|
65
|
+
|
|
66
|
+
class AstInsert(TypedDict):
|
|
67
|
+
Insert: Insert
|
|
68
|
+
|
|
69
|
+
class AstIdentifier(TypedDict):
|
|
70
|
+
"""An identifier (e.g. table name or column name)"""
|
|
71
|
+
|
|
72
|
+
Identifier: Ident
|
|
73
|
+
|
|
74
|
+
class AstCompoundIdentifier(TypedDict):
|
|
75
|
+
"""A multi-part identifier (e.g. table_alias.column or schema.table.col)"""
|
|
76
|
+
|
|
77
|
+
CompoundIdentifier: list[Ident]
|
|
78
|
+
|
|
79
|
+
class AstValue(TypedDict):
|
|
80
|
+
"""A literal value, such as string, number, date or NULL."""
|
|
81
|
+
|
|
82
|
+
Value: Value
|
|
83
|
+
|
|
84
|
+
class AstValues(TypedDict):
|
|
85
|
+
"""An insert VALUES clause."""
|
|
86
|
+
|
|
87
|
+
Values: Values
|
|
88
|
+
|
|
89
|
+
class AstQuery(TypedDict):
|
|
90
|
+
"""
|
|
91
|
+
A parenthesized subquery (SELECT ...),
|
|
92
|
+
used in an expression like SELECT (subquery) AS x or WHERE (subquery) = x
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
Query: Query
|
|
96
|
+
|
|
97
|
+
class AstSubquery(TypedDict):
|
|
98
|
+
"""
|
|
99
|
+
A parenthesized SELECT subquery.
|
|
100
|
+
|
|
101
|
+
When part of a `SetExpr`, a subquery may include more set operations
|
|
102
|
+
in its body and an optional ORDER BY / LIMIT.
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
Query: Query
|
|
106
|
+
|
|
107
|
+
class AstTable(TypedDict):
|
|
108
|
+
Table: Table
|
|
109
|
+
|
|
110
|
+
class Ident(TypedDict):
|
|
111
|
+
"""An identifier, decomposed into its value or character data and the quote style."""
|
|
112
|
+
|
|
113
|
+
value: str
|
|
114
|
+
quote_style: Any | None
|
|
115
|
+
|
|
116
|
+
class SetVariable(TypedDict):
|
|
117
|
+
"""
|
|
118
|
+
SET <variable> = expression;
|
|
119
|
+
SET (variable[, ...]) = (expression[, ...]);
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
local: bool
|
|
123
|
+
hivevar: bool
|
|
124
|
+
variables: One[ObjectName] | Many[ObjectName]
|
|
125
|
+
value: list[Expr]
|
|
126
|
+
|
|
127
|
+
class Select(TypedDict("Select", {"from": list[TableWithJoins]})):
|
|
128
|
+
select_token: Any # AttachedToken
|
|
129
|
+
distinct: Any | None # Option<Distinct>
|
|
130
|
+
top: Any | None # Option<Top,
|
|
131
|
+
top_before_distinct: bool
|
|
132
|
+
projection: list[Any] # Vec<SelectItem>
|
|
133
|
+
into: Any | None # Option<SelectInto>
|
|
134
|
+
lateral_views: list[Any] # Vec<LateralView>
|
|
135
|
+
prewhere: Expr | None
|
|
136
|
+
selection: Expr | None
|
|
137
|
+
group_by: Any # GroupByExpr,
|
|
138
|
+
cluster_by: list[Expr]
|
|
139
|
+
distribute_by: list[Expr]
|
|
140
|
+
sort_by: list[Expr]
|
|
141
|
+
having: Expr | None
|
|
142
|
+
named_window: list[Any] # Vec<NamedWindowDefinition>
|
|
143
|
+
qualify: Expr | None
|
|
144
|
+
window_before_qualify: bool
|
|
145
|
+
value_table_mode: Any | None # Option<ValueTableMode>
|
|
146
|
+
connect_by: Any | None # Option<ConnectBy>
|
|
147
|
+
|
|
148
|
+
class Insert(TypedDict("Insert", {"or": Any | None})):
|
|
149
|
+
"""
|
|
150
|
+
An INSERT statement.
|
|
151
|
+
|
|
152
|
+
See https://docs.rs/sqlparser/0.51.0/sqlparser/ast/struct.Insert.html
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
ignore: bool
|
|
156
|
+
into: bool
|
|
157
|
+
table_name: ObjectName
|
|
158
|
+
table_alias: Any | None
|
|
159
|
+
columns: list[Ident]
|
|
160
|
+
overwrite: bool
|
|
161
|
+
source: Query | None
|
|
162
|
+
"""A SQL query that specifies what to insert"""
|
|
163
|
+
partitioned: Any | None
|
|
164
|
+
after_columns: list[Any]
|
|
165
|
+
table: bool
|
|
166
|
+
on: dict[str, Any] | None # e.g. {"OnConflict": {"conflict_target": None, "action": "DoNothing"}},
|
|
167
|
+
returning: Any | None
|
|
168
|
+
replace_into: bool
|
|
169
|
+
priority: Any | None
|
|
170
|
+
insert_alias: Any | None
|
|
171
|
+
|
|
172
|
+
class Query(TypedDict("Query", {"with": Any | None})):
|
|
173
|
+
"""
|
|
174
|
+
The most complete variant of a SELECT query expression,
|
|
175
|
+
optionally including WITH, UNION / other set operations, and ORDER BY.
|
|
176
|
+
"""
|
|
177
|
+
|
|
178
|
+
body: SetExpr
|
|
179
|
+
order_by: Any | None
|
|
180
|
+
limit: Any | None
|
|
181
|
+
limit_by: list[Any]
|
|
182
|
+
offset: Any | None
|
|
183
|
+
fetch: Any | None
|
|
184
|
+
locks: list[Any]
|
|
185
|
+
for_clause: Any | None
|
|
186
|
+
settings: Any | None
|
|
187
|
+
format_clause: Any | None
|
|
188
|
+
|
|
189
|
+
class Values(TypedDict):
|
|
190
|
+
explicit_row: bool
|
|
191
|
+
rows: list[list[Expr]]
|
|
192
|
+
|
|
193
|
+
class TableWithJoins(TypedDict):
|
|
194
|
+
relation: TableFactor
|
|
195
|
+
joins: list[Join]
|
|
196
|
+
|
|
197
|
+
class Join(TypedDict("Join", {"global": bool})):
|
|
198
|
+
relation: TableFactor
|
|
199
|
+
join_operator: JoinOperator
|
|
200
|
+
|
|
201
|
+
class Table(TypedDict):
|
|
202
|
+
name: ObjectName
|
|
203
|
+
alias: Any | None # Option<TableAlias>
|
|
204
|
+
args: Any | None # Option<TableFunctionArgs>
|
|
205
|
+
with_hints: list[Expr]
|
|
206
|
+
version: Any | None # Option<TableVersion>
|
|
207
|
+
with_ordinality: bool
|
|
208
|
+
partitions: list[Ident]
|
|
209
|
+
json_path: Any | None # Option<JsonPath>
|
|
210
|
+
sample: Any | None # Option<TableSampleKind>
|
|
@@ -3,7 +3,6 @@ use pythonize::pythonize;
|
|
|
3
3
|
use pyo3::exceptions::PyValueError;
|
|
4
4
|
use pyo3::prelude::*;
|
|
5
5
|
|
|
6
|
-
use pyo3::wrap_pyfunction;
|
|
7
6
|
use pythonize::PythonizeError;
|
|
8
7
|
|
|
9
8
|
use sqlparser::ast::Statement;
|
|
@@ -20,12 +19,12 @@ use visitor::{extract_expressions, extract_relations, mutate_expressions, mutate
|
|
|
20
19
|
/// Available `dialects`: https://github.com/sqlparser-rs/sqlparser-rs/blob/main/src/dialect/mod.rs#L189-L206
|
|
21
20
|
#[pyfunction]
|
|
22
21
|
#[pyo3(text_signature = "(sql, dialect)")]
|
|
23
|
-
fn parse_sql(py: Python, sql:
|
|
22
|
+
fn parse_sql(py: Python, sql: String, dialect: String) -> PyResult<PyObject> {
|
|
24
23
|
let chosen_dialect = dialect_from_str(dialect).unwrap_or_else(|| {
|
|
25
24
|
println!("The dialect you chose was not recognized, falling back to 'generic'");
|
|
26
25
|
Box::new(GenericDialect {})
|
|
27
26
|
});
|
|
28
|
-
let parse_result = Parser::parse_sql(&*chosen_dialect, sql);
|
|
27
|
+
let parse_result = Parser::parse_sql(&*chosen_dialect, &sql);
|
|
29
28
|
|
|
30
29
|
let output = match parse_result {
|
|
31
30
|
Ok(statements) => pythonize(py, &statements).map_err(|e| {
|
|
@@ -40,13 +39,13 @@ fn parse_sql(py: Python, sql: &str, dialect: &str) -> PyResult<PyObject> {
|
|
|
40
39
|
}
|
|
41
40
|
};
|
|
42
41
|
|
|
43
|
-
Ok(output)
|
|
42
|
+
Ok(output.into())
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
/// This utility function allows reconstituing a modified AST back into list of SQL queries.
|
|
47
46
|
#[pyfunction]
|
|
48
47
|
#[pyo3(text_signature = "(ast)")]
|
|
49
|
-
fn restore_ast(_py: Python, ast: &PyAny) -> PyResult<Vec<String>> {
|
|
48
|
+
fn restore_ast(_py: Python, ast: &Bound<'_, PyAny>) -> PyResult<Vec<String>> {
|
|
50
49
|
let parse_result: Result<Vec<Statement>, PythonizeError> = pythonize::depythonize(ast);
|
|
51
50
|
|
|
52
51
|
let output = match parse_result {
|
|
@@ -66,7 +65,7 @@ fn restore_ast(_py: Python, ast: &PyAny) -> PyResult<Vec<String>> {
|
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
#[pymodule]
|
|
69
|
-
fn sqloxide(_py: Python, m: &PyModule) -> PyResult<()> {
|
|
68
|
+
fn sqloxide(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
|
|
70
69
|
m.add_function(wrap_pyfunction!(parse_sql, m)?)?;
|
|
71
70
|
m.add_function(wrap_pyfunction!(restore_ast, m)?)?;
|
|
72
71
|
// TODO: maybe refactor into seperate module
|
|
@@ -10,7 +10,7 @@ use sqlparser::ast::{
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
// Refactored function for handling depythonization
|
|
13
|
-
fn depythonize_query(parsed_query: &PyAny) -> Result<Vec<Statement>, PyErr> {
|
|
13
|
+
fn depythonize_query(parsed_query: &Bound<'_, PyAny>) -> Result<Vec<Statement>, PyErr> {
|
|
14
14
|
match pythonize::depythonize(parsed_query) {
|
|
15
15
|
Ok(statements) => Ok(statements),
|
|
16
16
|
Err(e) => {
|
|
@@ -27,7 +27,7 @@ where
|
|
|
27
27
|
T: Sized + Serialize,
|
|
28
28
|
{
|
|
29
29
|
match pythonize::pythonize(py, &output) {
|
|
30
|
-
Ok(p) => Ok(p),
|
|
30
|
+
Ok(p) => Ok(p.into()),
|
|
31
31
|
Err(e) => {
|
|
32
32
|
let msg = e.to_string();
|
|
33
33
|
Err(PyValueError::new_err(format!(
|
|
@@ -39,7 +39,7 @@ where
|
|
|
39
39
|
|
|
40
40
|
#[pyfunction]
|
|
41
41
|
#[pyo3(text_signature = "(parsed_query)")]
|
|
42
|
-
pub fn extract_relations(py: Python, parsed_query: &PyAny) -> PyResult<PyObject> {
|
|
42
|
+
pub fn extract_relations(py: Python, parsed_query: &Bound<'_, PyAny>) -> PyResult<PyObject> {
|
|
43
43
|
let statements = depythonize_query(parsed_query)?;
|
|
44
44
|
|
|
45
45
|
let mut relations = Vec::new();
|
|
@@ -55,7 +55,7 @@ pub fn extract_relations(py: Python, parsed_query: &PyAny) -> PyResult<PyObject>
|
|
|
55
55
|
|
|
56
56
|
#[pyfunction]
|
|
57
57
|
#[pyo3(text_signature = "(parsed_query, func)")]
|
|
58
|
-
pub fn mutate_relations(_py: Python, parsed_query: &
|
|
58
|
+
pub fn mutate_relations(_py: Python, parsed_query: &Bound<'_, PyAny>, func: &Bound<'_, PyAny>) -> PyResult<Vec<String>> {
|
|
59
59
|
let mut statements = depythonize_query(parsed_query)?;
|
|
60
60
|
|
|
61
61
|
for statement in &mut statements {
|
|
@@ -85,8 +85,8 @@ pub fn mutate_relations(_py: Python, parsed_query: &PyAny, func: &PyAny) -> PyRe
|
|
|
85
85
|
|
|
86
86
|
#[pyfunction]
|
|
87
87
|
#[pyo3(text_signature = "(parsed_query, func)")]
|
|
88
|
-
pub fn mutate_expressions(py: Python, parsed_query: &
|
|
89
|
-
let mut statements = depythonize_query(parsed_query)?;
|
|
88
|
+
pub fn mutate_expressions(py: Python, parsed_query: &Bound<'_, PyAny>, func: &Bound<'_, PyAny>) -> PyResult<Vec<String>> {
|
|
89
|
+
let mut statements: Vec<Statement> = depythonize_query(parsed_query)?;
|
|
90
90
|
|
|
91
91
|
for statement in &mut statements {
|
|
92
92
|
visit_expressions_mut(statement, |expr| {
|
|
@@ -110,7 +110,7 @@ pub fn mutate_expressions(py: Python, parsed_query: &PyAny, func: &PyAny) -> PyR
|
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
*expr = match pythonize::depythonize(func_result) {
|
|
113
|
+
*expr = match pythonize::depythonize(&func_result) {
|
|
114
114
|
Ok(val) => val,
|
|
115
115
|
Err(e) => {
|
|
116
116
|
let msg = e.to_string();
|
|
@@ -132,8 +132,8 @@ pub fn mutate_expressions(py: Python, parsed_query: &PyAny, func: &PyAny) -> PyR
|
|
|
132
132
|
|
|
133
133
|
#[pyfunction]
|
|
134
134
|
#[pyo3(text_signature = "(parsed_query)")]
|
|
135
|
-
pub fn extract_expressions(py: Python, parsed_query: &PyAny) -> PyResult<PyObject> {
|
|
136
|
-
let statements = depythonize_query(parsed_query)?;
|
|
135
|
+
pub fn extract_expressions(py: Python, parsed_query: &Bound<'_, PyAny>) -> PyResult<PyObject> {
|
|
136
|
+
let statements: Vec<Statement> = depythonize_query(parsed_query)?;
|
|
137
137
|
|
|
138
138
|
let mut expressions = Vec::new();
|
|
139
139
|
for statement in statements {
|
sqloxide-0.1.48/justfile
DELETED
sqloxide-0.1.48/poetry.lock
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|