From 678feb338bee1dc2b7f7fc7c392ca4fb63ea26ca Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Sat, 15 Jun 2024 11:49:21 +0200 Subject: [PATCH] removed db auto create, added compressed connection, fix docbuilder delete before create table --- .github/workflows/test.yaml | 2 +- README.md | 1 - action.yml | 4 ++-- src/main.c | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 747bc9d..59a9eb3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,4 +20,4 @@ jobs: strip-md-titles: true strip-jsx: true strip-html: true - path: docs + path: docs/commands diff --git a/README.md b/README.md index 8649184..06cc087 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,6 @@ jobs: 3. Make sure you have a project on SQLite Cloud. If not, sign up for an account and create one. 4. Add the Project Connection String as a secret in your repository settings, named `PROJECT_STRING`. 5. Customize these inputs according to your needs. - * if the `database` input doesn't exist on the SQLite Cloud project the workflow will create it automatically. * if the `path` input isn't specified the workflow will search for every .md or .mdx file recursively from the root folder. * `strip-html`: Set this input to `true` if you want to remove the html elements. * `strip-jsx`: Set this input to `true` if you want to remove the jsx elements. diff --git a/action.yml b/action.yml index d31414b..7ef752f 100644 --- a/action.yml +++ b/action.yml @@ -51,7 +51,7 @@ runs: - name: Runs .sql builder run: | - args="--add-create-database --use-transactions --json" + args=" --use-transactions --json" [[ ${{ inputs.strip-html }} == true ]] && args+=" --strip-html" [[ ${{ inputs.strip-jsx }} == true ]] && args+=" --strip-jsx" [[ ${{ inputs.strip-md-titles }} == true ]] && args+=" --strip-md-titles" @@ -68,7 +68,7 @@ runs: echo -e "\", \"database\": \"${{ inputs.database }}\"}" >> up.json cat up.json URL="https:"$(echo ${{ inputs.project-string }} | awk -F ':' '{print $2}')":8090/v2/weblite/sql" - RES=$(curl $URL -H 'Content-Type: application/json' -H 'Authorization: Bearer ${{ inputs.project-string }}' -H 'accept: application/json' -d @up.json) + RES=$(curl --compressed $URL -H 'Content-Type: application/json' -H 'Authorization: Bearer ${{ inputs.project-string }}' -H 'accept: application/json' -d @up.json) echo $RES if [[ "$RES" =~ error ]]; then echo "Error on SQLite Cloud .sql execution" diff --git a/src/main.c b/src/main.c index 202fd5a..825e304 100644 --- a/src/main.c +++ b/src/main.c @@ -368,8 +368,8 @@ static void create_file (const char *path) { write_line("BEGIN TRANSACTION;", -1, 1); } - write_line("DELETE FROM documentation;", -1, 1); write_line("CREATE VIRTUAL TABLE IF NOT EXISTS documentation USING fts5 (url, content);", -1, 1); + write_line("DELETE FROM documentation;", -1, 1); } static void create_output (const char *path) {