Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
janickr committed Aug 25, 2024
1 parent 84eb05e commit f4f3617
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@ A set of mysql stored functions/procedures to read protobuf binary data
See [decode using .proto files](#decode-using-proto-files) for an example.

- [Download and install](https://github.com/protocolbuffers/protobuf?tab=readme-ov-file#protobuf-compiler-installation) protoc
- Install myprotosql (requires python):

- Install myprotosql (requires python):

```bash
pip install myprotosql
```

- Run protoc with the myprotosql plugin (your `*.proto` files located in `./proto`, output in `./build`):

```bash
protoc --proto_path=proto --myprotosql_out=build ./proto/*
```

- Run the generated `install_myprotosql.sql` and `myproto_descriptors.sql` scripts in MySQL
If you used this proto file, you can now decode your first protobuf message

```mysql
select myproto_decode_to_textformat(
0x1a03089601, 'foo.bar.ParentMessage', myproto_descriptors());
Expand All @@ -29,15 +35,18 @@ See [decode using .proto files](#decode-using-proto-files) for an example.
This is similar to `protoc --decode_raw`. See [decode raw](#decode-raw) for an example.
- Install myprotosql (requires python):
```bash
pip install myprotosql
```
- Generate the install script
```bash
myprotosql-install-script > install_myprotosql.sql
```
- Run the generated `install_myprotosql.sql` script in MySQL
Decode your first protobuf message:
```mysql
select myproto_decode_to_textformat(0x1a03089601, null, null);
```
Expand Down

0 comments on commit f4f3617

Please sign in to comment.