-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add mongo sink and some fixes for drizzle sink (#127)
- Loading branch information
Showing
25 changed files
with
967 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -33,6 +33,12 @@ jobs: | |
uses: arduino/setup-protoc@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Start MongoDB | ||
uses: supercharge/[email protected] | ||
with: | ||
mongodb-version: '7.0' | ||
mongodb-replica-set: rs0 | ||
mongodb-port: 27017 | ||
- name: Install dependencies | ||
run: pnpm install --strict-peer-dependencies=false | ||
- name: Run lint | ||
|
7 changes: 7 additions & 0 deletions
7
change/@apibara-indexer-b2b2208a-7a4e-4779-826d-c246b023891a.json
This file contains 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 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "indexer: rename drizzle sink factory and fix update method", | ||
"packageName": "@apibara/indexer", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@apibara-sink-mongo-0e59869f-bf56-417c-b432-622a2c1bb1da.json
This file contains 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 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "sink-mongo: add mongodb sink", | ||
"packageName": "@apibara/sink-mongo", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
This file contains 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 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 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 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 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 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,10 @@ | ||
version: "3.8" | ||
|
||
services: | ||
postgres: | ||
image: postgres:16 | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
ports: | ||
- 5432:5432 |
This file contains 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 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 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 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 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 @@ | ||
# `@apibara/sink-mongo` | ||
|
||
TODO | ||
|
||
## Installation | ||
|
||
TODO |
This file contains 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,11 @@ | ||
import { defineBuildConfig } from "unbuild"; | ||
|
||
export default defineBuildConfig({ | ||
entries: ["./src/index.ts"], | ||
clean: true, | ||
outDir: "./dist", | ||
declaration: true, | ||
rollup: { | ||
emitCJS: true, | ||
}, | ||
}); |
This file contains 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,26 @@ | ||
# Reference: https://medium.com/workleap/the-only-local-mongodb-replica-set-with-docker-compose-guide-youll-ever-need-2f0b74dd8384 | ||
|
||
version: "3.8" | ||
|
||
services: | ||
mongo1: | ||
image: mongo:7.0 | ||
command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27017"] | ||
ports: | ||
- 27017:27017 | ||
extra_hosts: | ||
- "localhost:host-gateway" | ||
healthcheck: | ||
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'localhost:27017'}]}) }" | mongosh --port 27017 --quiet | ||
interval: 5s | ||
timeout: 30s | ||
start_period: 0s | ||
start_interval: 1s | ||
retries: 30 | ||
volumes: | ||
- "mongo1_data:/data/db" | ||
- "mongo1_config:/data/configdb" | ||
|
||
volumes: | ||
mongo1_data: | ||
mongo1_config: |
This file contains 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,26 @@ | ||
# Reference: https://medium.com/workleap/the-only-local-mongodb-replica-set-with-docker-compose-guide-youll-ever-need-2f0b74dd8384 | ||
|
||
version: "3.8" | ||
|
||
services: | ||
mongo1: | ||
image: mongo:7.0 | ||
command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27017"] | ||
ports: | ||
- 27017:27017 | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
healthcheck: | ||
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'host.docker.internal:27017'}]}) }" | mongosh --port 27017 --quiet | ||
interval: 5s | ||
timeout: 30s | ||
start_period: 0s | ||
start_interval: 1s | ||
retries: 30 | ||
volumes: | ||
- "mongo1_data:/data/db" | ||
- "mongo1_config:/data/configdb" | ||
|
||
volumes: | ||
mongo1_data: | ||
mongo1_config: |
This file contains 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,41 @@ | ||
{ | ||
"name": "@apibara/sink-mongo", | ||
"version": "2.0.0-beta.26", | ||
"type": "module", | ||
"files": [ | ||
"dist", | ||
"src", | ||
"README.md" | ||
], | ||
"main": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs", | ||
"default": "./dist/index.mjs" | ||
} | ||
}, | ||
"scripts": { | ||
"build": "unbuild", | ||
"typecheck": "tsc --noEmit", | ||
"lint": "biome check .", | ||
"lint:fix": "pnpm lint --write", | ||
"test": "vitest", | ||
"test:ci": "vitest run" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.14.0", | ||
"mongodb": "^6.12.0", | ||
"unbuild": "^2.0.0", | ||
"vitest": "^1.6.0" | ||
}, | ||
"peerDependencies": { | ||
"mongodb": "^6.12.0" | ||
}, | ||
"dependencies": { | ||
"@apibara/indexer": "workspace:*", | ||
"@apibara/protocol": "workspace:*" | ||
} | ||
} |
Oops, something went wrong.