Skip to content

Commit

Permalink
removed db auto create, added compressed connection, fix docbuilder d…
Browse files Browse the repository at this point in the history
…elete before create table
  • Loading branch information
Gioee committed Jun 15, 2024
1 parent 060c0c8 commit 678feb3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
strip-md-titles: true
strip-jsx: true
strip-html: true
path: docs
path: docs/commands
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 678feb3

Please sign in to comment.