Document not found (404)
+This URL is invalid, sorry. Please use the navigation bar or search to continue.
+ +diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2931ff6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Mdbook build + +on: + push: + branches: ["main"] + +jobs: + build: + name: build + runs-on: ubuntu-latest + env: + MDBOOK_VERSION: '0.4.12' + MDBOOK_LINKCHECK_VERSION: '0.7.4' + MDBOOK_MERMAID_VERSION: '0.8.3' + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Install mdbook + run: | + mkdir ~/tools + curl -L https://github.com/rust-lang/mdBook/releases/download/v$MDBOOK_VERSION/mdbook-v$MDBOOK_VERSION-x86_64-unknown-linux-gnu.tar.gz | tar xz -C ~/tools + curl -L https://github.com/badboy/mdbook-mermaid/releases/download/v$MDBOOK_MERMAID_VERSION/mdbook-mermaid-v$MDBOOK_MERMAID_VERSION-x86_64-unknown-linux-gnu.tar.gz | tar xz -C ~/tools + curl -L https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v$MDBOOK_LINKCHECK_VERSION/mdbook-linkcheck.v$MDBOOK_LINKCHECK_VERSION.x86_64-unknown-linux-gnu.zip -O + unzip mdbook-linkcheck.v$MDBOOK_LINKCHECK_VERSION.x86_64-unknown-linux-gnu.zip -d ~/tools + chmod +x ~/tools/mdbook-linkcheck + curl -s https://api.github.com/repos/zjp-CN/mdbook-theme/releases/latest \ + | grep browser_download_url \ + | grep mdbook-theme_linux \ + | cut -d '"' -f 4 \ + | wget -qi - + tar -xzf mdbook-theme_linux.tar.gz -C ~/tools + echo ~/tools >> $GITHUB_PATH + - name: Build + run: mdbook build + # share between different jobs + - uses: actions/upload-artifact@v3 + with: + name: docs + path: docs/ \ No newline at end of file diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml new file mode 100644 index 0000000..3997f9f --- /dev/null +++ b/.github/workflows/pages.yaml @@ -0,0 +1,50 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + workflow_run: + workflows: ["Mdbook build"] + types: + - completed + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Disallow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + # actions/download-artifact@v3 does not allow sharing across workflows + - name: Download artifact + id: download-artifact + uses: dawidd6/action-download-artifact@v2 + with: + name: book + path: book/ + workflow: build.yml + - name: Setup Pages + uses: actions/configure-pages@v2 + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: book + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 \ No newline at end of file diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml deleted file mode 100644 index 798e42b..0000000 --- a/.github/workflows/reviewdog.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: reviewdog -on: [pull_request] -jobs: - golangci-lint: - name: runner / golangci-lint - runs-on: ubuntu-latest - steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v1 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: '1.21.1' - - name: golangci-lint - uses: reviewdog/action-golangci-lint@v1 diff --git a/docker-compose.yaml b/docker-compose.yaml index af2ed15..64a676f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,25 +1,24 @@ version: "3" services: - server: - image: postgrest/postgrest + rest: + image: postgrest/postgrest:latest ports: - - "3000:3000" + - "127.0.0.1:3000:3000" environment: PGRST_DB_URI: postgres://postgres:postgres@db:5432/postgres - PGRST_DB_SCHEMA: public - PGRST_DB_ANON_ROLE: postgres # In production this role should not be the same as the one used for connection - PGRST_OPENAPI_SERVER_PROXY_URI: "http://127.0.0.1:3000" + PGRST_DB_SCHEMA: public, personal + PGRST_DB_ANON_ROLE: postgres + PGRST_JWT_SECRET: "reallyreallyreallyreallyverysafe" depends_on: - db db: - image: postgres + image: postgres:14 ports: - - "5432:5432" + - "127.0.0.1:5432:5432" + volumes: + - ./test:/docker-entrypoint-initdb.d/ environment: POSTGRES_DB: postgres POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres - # Uncomment this if you want to persist the data. Create your boostrap SQL file in the project root - volumes: - - "./pgdata:/var/lib/postgresql/data" -# - "./init.sql:/docker-entrypoint-initdb.d/init.sql" \ No newline at end of file + POSTGRES_PORT: 5432 \ No newline at end of file diff --git a/docs/book.toml b/docs/book.toml new file mode 100644 index 0000000..f6ccca4 --- /dev/null +++ b/docs/book.toml @@ -0,0 +1,6 @@ +[book] +authors = ["Murat Mirgün Ercan"] +language = "en" +multilingual = false +src = "src" +title = "Postgrest Go Docs" diff --git a/docs/book/.nojekyll b/docs/book/.nojekyll new file mode 100644 index 0000000..f173110 --- /dev/null +++ b/docs/book/.nojekyll @@ -0,0 +1 @@ +This file makes sure that Github Pages doesn't process mdBook's output. diff --git a/docs/book/404.html b/docs/book/404.html new file mode 100644 index 0000000..3c33331 --- /dev/null +++ b/docs/book/404.html @@ -0,0 +1,218 @@ + + +
+ + +This URL is invalid, sorry. Please use the navigation bar or search to continue.
+ +Golang client for PostgREST. The goal of this library is to make an "ORM-like" restful interface.
+Full documentation can be found here.
+Install
+go get github.com/supabase-community/postgrest-go
+
+Usage
+package main
+
+import (
+ "fmt"
+
+ "github.com/supabase-community/postgrest-go"
+)
+
+func main() {
+ client := postgrest.NewClient("http://localhost:3000/rest/v1", "", nil)
+ if client.ClientError != nil {
+ panic(client.ClientError)
+ }
+
+ result := client.Rpc("add_them", "", map[string]int{"a": 12, "b": 3})
+ if client.ClientError != nil {
+ panic(client.ClientError)
+ }
+
+ fmt.Println(result)
+}
+
+Some tests are implemented to run against mocked Postgrest endpoints. Optionally, tests can be run against an actual Postgrest instance by setting a POSTGREST_URL
environment variable to the fully-qualified URL to a Postgrest instance, and, optionally, an API_KEY
environment variable (if, for example, testing against a local Supabase instance).
A script is included in the test directory that can be used to seed the test database.
+To run all tests:
+go test ./...
+
+Made with contrib.rocks.
+This repo is licensed under the Apache License.
+We are building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products don’t exist we build them and open source them ourselves. Thanks to these sponsors who are making the OSS ecosystem better for everyone.
+ + +