MCPcopy Index your code
hub / github.com/cockroachdb/cockroach-gen

github.com/cockroachdb/cockroach-gen @v22.2.10

Chat with this repo
repository ↗ · DeepWiki ↗ · release v22.2.10 ↗ · + Follow
109,950 symbols 602,864 edges 7,221 files 44,053 documented · 40% updated 2y ago★ 32
What it actually does AI analysis from the code graph — generated when you open this
loading…
README


CockroachDB is a cloud-native distributed SQL database designed to build, scale, and manage modern, data-intensive applications.

What is CockroachDB?

CockroachDB is a distributed SQL database built on a transactional and strongly-consistent key-value store. It scales horizontally; survives disk, machine, rack, and even datacenter failures with minimal latency disruption and no manual intervention; supports strongly-consistent ACID transactions; and provides a familiar SQL API for structuring, manipulating, and querying data.

For more details, see our FAQ or architecture document.

Docs

For guidance on installation, development, deployment, and administration, see our User Documentation.

Starting with CockroachCloud

We can run CockroachDB for you, so you don't have to run your own cluster.

See our online documentation: Quickstart with CockroachCloud

Starting with CockroachDB

  1. Install CockroachDB: using a pre-built executable or build it from source.
  2. Start a local cluster and connect to it via the built-in SQL client.
  3. Learn more about CockroachDB SQL.
  4. Use a PostgreSQL-compatible driver or ORM to build an app with CockroachDB.
  5. Explore core features, such as data replication, automatic rebalancing, and fault tolerance and recovery.

Client Drivers

CockroachDB supports the PostgreSQL wire protocol, so you can use any available PostgreSQL client drivers to connect from various languages.

Deployment

  • CockroachCloud - Steps to create a free CockroachCloud cluster on your preferred Cloud platform.
  • Manual - Steps to deploy a CockroachDB cluster manually on multiple machines.
  • Cloud - Guides for deploying CockroachDB on various cloud platforms.
  • Orchestration - Guides for running CockroachDB with popular open-source orchestration systems.

Need Help?

Building from source

See our wiki for more details.

Contributing

We welcome your contributions! If you're looking for issues to work on, try looking at the good first issue list. We do our best to tag issues suitable for new external contributors with that label, so it's a great way to find something you can help with!

See our wiki for more details.

Engineering discussions take place on our public mailing list, cockroach-db@googlegroups.com. Also please join our Community Slack (there's a dedicated #contributors channel!) to ask questions, discuss your ideas, and connect with other contributors.

Design

For an in-depth discussion of the CockroachDB architecture, see our Architecture Guide. For the original design motivation, see our design doc.

Licensing

Current CockroachDB code is released under a combination of two licenses, the Business Source License (BSL) and the Cockroach Community License (CCL).

When contributing to a CockroachDB feature, you can find the relevant license in the comments at the top of each file.

For more information, see the Licensing FAQs.

Comparison with Other Databases

To see how key features of CockroachDB stack up against other databases, check out CockroachDB in Comparison.

See Also

Extension points exported contracts — how you extend this code

Sender (Interface)
Sender is implemented by modules throughout the crdb stack, on both the "client" and the "server", involved in passing a [66 …
pkg/kv/sender.go
EventSink (Interface)
EventSink is the interface used when emitting changefeed events and ensuring they were received. [12 implementers]
pkg/ccl/changefeedccl/sink.go
ExternalStorage (Interface)
This file is for interfaces only and should not contain any implementation code. All concrete implementations should be [8 …
pkg/cloud/external_storage.go
CommandResultErrBase (Interface)
CommandResultErrBase is the subset of CommandResult dealing with setting a query execution error. [8 implementers]
pkg/sql/conn_io.go
ClusterSettingOption (Interface)
ClusterSettingOption is the interface satisfied by options to MakeClusterSettings. [36 implementers]
pkg/roachprod/install/cluster_settings.go
Fataler (Interface)
Fataler is the subset of testing.TB relevant to this package. [23 implementers]
pkg/testutils/sqlutils/sql_runner.go
CallbackOption (Interface)
CallbackOption is a marker interface that callback options must implement. [36 implementers]
pkg/gossip/gossip.go
SimpleMVCCIterator (Interface)
SimpleMVCCIterator is an interface for iterating over key/value pairs in an engine. SimpleMVCCIterator implementations a [10 …
pkg/storage/engine.go

Core symbols most depended-on inside this repo

Get
called by 16778
pkg/sql/sem/tree/values.go
Errorf
called by 12513
pkg/testutils/tb.go
AfterTest
called by 8529
pkg/util/leaktest/leaktest.go
NullAt
called by 8419
pkg/col/coldata/nulls.go
Nulls
called by 6699
pkg/col/coldata/vec.go
Fatal
called by 6357
pkg/util/envutil/env.go
Equal
called by 4789
pkg/sql/opt/cat/zone.go
Selection
called by 4195
pkg/col/coldata/batch.go

Shape

Method 65,077
Function 30,117
Struct 10,954
Interface 1,585
TypeAlias 1,458
Class 383
FuncType 351
Enum 25

Languages

Go97%
TypeScript3%
C1%
C++1%
Ruby1%
Java1%

Modules by API surface

pkg/sql/opt/memo/expr.og.go3,692 symbols
pkg/roachpb/api.pb.go2,874 symbols
pkg/server/serverpb/status.pb.go2,577 symbols
pkg/server/serverpb/admin.pb.go1,522 symbols
pkg/jobs/jobspb/jobs.pb.go1,335 symbols
pkg/sql/catalog/descpb/structured.pb.go914 symbols
pkg/sql/colexec/colexecproj/proj_non_const_ops.eg.go830 symbols
pkg/sql/colexec/colexecprojconst/proj_const_right_ops.eg.go829 symbols
pkg/roachpb/errors.pb.go826 symbols
pkg/sql/schemachanger/scpb/elements.pb.go810 symbols
pkg/sql/sem/tree/stmt.go806 symbols
pkg/util/log/eventpb/ddl_events.pb.go785 symbols

Datastores touched

kvDatabase · 1 repos
defaultdbDatabase · 1 repos
tpchDatabase · 1 repos
postgresDatabase · 1 repos
barDatabase · 1 repos
bazDatabase · 1 repos
dbDatabase · 1 repos
defaultdb_29Database · 1 repos

For agents

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

⬇ download graph artifact

Ask about this repo answers extend the page