diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ecbac919d7..69ec223b70 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -17,18 +17,4 @@ updates: directory: "/" schedule: interval: "daily" - - package-ecosystem: "pip" - directory: "/docs" - schedule: - interval: "daily" - ignore: - # sphinx-rtd-theme does not support the latest versions of docutils and - # sphinx - - dependency-name: "docutils" - - dependency-name: "sphinx" - groups: - production-dependencies: - dependency-type: "production" - development-dependencies: - dependency-type: "development" diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml index 7bc91bbf31..c77e9b459d 100644 --- a/.github/workflows/buf.yml +++ b/.github/workflows/buf.yml @@ -3,7 +3,6 @@ on: pull_request: paths-ignore: - 'docs/**' - - '.readthedocs.yaml' jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/ci-kotlin.yml b/.github/workflows/ci-kotlin.yml index 8d9ee558fc..177787bf7e 100644 --- a/.github/workflows/ci-kotlin.yml +++ b/.github/workflows/ci-kotlin.yml @@ -5,11 +5,9 @@ on: - main paths-ignore: - 'docs/**' - - '.readthedocs.yaml' pull_request: paths-ignore: - 'docs/**' - - '.readthedocs.yaml' jobs: build: if: false diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml index befe534d08..47328c7b71 100644 --- a/.github/workflows/ci-python.yml +++ b/.github/workflows/ci-python.yml @@ -5,11 +5,9 @@ on: - main paths-ignore: - 'docs/**' - - '.readthedocs.yaml' pull_request: paths-ignore: - 'docs/**' - - '.readthedocs.yaml' jobs: build: if: false diff --git a/.github/workflows/ci-typescript.yml b/.github/workflows/ci-typescript.yml index 7f0a15f15c..e5aac81fca 100644 --- a/.github/workflows/ci-typescript.yml +++ b/.github/workflows/ci-typescript.yml @@ -5,11 +5,9 @@ on: - main paths-ignore: - 'docs/**' - - '.readthedocs.yaml' pull_request: paths-ignore: - 'docs/**' - - '.readthedocs.yaml' jobs: build: if: false diff --git a/.readthedocs.yaml b/.readthedocs.yaml deleted file mode 100644 index 7895c313e4..0000000000 --- a/.readthedocs.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# .readthedocs.yaml -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -# Set the version of Python and other tools you might need -build: - os: ubuntu-22.04 - tools: - python: "3.11" - jobs: - post_checkout: - # Cancel PR builds that don't touch the docs. - # https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition - - | - if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/ .readthedocs.yaml; then - exit 183 - fi - -# Build documentation in the docs/ directory with Sphinx -sphinx: - configuration: docs/conf.py - -# We recommend specifying your dependencies to enable reproducible builds: -# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html -python: - install: - - requirements: docs/requirements.txt diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 541c08d37b..0000000000 --- a/docs/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -VENVDIR = _venv -BINDIR = $(VENVDIR)/bin -SPHINXBUILD = $(BINDIR)/sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: $(SPHINXBUILD) - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -$(SPHINXBUILD): $(VENVDIR) - $(VENVDIR)/bin/pip install -r requirements.txt - -$(VENVDIR): - python3 -m venv $(VENVDIR) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/_static/customize.css b/docs/_static/customize.css deleted file mode 100644 index a2dac557be..0000000000 --- a/docs/_static/customize.css +++ /dev/null @@ -1,17 +0,0 @@ -.wy-side-nav-search img { - padding: 5px 60px !important; -} - -#banner { - text-align: center; - background: #2980b9; - border: 1px solid rgb(52, 49, 49); - color: #F0F0F4; - padding: 10px; - margin-bottom: 1.618em; -} - -#banner > div > a { - color: #F0F0F4; - text-decoration: underline; -} diff --git a/docs/_static/favicon.png b/docs/_static/favicon.png deleted file mode 100644 index 17d8419a6c..0000000000 Binary files a/docs/_static/favicon.png and /dev/null differ diff --git a/docs/_static/logo.png b/docs/_static/logo.png deleted file mode 100644 index dd8a887094..0000000000 Binary files a/docs/_static/logo.png and /dev/null differ diff --git a/docs/_templates/breadcrumbs.html b/docs/_templates/breadcrumbs.html deleted file mode 100644 index 40a8b82be1..0000000000 --- a/docs/_templates/breadcrumbs.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends "!breadcrumbs.html" %} - -{% block breadcrumbs %} -{% if show_banner %} -{% endif %} -{{ super() }} -{% endblock %} diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html deleted file mode 100644 index fa58fc5a73..0000000000 --- a/docs/_templates/layout.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "!layout.html" %} - -{% block extrahead %} - -{{ super() }} -{% endblock %} diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index ff6f4df419..0000000000 --- a/docs/conf.py +++ /dev/null @@ -1,83 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) -import sphinx_rtd_theme - -# -- Project information ----------------------------------------------------- - -project = 'sqlc' -copyright = '2024, Riza, Inc.' -author = 'Riza, Inc.' - -# The full version, including alpha/beta/rc tags -release = '1.31.1' - - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - 'myst_parser', - 'sphinx_rtd_theme', - 'sphinx_favicon', - 'sphinxext.rediraffe', -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', '_venv', 'Thumbs.db', '.DS_Store'] - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = 'sphinx_rtd_theme' - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -html_logo = "_static/logo.png" -html_theme_options = { - 'logo_only': True, -} - -html_context = { - 'show_banner': 'SHOW_LAUNCH_BANNER' in os.environ, -} - -def setup(app): - app.add_css_file('customize.css') - -favicons = [ - "favicon.png", -] - -myst_enable_extensions = [ - "attrs_inline", - "colon_fence", -] - -rediraffe_redirects = { - "howto/upload.md": "howto/push.md", -} diff --git a/docs/guides/using-go-and-pgx.md b/docs/guides/using-go-and-pgx.md new file mode 100644 index 0000000000..c5b9db7cc5 --- /dev/null +++ b/docs/guides/using-go-and-pgx.md @@ -0,0 +1,125 @@ +# Using Go and pgx + +> [!NOTE] +> `pgx/v5` is supported starting from v1.18.0. + +pgx is a pure Go driver and toolkit for PostgreSQL. It's become the default +PostgreSQL package for many Gophers since lib/pq was put into maintenance mode. + +## Getting started + +To start generating code that uses pgx, set the `sql_package` field in +your `sqlc.yaml` configuration file. Valid options are `pgx/v4` or +`pgx/v5` + +```yaml +version: "2" +sql: + - engine: "postgresql" + queries: "query.sql" + schema: "query.sql" + gen: + go: + package: "db" + sql_package: "pgx/v5" + out: "db" +``` + +If you don't have an existing sqlc project on hand, create a directory with the +configuration file above and the following `query.sql` file. + +```sql +CREATE TABLE authors ( + id BIGSERIAL PRIMARY KEY, + name text NOT NULL, + bio text +); + +-- name: GetAuthor :one +SELECT * FROM authors +WHERE id = $1 LIMIT 1; + +-- name: ListAuthors :many +SELECT * FROM authors +ORDER BY name; + +-- name: CreateAuthor :one +INSERT INTO authors ( + name, bio +) VALUES ( + $1, $2 +) +RETURNING *; + +-- name: DeleteAuthor :exec +DELETE FROM authors +WHERE id = $1; +``` + +Generating the code will now give you pgx-compatible database access methods. + +```bash +sqlc generate +``` + +## Generated code walkthrough + +The generated code is very similar to the code generated when using +`lib/pq`. However, instead of using `database/sql`, the code uses +pgx types directly. + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/jackc/pgx/v5" + + "example.com/sqlc-tutorial/db" +) + +func main() { + // urlExample := "postgres://username:password@localhost:5432/database_name" + conn, err := pgx.Connect(context.Background(), os.Getenv("DATABASE_URL")) + if err != nil { + fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err) + os.Exit(1) + } + defer conn.Close(context.Background()) + + q := db.New(conn) + + author, err := q.GetAuthor(context.Background(), 1) + if err != nil { + fmt.Fprintf(os.Stderr, "GetAuthor failed: %v\n", err) + os.Exit(1) + } + + fmt.Println(author.Name) +} +``` + +> [!NOTE] +> For production applications, consider using pgxpool for connection pooling: +> +> ```go +> import ( +> "github.com/jackc/pgx/v5/pgxpool" +> "example.com/sqlc-tutorial/db" +> ) +> +> func main() { +> pool, err := pgxpool.New(context.Background(), os.Getenv("DATABASE_URL")) +> if err != nil { +> fmt.Fprintf(os.Stderr, "Unable to create connection pool: %v\n", err) +> os.Exit(1) +> } +> defer pool.Close() +> +> q := db.New(pool) +> // Use q the same way as with single connections +> } +> ``` diff --git a/docs/guides/using-go-and-pgx.rst b/docs/guides/using-go-and-pgx.rst deleted file mode 100644 index 68e2242926..0000000000 --- a/docs/guides/using-go-and-pgx.rst +++ /dev/null @@ -1,133 +0,0 @@ -================ -Using Go and pgx -================ - -.. note:: - :code:`pgx/v5` is supported starting from v1.18.0. - - -pgx is a pure Go driver and toolkit for PostgreSQL. It's become the default -PostgreSQL package for many Gophers since lib/pq was put into maintenance mode. - -^^^^^^^^^^^^^^^ -Getting started -^^^^^^^^^^^^^^^ - -To start generating code that uses pgx, set the :code:`sql_package` field in -your :code:`sqlc.yaml` configuration file. Valid options are :code:`pgx/v4` or -:code:`pgx/v5` - -.. code-block:: yaml - - version: "2" - sql: - - engine: "postgresql" - queries: "query.sql" - schema: "query.sql" - gen: - go: - package: "db" - sql_package: "pgx/v5" - out: "db" - -If you don't have an existing sqlc project on hand, create a directory with the -configuration file above and the following :code:`query.sql` file. - -.. code-block:: sql - - CREATE TABLE authors ( - id BIGSERIAL PRIMARY KEY, - name text NOT NULL, - bio text - ); - - -- name: GetAuthor :one - SELECT * FROM authors - WHERE id = $1 LIMIT 1; - - -- name: ListAuthors :many - SELECT * FROM authors - ORDER BY name; - - -- name: CreateAuthor :one - INSERT INTO authors ( - name, bio - ) VALUES ( - $1, $2 - ) - RETURNING *; - - -- name: DeleteAuthor :exec - DELETE FROM authors - WHERE id = $1; - - -Generating the code will now give you pgx-compatible database access methods. - -.. code-block:: bash - - sqlc generate - -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Generated code walkthrough -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The generated code is very similar to the code generated when using -:code:`lib/pq`. However, instead of using :code:`database/sql`, the code uses -pgx types directly. - -.. code-block:: go - - package main - - import ( - "context" - "fmt" - "os" - - "github.com/jackc/pgx/v5" - - "example.com/sqlc-tutorial/db" - ) - - func main() { - // urlExample := "postgres://username:password@localhost:5432/database_name" - conn, err := pgx.Connect(context.Background(), os.Getenv("DATABASE_URL")) - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err) - os.Exit(1) - } - defer conn.Close(context.Background()) - - q := db.New(conn) - - author, err := q.GetAuthor(context.Background(), 1) - if err != nil { - fmt.Fprintf(os.Stderr, "GetAuthor failed: %v\n", err) - os.Exit(1) - } - - fmt.Println(author.Name) - } - -.. note:: - For production applications, consider using pgxpool for connection pooling: - - .. code-block:: go - - import ( - "github.com/jackc/pgx/v5/pgxpool" - "example.com/sqlc-tutorial/db" - ) - - func main() { - pool, err := pgxpool.New(context.Background(), os.Getenv("DATABASE_URL")) - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to create connection pool: %v\n", err) - os.Exit(1) - } - defer pool.Close() - - q := db.New(pool) - // Use q the same way as with single connections - } diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000000..4b7f203033 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,22 @@ +# sqlc Documentation + +> And lo, the Great One looked down upon the people and proclaimed: +> "SQL is actually pretty great" + +sqlc generates **fully type-safe idiomatic Go code** from SQL. Here's how it +works: + +1. You write SQL queries +2. You run sqlc to generate Go code that presents type-safe interfaces to those + queries +3. You write application code that calls the methods sqlc generated + +Seriously, it's that easy. You don't have to write any boilerplate SQL querying +code ever again. + +## Getting started + +- [Installing sqlc](overview/install.md) +- [Getting started with MySQL](tutorials/getting-started-mysql.md) +- [Getting started with PostgreSQL](tutorials/getting-started-postgresql.md) +- [Getting started with SQLite](tutorials/getting-started-sqlite.md) diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index f11c8903d5..0000000000 --- a/docs/index.rst +++ /dev/null @@ -1,102 +0,0 @@ -.. sqlc documentation master file, created by - sphinx-quickstart on Mon Feb 1 23:18:36 2021. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -sqlc Documentation -================== - - And lo, the Great One looked down upon the people and proclaimed: - "SQL is actually pretty great" - -sqlc generates **fully type-safe idiomatic Go code** from SQL. Here's how it -works: - -1. You write SQL queries -2. You run sqlc to generate Go code that presents type-safe interfaces to those - queries -3. You write application code that calls the methods sqlc generated - -Seriously, it's that easy. You don't have to write any boilerplate SQL querying -code ever again. - -.. toctree:: - :maxdepth: 2 - :caption: Overview - :hidden: - - overview/install.md - -.. toctree:: - :maxdepth: 2 - :caption: Tutorials - :hidden: - - tutorials/getting-started-mysql.md - tutorials/getting-started-postgresql.md - tutorials/getting-started-sqlite.md - -.. toctree:: - :maxdepth: 2 - :caption: Commands - :hidden: - - howto/analyze.md - howto/generate.md - howto/parse.md - howto/push.md - howto/verify.md - howto/vet.md - -.. toctree:: - :maxdepth: 2 - :caption: How-to Guides - :hidden: - - howto/select.md - howto/query_count.md - howto/insert.md - howto/update.md - howto/delete.md - - howto/prepared_query.md - howto/transactions.md - howto/named_parameters.md - - howto/ddl.md - howto/structs.md - howto/embedding.md - howto/overrides.md - howto/rename.md - -.. toctree:: - :maxdepth: 3 - :caption: sqlc Cloud - :hidden: - - howto/managed-databases.md - -.. toctree:: - :maxdepth: 3 - :caption: Reference - :hidden: - - reference/changelog.md - reference/cli.md - reference/config.md - reference/datatypes.md - reference/environment-variables.md - reference/language-support.rst - reference/macros.md - reference/query-annotations.md - -.. toctree:: - :maxdepth: 2 - :caption: Conceptual Guides - :hidden: - - howto/ci-cd.md - guides/using-go-and-pgx.rst - guides/plugins.md - guides/development.md - guides/privacy.md diff --git a/docs/reference/language-support.md b/docs/reference/language-support.md new file mode 100644 index 0000000000..72f0a9f2e6 --- /dev/null +++ b/docs/reference/language-support.md @@ -0,0 +1,34 @@ +# Database and language support + +| Language | Plugin | MySQL | PostgreSQL | SQLite | +| ---------- | ---------------------------------------------------------------------- | ------ | ---------- | --------------- | +| Go | (built-in) | Stable | Stable | Beta | +| Go | [sqlc-gen-go](https://github.com/sqlc-dev/sqlc-gen-go) | Stable | Stable | Beta | +| Kotlin | [sqlc-gen-kotlin](https://github.com/sqlc-dev/sqlc-gen-kotlin) | Beta | Beta | Not implemented | +| Python | [sqlc-gen-python](https://github.com/sqlc-dev/sqlc-gen-python) | Beta | Beta | Not implemented | +| TypeScript | [sqlc-gen-typescript](https://github.com/sqlc-dev/sqlc-gen-typescript) | Beta | Beta | Not implemented | + +## Community language support + +New languages can be added via [plugins](../guides/plugins.md). + +| Language | Plugin | MySQL | PostgreSQL | SQLite | +| -------- | ------------------------------------------------------------------------------------- | ------ | ---------- | ------ | +| C# | [DaredevilOSS/sqlc-gen-csharp](https://github.com/DaredevilOSS/sqlc-gen-csharp) | Stable | Stable | Stable | +| F# | [kaashyapan/sqlc-gen-fsharp](https://github.com/kaashyapan/sqlc-gen-fsharp) | N/A | Beta | Beta | +| Java | [tandemdude/sqlc-gen-java](https://github.com/tandemdude/sqlc-gen-java) | Beta | Beta | N/A | +| PHP | [lcarilla/sqlc-plugin-php-dbal](https://github.com/lcarilla/sqlc-plugin-php-dbal) | Beta | N/A | N/A | +| Ruby | [DaredevilOSS/sqlc-gen-ruby](https://github.com/DaredevilOSS/sqlc-gen-ruby) | Beta | Beta | Beta | +| Zig | [tinyzimmer/sqlc-gen-zig](https://github.com/tinyzimmer/sqlc-gen-zig) | N/A | Beta | Beta | +| Python | [rayakame/sqlc-gen-better-python](https://github.com/rayakame/sqlc-gen-better-python) | N/A | Beta | Beta | +| Rust | [mathematic-inc/sqlc-gen-sqlx](https://github.com/mathematic-inc/sqlc-gen-sqlx) | N/A | Beta | N/A | +| \[Any\] | [fdietze/sqlc-gen-from-template](https://github.com/fdietze/sqlc-gen-from-template) | Stable | Stable | Stable | + +Plugins developed by our Community can also be found using our +[github topic](https://github.com/topics/sqlc-plugin). + +## Community projects + +| Language | Project | MySQL | PostgreSQL | SQLite | +| -------- | ----------------------------------------------------------------- | ------ | ---------- | ------ | +| Gleam | [daniellionel01/parrot](https://github.com/daniellionel01/parrot) | Stable | Stable | Stable | diff --git a/docs/reference/language-support.rst b/docs/reference/language-support.rst deleted file mode 100644 index 48840e1a3e..0000000000 --- a/docs/reference/language-support.rst +++ /dev/null @@ -1,58 +0,0 @@ -Database and language support -############################# - -========== ======================= ============ ============ =============== -Language Plugin MySQL PostgreSQL SQLite -========== ======================= ============ ============ =============== -Go (built-in) Stable Stable Beta -Go `sqlc-gen-go`_ Stable Stable Beta -Kotlin `sqlc-gen-kotlin`_ Beta Beta Not implemented -Python `sqlc-gen-python`_ Beta Beta Not implemented -TypeScript `sqlc-gen-typescript`_ Beta Beta Not implemented -========== ======================= ============ ============ =============== - -Community language support -************************** - -New languages can be added via :doc:`plugins <../guides/plugins>`. - -======== ================================== =============== =============== =============== -Language Plugin MySQL PostgreSQL SQLite -======== ================================== =============== =============== =============== -C# `DaredevilOSS/sqlc-gen-csharp`_ Stable Stable Stable -F# `kaashyapan/sqlc-gen-fsharp`_ N/A Beta Beta -Java `tandemdude/sqlc-gen-java`_ Beta Beta N/A -PHP `lcarilla/sqlc-plugin-php-dbal`_ Beta N/A N/A -Ruby `DaredevilOSS/sqlc-gen-ruby`_ Beta Beta Beta -Zig `tinyzimmer/sqlc-gen-zig`_ N/A Beta Beta -Python `rayakame/sqlc-gen-better-python`_ N/A Beta Beta -Rust `mathematic-inc/sqlc-gen-sqlx`_ N/A Beta N/A -[Any] `fdietze/sqlc-gen-from-template`_ Stable Stable Stable -======== ================================== =============== =============== =============== - -Plugins developed by our Community can also be found using our `github topic`_. - -Community projects -****************** - -======== ================================= =============== =============== =============== -Language Project MySQL PostgreSQL SQLite -======== ================================= =============== =============== =============== -Gleam `daniellionel01/parrot`_ Stable Stable Stable -======== ================================= =============== =============== =============== - -.. _sqlc-gen-go: https://github.com/sqlc-dev/sqlc-gen-go -.. _kaashyapan/sqlc-gen-fsharp: https://github.com/kaashyapan/sqlc-gen-fsharp -.. _sqlc-gen-kotlin: https://github.com/sqlc-dev/sqlc-gen-kotlin -.. _sqlc-gen-python: https://github.com/sqlc-dev/sqlc-gen-python -.. _sqlc-gen-typescript: https://github.com/sqlc-dev/sqlc-gen-typescript -.. _DaredevilOSS/sqlc-gen-csharp: https://github.com/DaredevilOSS/sqlc-gen-csharp -.. _DaredevilOSS/sqlc-gen-ruby: https://github.com/DaredevilOSS/sqlc-gen-ruby -.. _fdietze/sqlc-gen-from-template: https://github.com/fdietze/sqlc-gen-from-template -.. _lcarilla/sqlc-plugin-php-dbal: https://github.com/lcarilla/sqlc-plugin-php-dbal -.. _tandemdude/sqlc-gen-java: https://github.com/tandemdude/sqlc-gen-java -.. _tinyzimmer/sqlc-gen-zig: https://github.com/tinyzimmer/sqlc-gen-zig -.. _daniellionel01/parrot: https://github.com/daniellionel01/parrot -.. _rayakame/sqlc-gen-better-python: https://github.com/rayakame/sqlc-gen-better-python -.. _mathematic-inc/sqlc-gen-sqlx: https://github.com/mathematic-inc/sqlc-gen-sqlx -.. _github topic: https://github.com/topics/sqlc-plugin diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index fa2502d6ef..0000000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,27 +0,0 @@ -Babel==2.18.0 -Jinja2==3.1.6 -MarkupSafe==3.0.3 -Pygments==2.21.0 -Sphinx==8.2.3 -certifi==2026.7.22 -chardet==7.6.0 -commonmark==0.9.2 -docutils==0.20.1 -idna==3.19 -imagesize==2.0.0 -myst-parser==5.1.0 -packaging==26.3 -pyparsing==3.3.2 -pytz==2026.3.post1 -requests==2.34.2 -snowballstemmer==3.1.1 -sphinx-favicon==1.1.0 -sphinx-rtd-theme==3.1.0 -sphinxcontrib-applehelp==2.0.0 -sphinxcontrib-devhelp==2.0.0 -sphinxcontrib-htmlhelp==2.1.0 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==2.0.0 -sphinxcontrib-serializinghtml==2.0.0 -sphinxext-rediraffe==0.3.0 -urllib3==2.7.0 diff --git a/docs/toc.yaml b/docs/toc.yaml new file mode 100644 index 0000000000..4cbdbcd152 --- /dev/null +++ b/docs/toc.yaml @@ -0,0 +1,71 @@ +# Navigation for the sqlc documentation site. +# +# Every page in docs/ must appear exactly once, either in a section or in +# the unlisted set. Unlisted pages are published but do not appear in the +# sidebar. + +index: index.md + +sections: + - title: Overview + pages: + - overview/install.md + + - title: Tutorials + pages: + - tutorials/getting-started-mysql.md + - tutorials/getting-started-postgresql.md + - tutorials/getting-started-sqlite.md + + - title: Commands + pages: + - howto/analyze.md + - howto/generate.md + - howto/parse.md + - howto/push.md + - howto/verify.md + - howto/vet.md + + - title: How-to Guides + pages: + - howto/select.md + - howto/query_count.md + - howto/insert.md + - howto/update.md + - howto/delete.md + - howto/prepared_query.md + - howto/transactions.md + - howto/named_parameters.md + - howto/ddl.md + - howto/structs.md + - howto/embedding.md + - howto/overrides.md + - howto/rename.md + + - title: sqlc Cloud + pages: + - howto/managed-databases.md + + - title: Reference + pages: + - reference/changelog.md + - reference/cli.md + - reference/config.md + - reference/datatypes.md + - reference/environment-variables.md + - reference/language-support.md + - reference/macros.md + - reference/query-annotations.md + + - title: Conceptual Guides + pages: + - howto/ci-cd.md + - guides/using-go-and-pgx.md + - guides/plugins.md + - guides/development.md + - guides/privacy.md + +unlisted: + - guides/migrating-off-hosted-managed-databases.md + - guides/migrating-to-sqlc-gen-kotlin.md + - guides/migrating-to-sqlc-gen-python.md diff --git a/docs/tutorials/getting-started-mysql.md b/docs/tutorials/getting-started-mysql.md index b9f5d0ddf5..25e7d6182c 100644 --- a/docs/tutorials/getting-started-mysql.md +++ b/docs/tutorials/getting-started-mysql.md @@ -4,7 +4,7 @@ This tutorial assumes that the latest version of sqlc is [installed](../overview/install.md) and ready to use. We'll generate Go code here, but other -[language plugins](../reference/language-support.rst) are available. You'll +[language plugins](../reference/language-support.md) are available. You'll naturally need the Go toolchain if you want to build and run a program with the code sqlc generates, but sqlc itself has no dependencies. diff --git a/docs/tutorials/getting-started-postgresql.md b/docs/tutorials/getting-started-postgresql.md index fc28f7155a..d6045cffbd 100644 --- a/docs/tutorials/getting-started-postgresql.md +++ b/docs/tutorials/getting-started-postgresql.md @@ -4,7 +4,7 @@ This tutorial assumes that the latest version of sqlc is [installed](../overview/install.md) and ready to use. We'll generate Go code here, but other -[language plugins](../reference/language-support.rst) are available. You'll +[language plugins](../reference/language-support.md) are available. You'll naturally need the Go toolchain if you want to build and run a program with the code sqlc generates, but sqlc itself has no dependencies. diff --git a/docs/tutorials/getting-started-sqlite.md b/docs/tutorials/getting-started-sqlite.md index 9017dd62e4..e5b45f86f1 100644 --- a/docs/tutorials/getting-started-sqlite.md +++ b/docs/tutorials/getting-started-sqlite.md @@ -4,7 +4,7 @@ This tutorial assumes that the latest version of sqlc is [installed](../overview/install.md) and ready to use. We'll generate Go code here, but other -[language plugins](../reference/language-support.rst) are available. You'll +[language plugins](../reference/language-support.md) are available. You'll naturally need the Go toolchain if you want to build and run a program with the code sqlc generates, but sqlc itself has no dependencies.