Skip to content

Commit

Permalink
Update schema table in @casimir/data
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejearley committed Mar 10, 2023
1 parent 2c8ecdb commit 3f75041
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions common/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,24 @@ JSON Schemas and Jupyter Notebooks for Casimir data modeling, exploration, and a

## Database Schemas

Find the core JSON object schemas in [src/schemas/](src/schemas/). These are the source of truth for data modeling in Casimir. When we deploy our Glue and Postgres tables, we use the schemas to generate columns from the object properties. See the reference tables below (one for Glue, and one for Postgres) for descriptions and links to the current schemas.
Find the core JSON object schemas in [src/schemas](src/schemas). These are the source of truth for data modeling in Casimir. When we deploy our Glue and Postgres tables, we use the schemas to generate columns from the object properties. See the reference table below for the database, table, file, and description of each schema.

> 🚩 To make a schema change, create a branch from `develop`, edit the JSON, and then make a PR to `develop`.
| Database | Table | Schema | Description |
| --- | --- | --- | --- |
| Glue | `events` | [event.schema.json](src/schemas/event.schema.json) | on or off-chain event |
| Glue | `aggs` | [agg.schema.json](src/schemas/agg.schema.json) | aggregate of events |
| Postgres | `accounts` | [account.schema.json](src/schemas/account.schema.json) | wallet account |
| Postgres | `users` | [user.schema.json](src/schemas/user.schema.json) | user profile |

### Glue
> 🚩 To iterate on a schema in context, see the commands below. To deploy a schema change, create a branch from `develop`, edit the JSON, and then make a PR to `develop`.
| Table | Schema | Description |
| --- | --- | --- |
| `events` | [event.schema.json](src/schemas/event.schema.json) | on or off-chain event |
| `aggs` | [agg.schema.json](src/schemas/agg.schema.json) | aggregate of events |

### Postgres

| Table | Schema | Description |
| --- | --- | --- |
| `accounts` | [account.schema.json](src/schemas/account.schema.json) | wallet account |
| `users` | [user.schema.json](src/schemas/user.schema.json) | user profile |

Run a local Postgres instance with the schemas above.
Run a local Postgres instance with the *current schemas*.

```zsh
npm run dev:postgres --workspace @casimir/data
```

Run and watch a local Postgres instance.
Run a local Postgres instance and *watch the schemas for changes*.

```zsh
npm run watch:postgres --workspace @casimir/data
Expand Down

0 comments on commit 3f75041

Please sign in to comment.