Skip to content

Commit

Permalink
chore: add extension running instructions to readme (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
pert5432 committed Sep 18, 2024
1 parent 4bbcddb commit 3f68e80
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,39 @@ sudo apt install libclang-dev
sudo pacman -S extra/clang
```

### Running the Extension

First, start pgrx:

```bash
cargo pgrx run
```

This will launch an interactive connection to Postgres. Inside Postgres, create the extension by running:

```sql
CREATE EXTENSION pg_analytics;
```

Now, you have access to all the extension functions.

### Modifying the Extension

If you make changes to the extension code, follow these steps to update it:

1. Recompile the extension:

```bash
cargo pgrx run
```

2. Recreate the extension to load the latest changes:

```sql
DROP EXTENSION pg_analytics;
CREATE EXTENSION pg_analytics;
```

### Running Tests

We use `cargo test` as our runner for `pg_analytics` tests. Tests are conducted using [testcontainers](https://github.com/testcontainers/testcontainers-rs) to manage testing containers like [LocalStack](https://hub.docker.com/r/localstack/localstack). `testcontainers` will pull any Docker images that it requires to perform the test.
Expand Down

0 comments on commit 3f68e80

Please sign in to comment.