generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sqlc-gen-ftl WASM plugin (#3607)
next step will be hooking this up in the release design: https://hackmd.io/09Z3vZJ0SxyIdCiQTSbVkg?view --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0ef8d89
commit 3ee16bc
Showing
47 changed files
with
7,219 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
/frontend/console/src/protos/**/* linguist-generated=true | ||
go.sum linguist-generated=true | ||
go.work.sum linguist-generated=true | ||
/python-runtime/ftl/src/ftl/protos/**/* linguist-generated=true | ||
/python-runtime/ftl/src/ftl/protos/**/* linguist-generated=true | ||
/sqlc-gen-ftl/src/protos/**/* linguist-generated=true | ||
/sqlc-gen-ftl/src/protos/mod.rs linguist-generated=false | ||
/sqlc-gen-ftl/src/protos/plugin.rs linguist-generated=false |
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 |
---|---|---|
|
@@ -103,6 +103,18 @@ jobs: | |
run: just build-frontend | ||
- name: Console Test | ||
run: just test-frontend | ||
test-wasm: | ||
name: Test sqlc-gen-ftl | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Init Hermit | ||
uses: cashapp/[email protected] | ||
- name: Build Cache | ||
uses: ./.github/actions/build-cache | ||
- name: Test WASM | ||
run: cd sqlc-gen-ftl && cargo test --features ci --test sqlc_gen_ftl_test -- --nocapture | ||
extension: | ||
name: VSCode Extension | ||
runs-on: ubuntu-latest | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hermit |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.rustup-1.25.2.pkg |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
if [ ! "${HERMIT_ENV:-}" ]; then | ||
# shellcheck disable=SC1091 | ||
. "$(dirname "$(dirname "$0")")/bin/activate-hermit" | ||
fi | ||
|
||
# Ensure the binary exists, install if it doesn't | ||
mk "${HERMIT_ENV}/.hermit/rust/bin/protoc-gen-prost" : -- cargo install protoc-gen-prost | ||
|
||
# Execute the binary with any passed arguments | ||
exec "${HERMIT_ENV}/.hermit/rust/bin/protoc-gen-prost" "$@" |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# Get sqlc version from hermit | ||
if [ ! "${HERMIT_ENV:-}" ]; then | ||
# shellcheck disable=SC1091 | ||
. "$(dirname "$(dirname "$0")")/bin/activate-hermit" | ||
fi | ||
|
||
SQLC_VERSION=$(hermit info sqlc | grep "Version:" | cut -d' ' -f2) | ||
if [[ -z "$SQLC_VERSION" ]]; then | ||
echo "Error: Could not determine sqlc version from hermit" | ||
exit 1 | ||
fi | ||
|
||
# Create temp directory | ||
TEMP_DIR=$(mktemp -d) | ||
trap 'rm -rf $TEMP_DIR' EXIT | ||
|
||
# Download and extract the release source | ||
echo "Fetching sqlc version ${SQLC_VERSION}..." | ||
curl -L --fail --silent \ | ||
"https://github.com/sqlc-dev/sqlc/archive/refs/tags/v${SQLC_VERSION}.tar.gz" \ | ||
-o "${TEMP_DIR}/sqlc.tar.gz" | ||
|
||
tar xzf "${TEMP_DIR}/sqlc.tar.gz" -C "${TEMP_DIR}" | ||
|
||
# Copy the proto file | ||
PROTO_PATH="${TEMP_DIR}/sqlc-${SQLC_VERSION}/protos/plugin/codegen.proto" | ||
if [[ ! -f "$PROTO_PATH" ]]; then | ||
echo "Error: Proto file not found in release archive" | ||
exit 1 | ||
fi | ||
|
||
cp "$PROTO_PATH" "sqlc-gen-ftl/proto/codegen.proto" | ||
echo "Updated proto file to version ${SQLC_VERSION}" |
Oops, something went wrong.