-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: postgres schema and repository API (WIP)
- Loading branch information
Showing
102 changed files
with
6,654 additions
and
6,117 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
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 |
---|---|---|
|
@@ -119,6 +119,12 @@ migrate: ## Run migration on development database | |
@echo "Running PostgreSQL migration" | ||
@go run $(GO_BUILD_PARAMS) dev/migrate/main.go | ||
|
||
generate-db: ## Generate repository/db with Jet | ||
@echo "Generating internal/repository/postgres/db with jet" | ||
@rm -rf internal/repository/postgres/db | ||
@go run github.com/go-jet/jet/v2/cmd/jet -dsn=$$CARTESI_POSTGRES_ENDPOINT -schema=public -path=./internal/repository/postgres/db | ||
@rm -rf internal/repository/postgres/db/rollupsdb/public/model | ||
|
||
# ============================================================================= | ||
# Clean | ||
# ============================================================================= | ||
|
@@ -169,7 +175,7 @@ applications/echo-dapp: ## Create echo-dapp test application | |
|
||
deploy-echo-dapp: applications/echo-dapp ## Deploy echo-dapp test application | ||
@echo "Deploying echo-dapp test application" | ||
@./cartesi-rollups-cli app deploy -t applications/echo-dapp/ -v | ||
@./cartesi-rollups-cli app deploy -n echo-dapp -t applications/echo-dapp/ -v | ||
|
||
# ============================================================================= | ||
# Static Analysis | ||
|
@@ -224,23 +230,6 @@ run-postgres: ## Run the PostgreSQL 16 docker container | |
@echo "Starting portgres" | ||
@docker run --rm --name postgres -p 5432:5432 -d -e POSTGRES_PASSWORD=password -e POSTGRES_DB=rollupsdb -v $(CURDIR)/test/postgres/init-test-db.sh:/docker-entrypoint-initdb.d/init-test-db.sh postgres:16-alpine | ||
|
||
run-postgraphile: ## Run the GraphQL server docker container | ||
@docker run --rm --name postgraphile -p 10004:10004 -d --init \ | ||
graphile/postgraphile:4.14.0 \ | ||
--retry-on-init-fail \ | ||
--dynamic-json \ | ||
--no-setof-functions-contain-nulls \ | ||
--no-ignore-rbac \ | ||
--enable-query-batching \ | ||
--enhance-graphiql \ | ||
--extended-errors errcode \ | ||
--legacy-relations omit \ | ||
--connection "postgres://postgres:[email protected]:5432/rollupsdb?sslmode=disable" \ | ||
--schema graphql \ | ||
--host "0.0.0.0" \ | ||
--port 10004 | ||
# --append-plugins @graphile-contrib/pg-simplify-inflector \ | ||
start: run-postgres run-devnet ## Start the anvil devnet and PostgreSQL 16 docker containers | ||
@$(MAKE) migrate | ||
|
||
|
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
Oops, something went wrong.