@voltro/plugin-postgis 0.1.0

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,52 @@
1
+ # Changelog
2
+
3
+ All notable changes to the `@voltro/*` packages are recorded here. The format
4
+ follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
+
6
+ ## Stability contract — read this before you pin a version
7
+
8
+ Voltro is **`0.x` — pre-1.0, and deliberately so.** Under SemVer, `0.y.z` means
9
+ "anything MAY change." We hold to exactly that, stated out loud:
10
+
11
+ - **Pin exact versions.** Depend on `@voltro/runtime@0.4.2`, never `^0.4.2` or
12
+ `~0.4.2`. There is no compatible-range promise below 1.0.
13
+ - **Every MINOR may break.** Breaking changes land on a minor bump (`0.4.x →
14
+ 0.5.0`); patches (`0.4.1 → 0.4.2`) are additive or fixes only. This is the
15
+ standard `0.x` reading of SemVer — the minor slot carries breaking under `0.x`.
16
+ - **Read this changelog before upgrading.** The `⚠ BREAKING` section of each
17
+ release lists every incompatible change with its migration. It is the only
18
+ migration path we provide — there is no deprecation cycle, no compat shim.
19
+ - **All packages release together (lockstep).** One coordinated version across
20
+ the whole framework; the git tag is the source of truth.
21
+
22
+ This is not a placeholder disclaimer — it is the contract. The framework is
23
+ refactored aggressively while it has no external stability obligations, and that
24
+ velocity is the point. A stable-core tier and per-package `1.0` graduation are
25
+ planned, but not yet; until then, treat the whole surface as movable and pin
26
+ exact.
27
+
28
+ The **public API** of each package is its `publishConfig.exports` entry points,
29
+ minus anything marked `@internal` (those are cross-package internals and are
30
+ stripped from the published `.d.ts`). Importing a deep path that isn't an
31
+ exported entry point is unsupported.
32
+
33
+ ---
34
+
35
+ ## [Unreleased]
36
+
37
+ _Changes staged for the next release accumulate here (rolled up from
38
+ `.changes/*.md` at tag time — see `.changes/README.md`)._
39
+
40
+ ---
41
+
42
+ ## [0.1.0]
43
+
44
+ Initial pre-release baseline. This is the starting point the changelog tracks
45
+ from; it is not an exhaustive history of prior development. The framework ships
46
+ as `@voltro/*` packages spanning the runtime, database/query layer, web client
47
+ and router, durable workflows, the CLI, and the plugin ecosystem
48
+ (auth, storage, mail, billing, observability, and more). Not published to a
49
+ public registry yet.
50
+
51
+ Subsequent releases record their deltas from here under dated headings, with
52
+ `⚠ BREAKING` first.
package/LICENSE ADDED
@@ -0,0 +1,57 @@
1
+ Voltro — Proprietary Software License
2
+
3
+ Copyright (c) 2026 Voltro UG. All rights reserved.
4
+
5
+ This software and all associated source code, documentation, and other
6
+ materials (the "Software") are the proprietary property of Voltro UG
7
+ ("Voltro"). This is NOT open-source software.
8
+
9
+ Your access to and use of the Software is governed exclusively by the Voltro
10
+ Terms of Service at:
11
+
12
+ https://voltro.cloud/legal/terms
13
+
14
+ By downloading, installing, or using the Software you agree to those Terms.
15
+ Subject to and conditioned on your continued compliance with them, Voltro
16
+ grants you a limited, non-exclusive, non-transferable, non-sublicensable,
17
+ revocable license to use the Software. All rights not expressly granted in the
18
+ Terms are reserved by Voltro. If you do not agree to the Terms, you have no
19
+ license and may not use the Software.
20
+
21
+ The Terms of Service — including the scope of permitted use, plan
22
+ entitlements, fees, and pricing — may change from time to time. The version in
23
+ force is the one published at the URL above. Commercial terms and pricing are
24
+ NOT part of this notice and are not fixed by, or granted in perpetuity by, the
25
+ version of the Software in which this file appears.
26
+
27
+ Permitted use — your own software. Voltro is a development framework. You may
28
+ use the Software to build, run, and commercially distribute your own
29
+ applications and services, and to charge your own customers for them, without
30
+ owing Voltro any share of that revenue or any further permission beyond the
31
+ Terms. Applications you build with the Software are yours.
32
+
33
+ Prohibited use — reselling Voltro. You may NOT redistribute, resell,
34
+ sublicense, publish, or otherwise provide the Software itself — in whole or in
35
+ part, in source or compiled form — to third parties as a library, framework,
36
+ SDK, template, starter, or development tool for them to build upon, whether
37
+ standalone or repackaged. Shipping the Software as a non-separable, bundled
38
+ dependency inside an application you deliver (for example, compiled into your
39
+ deployed app) is permitted; extracting or re-exposing it as a reusable
40
+ component for others is not.
41
+
42
+ Except as expressly permitted above or by the Terms, you may not copy, modify,
43
+ merge, publish, sublicense, sell, distribute, or create derivative works of the
44
+ Software, in whole or in part.
45
+
46
+ Third-party open-source components distributed alongside the Software are the
47
+ property of their respective owners and are licensed under their own terms; see
48
+ THIRD-PARTY-NOTICES.md where provided. Nothing in this notice limits your
49
+ rights, or extends Voltro's, in those components.
50
+
51
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53
+ FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL
54
+ VOLTRO BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM,
55
+ OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR ITS USE.
56
+
57
+ For licensing inquiries, contact Voltro UG.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ <div align="center">
2
+
3
+ # @voltro/plugin-postgis
4
+
5
+ **PostGIS plugin — postgres-native geometry/geography columns and spatial predicates (ST_DWithin, ST_Contains, ST_Intersects) for location-aware apps; declare GiST indexes via .expressionIndex(..., { kind: 'gist' }). Postgres-only; other dialects fail loud at schema emission.**
6
+
7
+ [📖 Documentation](https://docs.voltro.dev/docs/plugins/postgis) · [Changelog](./CHANGELOG.md) · [voltro.dev](https://voltro.dev) · [Voltro Cloud](https://voltro.cloud)
8
+
9
+ </div>
10
+
11
+ ---
12
+
13
+ ```sh
14
+ npm install @voltro/plugin-postgis
15
+ ```
16
+
17
+ > ### [→ Read the documentation for @voltro/plugin-postgis](https://docs.voltro.dev/docs/plugins/postgis)
18
+
19
+ Installation, guides, the full API reference, and examples all live in the
20
+ **[Voltro documentation](https://docs.voltro.dev/docs/intro/getting-started)** — the single source of truth. This README is
21
+ deliberately short so there is nothing here to drift out of date.
22
+
23
+ ## License
24
+
25
+ Proprietary. © 2026 Voltro UG. Your use is governed by the
26
+ [Terms of Service](https://voltro.cloud/legal/terms). See the bundled `LICENSE`.
package/SECURITY.md ADDED
@@ -0,0 +1,56 @@
1
+ # Security Policy
2
+
3
+ We take the security of Voltro and the applications built on it seriously. This
4
+ document explains how to report a vulnerability and what to expect in return.
5
+
6
+ ## Reporting a vulnerability
7
+
8
+ **Please do not open public issues or discuss suspected vulnerabilities in
9
+ public channels.** Report them privately by email:
10
+
11
+ **security contact: [support@voltro.dev](mailto:support@voltro.dev)**
12
+ (subject line: `SECURITY`).
13
+
14
+ Include, where you can:
15
+
16
+ - the affected package(s) and version(s) (e.g. `@voltro/runtime@x.y.z`);
17
+ - a description of the issue and its impact;
18
+ - a minimal reproduction or proof of concept;
19
+ - any suggested remediation.
20
+
21
+ If you'd like to encrypt your report, ask in a first plain email and we'll
22
+ arrange a key.
23
+
24
+ ## What to expect
25
+
26
+ - **Acknowledgement** of your report within **3 business days**.
27
+ - An initial assessment (severity, affected surface) and a remediation plan as
28
+ soon as we've reproduced the issue.
29
+ - **Coordinated disclosure:** we'll agree a disclosure timeline with you and
30
+ credit you in the release notes if you wish. Please give us reasonable time to
31
+ ship a fix before any public disclosure.
32
+
33
+ We do not currently run a paid bug-bounty program, but we genuinely appreciate
34
+ responsible disclosure and will credit reporters.
35
+
36
+ ## Software Bill of Materials (SBOM)
37
+
38
+ A CycloneDX SBOM of the third-party runtime dependency graph is generated for the
39
+ published packages (`pnpm gen:sbom` → `sbom.cdx.json`). If your procurement or
40
+ security team needs it, request it at
41
+ [support@voltro.dev](mailto:support@voltro.dev).
42
+
43
+ ## Supported versions
44
+
45
+ Voltro is pre-1.0 and ships in lockstep: **only the latest published minor of
46
+ each `@voltro/*` package receives security fixes.** Please upgrade to the latest
47
+ release before reporting, and pin exact versions in production.
48
+
49
+ ## Scope
50
+
51
+ In scope: the published `@voltro/*` packages and the framework's own code.
52
+
53
+ Out of scope: vulnerabilities in third-party dependencies that are already
54
+ tracked upstream (we monitor these via a production-dependency audit gate in
55
+ CI), and issues that require a non-default, explicitly-unsafe configuration. If
56
+ you're unsure, report it anyway — we'd rather hear about it.
@@ -0,0 +1,319 @@
1
+ # Third-Party Notices — @voltro/plugin-postgis
2
+
3
+ This package depends on the open-source software listed below. Each is the
4
+ property of its respective copyright holders and is used under the terms of
5
+ its license. This file is provided for attribution; it grants no rights in
6
+ @voltro/plugin-postgis itself, which is proprietary (see LICENSE).
7
+
8
+ Generated from the resolved runtime dependency closure (5 packages).
9
+
10
+ ---
11
+
12
+ ## @effect/sql@0.51.1
13
+
14
+ License: MIT
15
+
16
+ ```
17
+ MIT License
18
+
19
+ Copyright (c) 2023-present The Contributors
20
+
21
+ Permission is hereby granted, free of charge, to any person obtaining a copy
22
+ of this software and associated documentation files (the "Software"), to deal
23
+ in the Software without restriction, including without limitation the rights
24
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25
+ copies of the Software, and to permit persons to whom the Software is
26
+ furnished to do so, subject to the following conditions:
27
+
28
+ The above copyright notice and this permission notice shall be included in all
29
+ copies or substantial portions of the Software.
30
+
31
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37
+ SOFTWARE.
38
+ ```
39
+
40
+ ## layerr@3.0.0
41
+
42
+ License: MIT
43
+
44
+ ```
45
+ MIT License
46
+
47
+ Copyright (c) 2020 Perry Mitchell
48
+
49
+ Permission is hereby granted, free of charge, to any person obtaining a copy
50
+ of this software and associated documentation files (the "Software"), to deal
51
+ in the Software without restriction, including without limitation the rights
52
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
53
+ copies of the Software, and to permit persons to whom the Software is
54
+ furnished to do so, subject to the following conditions:
55
+
56
+ The above copyright notice and this permission notice shall be included in all
57
+ copies or substantial portions of the Software.
58
+
59
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
61
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
62
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
64
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
65
+ SOFTWARE.
66
+ ```
67
+
68
+ ## typeid-js@1.2.0
69
+
70
+ License: Apache-2.0
71
+
72
+ ```
73
+ Apache License
74
+ Version 2.0, January 2004
75
+ http://www.apache.org/licenses/
76
+
77
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
78
+
79
+ 1. Definitions.
80
+
81
+ "License" shall mean the terms and conditions for use, reproduction,
82
+ and distribution as defined by Sections 1 through 9 of this document.
83
+
84
+ "Licensor" shall mean the copyright owner or entity authorized by
85
+ the copyright owner that is granting the License.
86
+
87
+ "Legal Entity" shall mean the union of the acting entity and all
88
+ other entities that control, are controlled by, or are under common
89
+ control with that entity. For the purposes of this definition,
90
+ "control" means (i) the power, direct or indirect, to cause the
91
+ direction or management of such entity, whether by contract or
92
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
93
+ outstanding shares, or (iii) beneficial ownership of such entity.
94
+
95
+ "You" (or "Your") shall mean an individual or Legal Entity
96
+ exercising permissions granted by this License.
97
+
98
+ "Source" form shall mean the preferred form for making modifications,
99
+ including but not limited to software source code, documentation
100
+ source, and configuration files.
101
+
102
+ "Object" form shall mean any form resulting from mechanical
103
+ transformation or translation of a Source form, including but
104
+ not limited to compiled object code, generated documentation,
105
+ and conversions to other media types.
106
+
107
+ "Work" shall mean the work of authorship, whether in Source or
108
+ Object form, made available under the License, as indicated by a
109
+ copyright notice that is included in or attached to the work
110
+ (an example is provided in the Appendix below).
111
+
112
+ "Derivative Works" shall mean any work, whether in Source or Object
113
+ form, that is based on (or derived from) the Work and for which the
114
+ editorial revisions, annotations, elaborations, or other modifications
115
+ represent, as a whole, an original work of authorship. For the purposes
116
+ of this License, Derivative Works shall not include works that remain
117
+ separable from, or merely link (or bind by name) to the interfaces of,
118
+ the Work and Derivative Works thereof.
119
+
120
+ "Contribution" shall mean any work of authorship, including
121
+ the original version of the Work and any modifications or additions
122
+ to that Work or Derivative Works thereof, that is intentionally
123
+ submitted to Licensor for inclusion in the Work by the copyright owner
124
+ or by an individual or Legal Entity authorized to submit on behalf of
125
+ the copyright owner. For the purposes of this definition, "submitted"
126
+ means any form of electronic, verbal, or written communication sent
127
+ to the Licensor or its representatives, including but not limited to
128
+ communication on electronic mailing lists, source code control systems,
129
+ and issue tracking systems that are managed by, or on behalf of, the
130
+ Licensor for the purpose of discussing and improving the Work, but
131
+ excluding communication that is conspicuously marked or otherwise
132
+ designated in writing by the copyright owner as "Not a Contribution."
133
+
134
+ "Contributor" shall mean Licensor and any individual or Legal Entity
135
+ on behalf of whom a Contribution has been received by Licensor and
136
+ subsequently incorporated within the Work.
137
+
138
+ 2. Grant of Copyright License. Subject to the terms and conditions of
139
+ this License, each Contributor hereby grants to You a perpetual,
140
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
141
+ copyright license to reproduce, prepare Derivative Works of,
142
+ publicly display, publicly perform, sublicense, and distribute the
143
+ Work and such Derivative Works in Source or Object form.
144
+
145
+ 3. Grant of Patent License. Subject to the terms and conditions of
146
+ this License, each Contributor hereby grants to You a perpetual,
147
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
148
+ (except as stated in this section) patent license to make, have made,
149
+ use, offer to sell, sell, import, and otherwise transfer the Work,
150
+ where such license applies only to those patent claims licensable
151
+ by such Contributor that are necessarily infringed by their
152
+ Contribution(s) alone or by combination of their Contribution(s)
153
+ with the Work to which such Contribution(s) was submitted. If You
154
+ institute patent litigation against any entity (including a
155
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
156
+ or a Contribution incorporated within the Work constitutes direct
157
+ or contributory patent infringement, then any patent licenses
158
+ granted to You under this License for that Work shall terminate
159
+ as of the date such litigation is filed.
160
+
161
+ 4. Redistribution. You may reproduce and distribute copies of the
162
+ Work or Derivative Works thereof in any medium, with or without
163
+ modifications, and in Source or Object form, provided that You
164
+ meet the following conditions:
165
+
166
+ (a) You must give any other recipients of the Work or
167
+ Derivative Works a copy of this License; and
168
+
169
+ (b) You must cause any modified files to carry prominent notices
170
+ stating that You changed the files; and
171
+
172
+ (c) You must retain, in the Source form of any Derivative Works
173
+ that You distribute, all copyright, patent, trademark, and
174
+ attribution notices from the Source form of the Work,
175
+ excluding those notices that do not pertain to any part of
176
+ the Derivative Works; and
177
+
178
+ (d) If the Work includes a "NOTICE" text file as part of its
179
+ distribution, then any Derivative Works that You distribute must
180
+ include a readable copy of the attribution notices contained
181
+ within such NOTICE file, excluding those notices that do not
182
+ pertain to any part of the Derivative Works, in at least one
183
+ of the following places: within a NOTICE text file distributed
184
+ as part of the Derivative Works; within the Source form or
185
+ documentation, if provided along with the Derivative Works; or,
186
+ within a display generated by the Derivative Works, if and
187
+ wherever such third-party notices normally appear. The contents
188
+ of the NOTICE file are for informational purposes only and
189
+ do not modify the License. You may add Your own attribution
190
+ notices within Derivative Works that You distribute, alongside
191
+ or as an addendum to the NOTICE text from the Work, provided
192
+ that such additional attribution notices cannot be construed
193
+ as modifying the License.
194
+
195
+ You may add Your own copyright statement to Your modifications and
196
+ may provide additional or different license terms and conditions
197
+ for use, reproduction, or distribution of Your modifications, or
198
+ for any such Derivative Works as a whole, provided Your use,
199
+ reproduction, and distribution of the Work otherwise complies with
200
+ the conditions stated in this License.
201
+
202
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
203
+ any Contribution intentionally submitted for inclusion in the Work
204
+ by You to the Licensor shall be under the terms and conditions of
205
+ this License, without any additional terms or conditions.
206
+ Notwithstanding the above, nothing herein shall supersede or modify
207
+ the terms of any separate license agreement you may have executed
208
+ with Licensor regarding such Contributions.
209
+
210
+ 6. Trademarks. This License does not grant permission to use the trade
211
+ names, trademarks, service marks, or product names of the Licensor,
212
+ except as required for reasonable and customary use in describing the
213
+ origin of the Work and reproducing the content of the NOTICE file.
214
+
215
+ 7. Disclaimer of Warranty. Unless required by applicable law or
216
+ agreed to in writing, Licensor provides the Work (and each
217
+ Contributor provides its Contributions) on an "AS IS" BASIS,
218
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
219
+ implied, including, without limitation, any warranties or conditions
220
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
221
+ PARTICULAR PURPOSE. You are solely responsible for determining the
222
+ appropriateness of using or redistributing the Work and assume any
223
+ risks associated with Your exercise of permissions under this License.
224
+
225
+ 8. Limitation of Liability. In no event and under no legal theory,
226
+ whether in tort (including negligence), contract, or otherwise,
227
+ unless required by applicable law (such as deliberate and grossly
228
+ negligent acts) or agreed to in writing, shall any Contributor be
229
+ liable to You for damages, including any direct, indirect, special,
230
+ incidental, or consequential damages of any character arising as a
231
+ result of this License or out of the use or inability to use the
232
+ Work (including but not limited to damages for loss of goodwill,
233
+ work stoppage, computer failure or malfunction, or any and all
234
+ other commercial damages or losses), even if such Contributor
235
+ has been advised of the possibility of such damages.
236
+
237
+ 9. Accepting Warranty or Additional Liability. While redistributing
238
+ the Work or Derivative Works thereof, You may choose to offer,
239
+ and charge a fee for, acceptance of support, warranty, indemnity,
240
+ or other liability obligations and/or rights consistent with this
241
+ License. However, in accepting such obligations, You may act only
242
+ on Your own behalf and on Your sole responsibility, not on behalf
243
+ of any other Contributor, and only if You agree to indemnify,
244
+ defend, and hold each Contributor harmless for any liability
245
+ incurred by, or claims asserted against, such Contributor by reason
246
+ of your accepting any such warranty or additional liability.
247
+
248
+ END OF TERMS AND CONDITIONS
249
+
250
+ APPENDIX: How to apply the Apache License to your work.
251
+
252
+ To apply the Apache License to your work, attach the following
253
+ boilerplate notice, with the fields enclosed by brackets "[]"
254
+ replaced with your own identifying information. (Don't include
255
+ the brackets!) The text should be enclosed in the appropriate
256
+ comment syntax for the file format. We also recommend that a
257
+ file or class name and description of purpose be included on the
258
+ same "printed page" as the copyright notice for easier
259
+ identification within third-party archives.
260
+
261
+ Copyright [yyyy] [name of copyright owner]
262
+
263
+ Licensed under the Apache License, Version 2.0 (the "License");
264
+ you may not use this file except in compliance with the License.
265
+ You may obtain a copy of the License at
266
+
267
+ http://www.apache.org/licenses/LICENSE-2.0
268
+
269
+ Unless required by applicable law or agreed to in writing, software
270
+ distributed under the License is distributed on an "AS IS" BASIS,
271
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
272
+ See the License for the specific language governing permissions and
273
+ limitations under the License.
274
+ ```
275
+
276
+ ## ulidx@2.4.1
277
+
278
+ License: MIT
279
+
280
+ ```
281
+ MIT License
282
+
283
+ Copyright (c) 2021 Perry Mitchell
284
+
285
+ Permission is hereby granted, free of charge, to any person obtaining a copy
286
+ of this software and associated documentation files (the "Software"), to deal
287
+ in the Software without restriction, including without limitation the rights
288
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
289
+ copies of the Software, and to permit persons to whom the Software is
290
+ furnished to do so, subject to the following conditions:
291
+
292
+ The above copyright notice and this permission notice shall be included in all
293
+ copies or substantial portions of the Software.
294
+
295
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
296
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
297
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
298
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
299
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
300
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
301
+ SOFTWARE.
302
+ ```
303
+
304
+ ## uuid@11.1.1
305
+
306
+ License: MIT
307
+
308
+ ```
309
+ The MIT License (MIT)
310
+
311
+ Copyright (c) 2010-2020 Robert Kieffer and other contributors
312
+
313
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
314
+
315
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
316
+
317
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
318
+ ```
319
+
@@ -0,0 +1,180 @@
1
+ import { geography } from '@voltro/database';
2
+ import { geometry } from '@voltro/database';
3
+ import { GeometryKind } from '@voltro/database';
4
+ import { PredicateLeaf } from '@voltro/database';
5
+ import { QueryTransform } from '@voltro/database';
6
+
7
+ /**
8
+ * `column && geom` — bounding-box overlap. The `&&` operator is the GiST
9
+ * index-only fast pre-filter: it compares only the 2-D bounding boxes, so it
10
+ * is cheap and index-accelerated but approximate (a box can overlap when the
11
+ * exact geometries don't). Pair it with an exact predicate for precision, or
12
+ * use it alone for a coarse "in this region" cut. Build `geom` with
13
+ * `envelope(...)` for an axis-aligned box.
14
+ */
15
+ export declare const bboxOverlaps: (column: string, geom: string) => PredicateLeaf;
16
+
17
+ /**
18
+ * An axis-aligned bounding-box polygon (`ST_MakeEnvelope` equivalent) as an
19
+ * EWKT rectangle — the natural argument to {@link bboxOverlaps}. `[minLon,
20
+ * minLat]` bottom-left, `[maxLon, maxLat]` top-right.
21
+ */
22
+ export declare const envelope: (minLon: number, minLat: number, maxLon: number, maxLat: number, srid?: number) => string;
23
+
24
+ export { geography }
25
+
26
+ /**
27
+ * Convert a GeoJSON geometry to the EWKT string the other constructors
28
+ * produce, so it flows through the SAME literal-binding path (the SQL
29
+ * compiler binds it as a text parameter; postgres parses the WKT). GeoJSON is
30
+ * lon/lat, SRID 4326 by definition, so no SRID argument is taken.
31
+ *
32
+ * ```ts
33
+ * await store.insert('venues', {
34
+ * location: geoJson({ type: 'Point', coordinates: [8.682, 50.110] }),
35
+ * })
36
+ * ```
37
+ */
38
+ export declare const geoJson: (geometry: GeoJsonGeometry) => string;
39
+
40
+ /** A minimal GeoJSON geometry object — the subset PostGIS's `ST_GeomFromGeoJSON` accepts. */
41
+ export declare type GeoJsonGeometry = {
42
+ readonly type: 'Point';
43
+ readonly coordinates: Position;
44
+ } | {
45
+ readonly type: 'LineString';
46
+ readonly coordinates: ReadonlyArray<Position>;
47
+ } | {
48
+ readonly type: 'Polygon';
49
+ readonly coordinates: ReadonlyArray<ReadonlyArray<Position>>;
50
+ } | {
51
+ readonly type: 'MultiPoint';
52
+ readonly coordinates: ReadonlyArray<Position>;
53
+ } | {
54
+ readonly type: 'MultiLineString';
55
+ readonly coordinates: ReadonlyArray<ReadonlyArray<Position>>;
56
+ } | {
57
+ readonly type: 'MultiPolygon';
58
+ readonly coordinates: ReadonlyArray<ReadonlyArray<ReadonlyArray<Position>>>;
59
+ };
60
+
61
+ export { geometry }
62
+
63
+ export { GeometryKind }
64
+
65
+ /**
66
+ * Construct a PostGIS LineString from an ordered list of `[lon, lat]`
67
+ * positions (a path / route). Needs at least two points.
68
+ */
69
+ export declare const lineString: (positions: ReadonlyArray<Position>, srid?: number) => string;
70
+
71
+ /** Construct a PostGIS MultiLineString from a list of lines (each a list of positions). */
72
+ export declare const multiLineString: (lines: ReadonlyArray<ReadonlyArray<Position>>, srid?: number) => string;
73
+
74
+ /** Construct a PostGIS MultiPoint from a list of `[lon, lat]` positions. */
75
+ export declare const multiPoint: (positions: ReadonlyArray<Position>, srid?: number) => string;
76
+
77
+ /**
78
+ * Construct a PostGIS MultiPolygon from a list of polygons (each polygon a
79
+ * list of rings; each ring MUST be closed).
80
+ */
81
+ export declare const multiPolygon: (polygons: ReadonlyArray<ReadonlyArray<ReadonlyArray<Position>>>, srid?: number) => string;
82
+
83
+ /**
84
+ * Order rows by nearest-neighbour distance to `geom` using the PostGIS `<->`
85
+ * operator — an indexed nearest-neighbour scan when a GiST index covers
86
+ * `column`. Combine with `.limit(k)` for the classic `ORDER BY geom <-> point
87
+ * LIMIT k` KNN query. Leads any explicit `.orderBy(...)`. `<->` is planar; for
88
+ * a metric distance VALUE add {@link withDistance} too.
89
+ *
90
+ * ```ts
91
+ * const nearest = await store.query(
92
+ * queryFor(venues)
93
+ * .use(nearestBy('location', point(8.682, 50.110)))
94
+ * .limit(5)
95
+ * .descriptor,
96
+ * )
97
+ * ```
98
+ */
99
+ export declare const nearestBy: (column: string, geom: string, options?: {
100
+ direction?: "asc" | "desc";
101
+ }) => QueryTransform;
102
+
103
+ /**
104
+ * Construct a PostGIS Point WKT value.
105
+ *
106
+ * ```ts
107
+ * await store.insert('venues', {
108
+ * location: point(8.682, 50.110, 4326), // Frankfurt
109
+ * })
110
+ * ```
111
+ */
112
+ export declare const point: (lon: number, lat: number, srid?: number) => string;
113
+
114
+ /**
115
+ * Construct a PostGIS Polygon from a list of rings. The first ring is the
116
+ * exterior boundary; subsequent rings are holes. Each ring is an array of
117
+ * `[lon, lat]` tuples and MUST be closed (first point equal to last point).
118
+ */
119
+ export declare const polygon: (rings: ReadonlyArray<ReadonlyArray<Position>>, srid?: number) => string;
120
+
121
+ /** A `[lon, lat]` (x, y) coordinate — the WKT / GeoJSON axis order. */
122
+ export declare type Position = readonly [number, number];
123
+
124
+ /**
125
+ * `ST_Intersects(column, ST_Buffer(geom, meters))` — true when `column`'s
126
+ * geometry comes within `meters` of `geom`. The buffer is grown on a
127
+ * geography round-trip so the radius is metric regardless of SRID. A
128
+ * shape-aware alternative to `ST_DWithin` when `geom` is a line/polygon and
129
+ * you want "everything the swollen shape touches".
130
+ */
131
+ export declare const ST_Buffer: (column: string, geom: string, meters: number) => PredicateLeaf;
132
+
133
+ /**
134
+ * `ST_Contains(column, geom)` — true when `column`'s geometry fully contains
135
+ * `geom`.
136
+ */
137
+ export declare const ST_Contains: (column: string, geom: string) => PredicateLeaf;
138
+
139
+ /**
140
+ * `ST_DWithin(column, geom, meters)` — true when `column`'s value is within
141
+ * `meters` of `geom` (metric distance: the column is cast to `geography`).
142
+ * `geom` is a WKT/EWKT string (use `point(...)` / `polygon(...)`).
143
+ */
144
+ export declare const ST_DWithin: (column: string, geom: string, meters: number) => PredicateLeaf;
145
+
146
+ /**
147
+ * `ST_Intersects(column, geom)` — true when `column`'s geometry shares any
148
+ * point with `geom`.
149
+ */
150
+ export declare const ST_Intersects: (column: string, geom: string) => PredicateLeaf;
151
+
152
+ /**
153
+ * `ST_Within(column, geom)` — true when `column`'s geometry is fully within
154
+ * `geom` (the converse of `ST_Contains`). Use it for "rows inside this
155
+ * polygon".
156
+ */
157
+ export declare const ST_Within: (column: string, geom: string) => PredicateLeaf;
158
+
159
+ /**
160
+ * Project the distance between each row's `column` and `geom` as a selectable
161
+ * value: `ST_Distance("column", geom) AS "<alias>"`. Apply via `.use(...)`;
162
+ * the alias (default `'distance'`) appears on each returned row as a `number`.
163
+ * Metric metres by default (both operands cast to `geography`); pass
164
+ * `{ useGeography: false }` for planar SRID-unit distance.
165
+ *
166
+ * ```ts
167
+ * const rows = await store.query(
168
+ * queryFor(venues)
169
+ * .use(withDistance('location', point(8.682, 50.110), { as: 'meters' }))
170
+ * .descriptor,
171
+ * )
172
+ * // rows[i].meters === distance in metres
173
+ * ```
174
+ */
175
+ export declare const withDistance: (column: string, geom: string, options?: {
176
+ as?: string;
177
+ useGeography?: boolean;
178
+ }) => QueryTransform;
179
+
180
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,71 @@
1
+ import { geography as e, geometry as t, spatialPredicate as n } from "@voltro/database";
2
+ //#region src/index.ts
3
+ var r = (e) => e.map(([e, t]) => `${e} ${t}`).join(", "), i = (e) => e.map((e) => `(${r(e)})`).join(", "), a = (e, t, n = 4326) => `SRID=${n};POINT(${e} ${t})`, o = (e, t = 4326) => `SRID=${t};LINESTRING(${r(e)})`, s = (e, t = 4326) => `SRID=${t};POLYGON(${i(e)})`, c = (e, t = 4326) => `SRID=${t};MULTIPOINT(${r(e)})`, l = (e, t = 4326) => `SRID=${t};MULTILINESTRING(${e.map((e) => `(${r(e)})`).join(", ")})`, u = (e, t = 4326) => `SRID=${t};MULTIPOLYGON(${e.map((e) => `(${i(e)})`).join(", ")})`, d = (e) => {
4
+ switch (e.type) {
5
+ case "Point": return a(e.coordinates[0], e.coordinates[1], 4326);
6
+ case "LineString": return o(e.coordinates, 4326);
7
+ case "Polygon": return s(e.coordinates, 4326);
8
+ case "MultiPoint": return c(e.coordinates, 4326);
9
+ case "MultiLineString": return l(e.coordinates, 4326);
10
+ case "MultiPolygon": return u(e.coordinates, 4326);
11
+ }
12
+ }, f = (e, t, r) => n(e, {
13
+ fn: "ST_DWithin",
14
+ geom: t,
15
+ distanceMeters: r
16
+ }), p = (e, t) => n(e, {
17
+ fn: "ST_Contains",
18
+ geom: t
19
+ }), m = (e, t) => n(e, {
20
+ fn: "ST_Within",
21
+ geom: t
22
+ }), h = (e, t) => n(e, {
23
+ fn: "ST_Intersects",
24
+ geom: t
25
+ }), g = (e, t, r) => n(e, {
26
+ fn: "ST_Intersects",
27
+ geom: t,
28
+ bufferMeters: r
29
+ }), _ = (e, t) => n(e, {
30
+ fn: "&&",
31
+ geom: t
32
+ }), v = (e, t, n, r, i = 4326) => s([[
33
+ [e, t],
34
+ [n, t],
35
+ [n, r],
36
+ [e, r],
37
+ [e, t]
38
+ ]], i), y = (e, t, n) => (r) => {
39
+ let i = n?.as ?? "distance", a = n?.useGeography ?? !0, o = r.spatialClause ?? {
40
+ column: e,
41
+ geom: t,
42
+ useGeography: a
43
+ };
44
+ return {
45
+ ...r,
46
+ spatialClause: {
47
+ ...o,
48
+ column: e,
49
+ geom: t,
50
+ useGeography: a,
51
+ projectAs: i
52
+ }
53
+ };
54
+ }, b = (e, t, n) => (r) => {
55
+ let i = n?.direction ?? "asc", a = r.spatialClause ?? {
56
+ column: e,
57
+ geom: t,
58
+ useGeography: !0
59
+ };
60
+ return {
61
+ ...r,
62
+ spatialClause: {
63
+ ...a,
64
+ column: e,
65
+ geom: t,
66
+ order: i
67
+ }
68
+ };
69
+ };
70
+ //#endregion
71
+ export { g as ST_Buffer, p as ST_Contains, f as ST_DWithin, h as ST_Intersects, m as ST_Within, _ as bboxOverlaps, v as envelope, d as geoJson, e as geography, t as geometry, o as lineString, l as multiLineString, c as multiPoint, u as multiPolygon, b as nearestBy, a as point, s as polygon, y as withDistance };
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@voltro/plugin-postgis",
3
+ "version": "0.1.0",
4
+ "description": "PostGIS plugin — postgres-native geometry/geography columns and spatial predicates (ST_DWithin, ST_Contains, ST_Intersects) for location-aware apps; declare GiST indexes via .expressionIndex(..., { kind: 'gist' }). Postgres-only; other dialects fail loud at schema emission.",
5
+ "keywords": [
6
+ "voltro",
7
+ "typescript",
8
+ "framework"
9
+ ],
10
+ "license": "SEE LICENSE IN LICENSE",
11
+ "homepage": "https://voltro.dev",
12
+ "bugs": {
13
+ "email": "support@voltro.dev"
14
+ },
15
+ "author": {
16
+ "name": "Voltro UG",
17
+ "url": "https://voltro.dev"
18
+ },
19
+ "type": "module",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js",
24
+ "default": "./dist/index.js"
25
+ }
26
+ },
27
+ "main": "./dist/index.js",
28
+ "module": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "sideEffects": false,
31
+ "engines": {
32
+ "node": ">=24.0.0"
33
+ },
34
+ "dependencies": {
35
+ "@voltro/database": "0.1.0"
36
+ },
37
+ "peerDependencies": {
38
+ "effect": "^3.21.4"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ }
43
+ }