The Grove Postgres Driver schema file
uses a subset of tables from the existing Grove Portal database schema, allowing PATH to source its authorization data from the existing Grove Portal database.
It converts the data stored in the portal_applications table and its associated tables into the PortalApp format expected by PEAS.
It also listens for updates to the Grove Portal DB and streams updates to PEAS in real time as changes are made to the connected Postgres database.
This ERD shows the subset of tables from the full Grove Portal DB schema that are used by the Grove Postgres Driver in PEAS.
erDiagram
ACCOUNTS {
VARCHAR(10) id PK
VARCHAR(25) plan_type FK
INT monthly_user_limit
}
PORTAL_APPLICATIONS {
VARCHAR(24) id PK
VARCHAR(10) account_id FK
BOOLEAN deleted
TIMESTAMP deleted_at
}
PORTAL_APPLICATION_SETTINGS {
SERIAL id PK
VARCHAR(24) application_id FK
VARCHAR(64) secret_key
BOOLEAN secret_key_required
}
PORTAL_APPLICATION_CHANGES {
SERIAL id PK
VARCHAR(24) portal_app_id
BOOLEAN is_delete
TIMESTAMP changed_at
TIMESTAMP processed_at
}
ACCOUNTS ||--o{ PORTAL_APPLICATIONS : "id"
PORTAL_APPLICATIONS ||--o{ PORTAL_APPLICATION_SETTINGS : "id"
The Postgres Driver uses SQLC to autogenerate the Postgres Go code needed to interact with the Postgres database/
The Make target make gen_sqlc will regenerate the Go code from the SQLC schema file.
This will output code autogenerated from the postgres/grove/sqlc/grove_schema.sql and postgres/grove/sqlc/grove_queries.sql files to the postgres/grove/sqlc directory.
SQLC configuration is defined in the postgres/sqlc/sqlc.yaml file.
