-
Notifications
You must be signed in to change notification settings - Fork 377
[HELP WANTED] PostGIS #807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
105 commits
Select commit
Hold shift + click to select a range
811205d
initial commit
tdrz 3385c69
bug fixes; cleanup; most pglite tests pass
tdrz 8718b1f
Merge branch 'main' into tdrz/cbDataTransport
tdrz d2f112c
update submodule
tdrz 6c8775c
Merge branch 'main' into tdrz/cbDataTransport
tdrz 8db8172
Merge branch 'main' into tdrz/cbDataTransport
tdrz c6c0bb5
Merge branch 'main' into tdrz/cbDataTransport
tdrz 5c41321
cleanup
tdrz f6c512c
style
tdrz 34eff39
change buffer size expansion strategy
tdrz da19cf0
fixes #657
tdrz 30a1397
changeset
tdrz b607f50
update submodule
tdrz dfb571b
Merge branch 'main' into tdrz/pglite-ccoderefactoring
tdrz e258375
update submodule
tdrz 61af32a
update submodule
tdrz b8dba43
remove get_buffer_size and get_buffer_addr"
tdrz e9047f2
update submodule
tdrz 4598daa
update submodule
tdrz 5494735
update submodule
tdrz ef11f15
update submodule
tdrz 1c917ad
update submodule
tdrz 6d9a963
update submodule
tdrz c52ae19
update submodule
tdrz 61d9dba
try again
tdrz d6a55a1
update submodule
tdrz 415e62c
submodule
tdrz a962996
submodule
tdrz c9e7dda
more tests; updated submodules
tdrz cd69a27
improvements
tdrz 6753533
submodule
tdrz d4f4cbb
add final result messages
tdrz 5563e0e
update submodule
tdrz 7b07596
renaming; prettify
tdrz 28817bc
test update
tdrz 365b236
run sync after getting types from db
tdrz 261c3f8
add results returned by sync
2c57d38
style
2b97c3b
submodule; improved build command
tdrz b76e71c
submodule
tdrz 7a68dab
postgis tests
tdrz e260de3
submodule
tdrz dbae0ff
submodule
tdrz b2b9d40
submodule
tdrz dff5727
submodule
tdrz b7709a3
submodule
tdrz 14d406c
merge tdrz/ccoderefactoring; update submodule
tdrz aea919f
a more complex postgis test; update submodule;
tdrz 9bb972b
cleanup; update submodule
tdrz bda4b68
cleanupof additional syncs; update submodule
tdrz 43ea96c
update submodule
tdrz 5515bbf
Merge branch 'tdrz/pglite-ccoderefactoring' into tdrz/frontend-try-po…
tdrz f95eb51
Revert "update submodule"
tdrz 6bb2061
revert submodule update
tdrz dba962b
update submodule
tdrz c5af87d
stylecheck
tdrz 1b953e4
undo
tdrz 0045c96
Merge branch 'tdrz/pglite-ccoderefactoring' into tdrz/frontend-try-po…
tdrz cddcf79
update submodule
tdrz 31f7b7c
stylecheck
tdrz 28b2ae8
comment out complex1 postgis test
tdrz f850e9e
style
tdrz 2c91499
merge upstream
tdrz 7546a11
reenable failing tests
tdrz cbf1654
update submodule
tdrz deafe66
style
tdrz 93f8d38
update submodule
tdrz 451639b
simple area tests
tdrz e4e2cef
topology test
tdrz fbbc50c
test desc
tdrz 2a84e38
add postgis to REPL
tdrz a2650e1
postgis description in docs extensions
tdrz de5ecbb
update submodule
tdrz 0621fe6
submodule
tdrz d9edecf
merge main
tdrz 8f4f902
update submodule
tdrz ec2201c
moved postgis extension to new npm package
tdrz 548c2c9
moved postgis extension to new npm package 2
tdrz dcbea30
update submodule
tdrz 2e12816
udpate submodule
tdrz f312627
merge main
tdrz 77b325a
update submodule
tdrz c7e00d7
revert submodule
tdrz 4a7d4d6
Merge remote-tracking branch 'origin/main' into tdrz/postgis-bak
tdrz f73d659
update CI
tdrz a8d8f20
update submodule
tdrz 647c87e
update submodule
tdrz 14bff07
update submodule
tdrz 6162e78
update submodule
tdrz b10d6b2
update submodule
tdrz cb446c9
update submodule
tdrz bd85583
update workflow
tdrz 7d863a6
update submodule
tdrz 47abdb1
update submodule
tdrz 4c27eb6
allow extensions to be loaded in pglite-socket
tdrz 7c58d52
allow extensions to be loaded in pglite-socket
tdrz 63eb0a3
update submodule
tdrz 3ff5163
Merge branch 'tdrz/postgis-bak' into tdrz/frontend-try-postgis2
tdrz c9b8010
update submodule
tdrz 1992f94
update submodule
tdrz ce87422
Merge branch 'tdrz/postgis-bak' into tdrz/frontend-try-postgis2
tdrz e86d61d
fix preloaded file
tdrz db12323
merge main
tdrz 689f759
upload artifacts sooner
tdrz 0b0e038
update submodule
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| release/* | ||
| dist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # @electric-sql/pglite-postgis | ||
|
|
||
| ## 0.0.1 | ||
|
|
||
| - Initial release | ||
| - PostGIS extension extracted from `@electric-sql/pglite` | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # @electric-sql/pglite-postgis | ||
|
|
||
| PostGIS extension for [PGlite](https://pglite.dev). | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| npm install @electric-sql/pglite-postgis | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ```typescript | ||
| import { PGlite } from '@electric-sql/pglite' | ||
| import { postgis } from '@electric-sql/pglite-postgis' | ||
|
|
||
| const pg = new PGlite({ | ||
| extensions: { | ||
| postgis, | ||
| }, | ||
| }) | ||
|
|
||
| await pg.exec('CREATE EXTENSION IF NOT EXISTS postgis;') | ||
|
|
||
| // Create a table with geometry columns | ||
| await pg.exec(` | ||
| CREATE TABLE cities ( | ||
| id SERIAL PRIMARY KEY, | ||
| name TEXT NOT NULL, | ||
| location GEOMETRY(Point, 4326) | ||
| ); | ||
| `) | ||
|
|
||
| // Insert data | ||
| await pg.query(` | ||
| INSERT INTO cities (name, location) | ||
| VALUES ('New York', ST_GeomFromText('POINT(-74.0060 40.7128)', 4326)) | ||
| `) | ||
|
|
||
| // Query with spatial functions | ||
| const result = await pg.query(` | ||
| SELECT name, ST_AsText(location) as location | ||
| FROM cities | ||
| `) | ||
| ``` | ||
|
|
||
| ## License | ||
|
|
||
| Apache-2.0 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import globals from 'globals' | ||
| import rootConfig from '../../eslint.config.js' | ||
|
|
||
| export default [ | ||
| ...rootConfig, | ||
| { | ||
| ignores: ['release/**/*', 'dist/**/*'], | ||
| }, | ||
| { | ||
| languageOptions: { | ||
| globals: { | ||
| ...globals.browser, | ||
| ...globals.node, | ||
| }, | ||
| }, | ||
| rules: { | ||
| ...rootConfig.rules, | ||
| '@typescript-eslint/no-explicit-any': 'off', | ||
| }, | ||
| }, | ||
| ] | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| { | ||
| "name": "@electric-sql/pglite-postgis", | ||
| "version": "0.0.1", | ||
| "description": "PostGIS extension for PGlite", | ||
| "author": "Electric DB Limited", | ||
| "homepage": "https://pglite.dev", | ||
| "license": "Apache-2.0", | ||
| "keywords": [ | ||
| "postgres", | ||
| "sql", | ||
| "database", | ||
| "wasm", | ||
| "pglite", | ||
| "postgis", | ||
| "gis", | ||
| "geospatial" | ||
| ], | ||
| "private": false, | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "type": "module", | ||
| "main": "./dist/index.cjs", | ||
| "module": "./dist/index.js", | ||
| "types": "./dist/index.d.ts", | ||
| "exports": { | ||
| ".": { | ||
| "import": { | ||
| "types": "./dist/index.d.ts", | ||
| "default": "./dist/index.js" | ||
| }, | ||
| "require": { | ||
| "types": "./dist/index.d.cts", | ||
| "default": "./dist/index.cjs" | ||
| } | ||
| } | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/electric-sql/pglite.git", | ||
| "directory": "packages/pglite-postgis" | ||
| }, | ||
| "scripts": { | ||
| "build": "tsup", | ||
| "check:exports": "attw . --pack --profile node16", | ||
| "lint": "eslint ./src ./tests --report-unused-disable-directives --max-warnings 0", | ||
| "format": "prettier --write ./src ./tests", | ||
| "typecheck": "tsc", | ||
| "stylecheck": "pnpm lint && prettier --check ./src ./tests", | ||
| "test": "vitest", | ||
| "prepublishOnly": "pnpm check:exports" | ||
| }, | ||
| "devDependencies": { | ||
| "@arethetypeswrong/cli": "^0.18.1", | ||
| "@electric-sql/pglite": "workspace:*", | ||
| "@types/node": "^20.16.11", | ||
| "vitest": "^2.1.2" | ||
| }, | ||
| "peerDependencies": { | ||
| "@electric-sql/pglite": "workspace:0.3.14" | ||
| } | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import type { | ||
| Extension, | ||
| ExtensionSetupResult, | ||
| PGliteInterface, | ||
| } from '@electric-sql/pglite' | ||
|
|
||
| const setup = async (_pg: PGliteInterface, emscriptenOpts: any) => { | ||
| return { | ||
| emscriptenOpts, | ||
| bundlePath: new URL('../release/postgis.tar.gz', import.meta.url), | ||
| } satisfies ExtensionSetupResult | ||
| } | ||
|
|
||
| export const postgis = { | ||
| name: 'postgis', | ||
| setup, | ||
| } satisfies Extension |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.