Questions tagged [cockroachdb]

A scalable, geo-replicated, transactional SQL datastore developed in Go.

CockroachDB is a scalable, geo-replicated, transactional SQL datastore being developed in .

References:

435 questions
106
votes
6 answers

How to do bulk (multi row) inserts with JpaRepository?

When calling the saveAll method of my JpaRepository with a long List from the service layer, trace logging of Hibernate shows single SQL statements being issued per entity. Can I force it to do a bulk insert (i.e. multi-row) without needing…
Tobias Hermann
  • 9,936
  • 6
  • 61
  • 134
21
votes
4 answers

Local development with cloud-spanner

Is there any way to do local development with cloud spanner? I've taken a look through the docs and the CLI tool and there doesn't seem to be anything there. Alternatively, can someone suggest a SQL database that behaves similarly for reads (not…
10
votes
1 answer

Auto-increment support in CockroachDB

In MySQL, I can use AUTO INCREMENT to generate unique IDs for my application’s customers. How do I get similar functionality when using CockroachDB?
Alex Robinson
  • 12,633
  • 2
  • 38
  • 55
8
votes
1 answer

Does CockroachDB support full text search?

I’m building an app on CockroachDB and need to do full-text search. Does CockroachDB provide that built-in?
Peter Mattis
  • 607
  • 3
  • 7
7
votes
1 answer

CockroachDB Docker Compose Script with SQL commands

I would like to accomplish 2 things: 1) Start a CockroachDB cluster with docker compose (works) 2) Execute SQL commands on the cluster (I want to create a Database) My Docker File Looks like this: version: '3' services: roach-ui: image:…
jona jürgen
  • 1,789
  • 4
  • 22
  • 31
7
votes
1 answer

How can I connect to CockroachDB from outside the Kubernetes cluster?

I've set up and deployed a Kubernetes stateful set containing three CockroachDB pods, as per docs. My ultimate objective is to query the database without requiring use of kubectl. My intermediate objective is to query the database without actually…
Plato
  • 10,812
  • 2
  • 41
  • 61
7
votes
1 answer

How to speed up insert performance in CockroachDB

Is there a way to optimize the insertion of a lot of data into an empty CockroachDB table?
Alex Robinson
  • 12,633
  • 2
  • 38
  • 55
7
votes
1 answer

DESCRIBE TABLE equivalent in CockroachDB?

I tried using Oracle's DESCRIBE TABLE... statement in CockroachDB and got a syntax error. What’s the equivalent command?
Alex Robinson
  • 12,633
  • 2
  • 38
  • 55
6
votes
2 answers

Alternative For Stored Procedures In cockroachDB

I was trying to migrate from Another RDBMS to cockroachDB but I think there is no such functionality like stored procedures in Cockroach. So what is the best alternative to make a stored procedure in cockroachDB ?
6
votes
1 answer

Querying data in postgresql by applying filter on a JSONB column

I have a table with 2 columns; ID (int) and EntityData (JSON). I have created a filter object in form of a Dictionary in C#. I want to fetch all rows which satisfy the key-value pair data in my filter. A sample filter is: { "Name": "mike", …
Yusuff Sodiq
  • 815
  • 2
  • 12
  • 19
6
votes
1 answer

How do I change CockroachDB's default database?

When I connect to CockroachDB using cockroach sql, I have to prefix all table names with the name of the database: SELECT * FROM db.table1; If I forget to specify the database, like SELECT * FROM table1; I get the error pq: table "table1" does not…
benesch
  • 5,239
  • 1
  • 22
  • 36
6
votes
1 answer

In CockroachDB, how do batches and transactions interact?

When should I use batches and when should I use transactions? Can I embed a transaction in a batch? A batch in a transaction?
Ben Darnell
  • 21,844
  • 3
  • 29
  • 50
5
votes
2 answers

Can Go's Rows.Scan ignore fields from SQL query

The Rows.Scan method takes as many parameters as there are columns in the SQL query. As the query being executed is SHOW COLUMNS FROM my_table I cannot omit any column which I don't require (or can I?). Is there any way to ignore some fields from…
Pallav Jha
  • 3,409
  • 3
  • 29
  • 52
5
votes
1 answer

How do I run a SQL script in CockroachDB inside a Docker container?

I started a CockroachDB container with the following: docker run -d --name=node1 --hostname=node1 \ --network=db -p 26257:26257 -p 8080:8080 \ -v "${PWD}/sql:/cockroach/sql" \ -v "${PWD}/cockroach-data/node1:/cockroach/cockroach-data" \…
sargas
  • 5,820
  • 7
  • 50
  • 69
5
votes
1 answer

Return last inserted ID/SERIAL values with CockroachDB

How do I get the last ID/SERIAL value inserted into a table? Is there a CockroachDB function similar to SQL Server’s SCOPE_IDENTITY()?
jseldess
  • 373
  • 1
  • 6
1
2 3
28 29