MCPcopy
hub / github.com/sqlc-dev/sqlc

github.com/sqlc-dev/sqlc @v1.31.1 sqlite

repository ↗ · DeepWiki ↗ · release v1.31.1 ↗
18,380 symbols 32,743 edges 3,344 files 1,521 documented · 8%
README

sqlc: A SQL Compiler

go Go Report Card

sqlc generates type-safe code from SQL. Here's how it works:

  1. You write queries in SQL.
  2. You run sqlc to generate code with type-safe interfaces to those queries.
  3. You write application code that calls the generated code.

Check out an interactive example to see it in action, and the introductory blog post for the motivation behind sqlc.

Overview

Supported languages

Additional languages can be added via plugins.

Sponsors

Development is possible thanks to our sponsors. If you would like to support sqlc, please consider sponsoring on GitHub.

Riza.io

Coder.com Mint.fun Mux.com

Cyberax - NaNuNaNu - Stumble - WestfalNamur - alecthomas - cameronnewman - danielbprice - davherrmann - dvob - gilcrest - gzuidhof - jeffreylo - mmcloughlin - ryohei1216 - sgielen

Extension points exported contracts — how you extend this code

ColumnGetter (Interface)
ColumnGetter retrieves column names for a query by preparing it against a database. [6 implementers]
internal/x/expander/expander.go
Visitor (Interface)
(no doc) [7 implementers]
internal/sql/astutils/walk.go
Parser (Interface)
TODO: Rename this interface Engine [4 implementers]
internal/compiler/compile.go
Delete_stmt (Interface)
(no doc) [4 implementers]
internal/engine/sqlite/convert.go
Analyzer (Interface)
(no doc) [3 implementers]
internal/analyzer/analyzer.go
ResultProcessor (Interface)
(no doc) [2 implementers]
internal/cmd/process.go
Client (Interface)
(no doc) [1 implementers]
internal/dbmanager/client.go
Handler (Interface)
(no doc) [1 implementers]
internal/ext/handler.go

Core symbols most depended-on inside this repo

toPointer
called by 1997
internal/engine/postgresql/catalog.go
Close
called by 1411
internal/dbmanager/client.go
Scan
called by 488
internal/endtoend/testdata/enum/mysql/go/models.go
QueryContext
called by 469
examples/ondeck/sqlite/db.go
QueryRowContext
called by 384
examples/ondeck/sqlite/db.go
Query
called by 336
examples/batch/postgresql/db.go
Scan
called by 271
internal/endtoend/testdata/schema_scoped_enum/pgx/v5/go/models.go
convertSlice
called by 259
internal/engine/postgresql/convert.go

Shape

Method 11,746
Struct 3,332
Function 2,053
Interface 1,079
TypeAlias 167
FuncType 3

Languages

Go100%
Python1%

Modules by API surface

internal/engine/sqlite/parser/sqlite_parser.go3,846 symbols
internal/engine/sqlite/parser/sqliteparser_base_listener.go265 symbols
internal/engine/sqlite/parser/sqliteparser_listener.go261 symbols
internal/engine/postgresql/convert.go225 symbols
internal/plugin/codegen.pb.go169 symbols
internal/vet/vet.pb.go161 symbols
internal/vet/vet_vtproto.pb.go160 symbols
internal/engine/dolphin/convert.go145 symbols
internal/quickdb/v1/quickdb.pb.go107 symbols
internal/engine/sqlite/convert.go53 symbols
internal/endtoend/testdata/params_go_keywords/postgresql/go/query.sql.go52 symbols
internal/analysis/analysis_vtproto.pb.go52 symbols

Dependencies from manifests, versioned

cel.dev/exprv0.25.1 · 1×
filippo.io/edwards25519v1.1.1 · 1×
github.com/antlr4-go/antlr/v4v4.13.1 · 1×
github.com/coreos/go-semverv0.3.1 · 1×
github.com/cubicdaiya/gonpv1.0.4 · 1×
github.com/davecgh/go-spewv1.1.1 · 1×
github.com/fatih/structtagv1.2.0 · 1×
github.com/friendsofgo/errorsv0.9.2 · 1×
github.com/gofrs/uuidv4.0.0+incompatible · 1×
github.com/google/cel-gov0.28.0 · 1×

Datastores touched

postgresDatabase · 1 repos
(mysql)Database · 1 repos
authorsDatabase · 1 repos

For agents

$ claude mcp add sqlc \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact