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:

258 questions
56
votes
4 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
  • 7,574
  • 4
  • 37
  • 93
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…
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
  • 10,892
  • 2
  • 31
  • 49
6
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,619
  • 4
  • 21
  • 30
6
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
  • 9,788
  • 2
  • 36
  • 58
6
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
  • 587
  • 2
  • 5
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
  • 20,778
  • 3
  • 24
  • 41
5
votes
1 answer

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…
Obi Wan - PallavJha
  • 2,591
  • 2
  • 25
  • 40
5
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
  • 10,892
  • 2
  • 31
  • 49
4
votes
1 answer

CockroachDB with node js pg driver

I am trying to connect CockroachDB and Nodes JS using the pg driver. I am able to establish a connection successfully, but every time when querying the tables: it works only when I prefix the table names with the database name, or otherwise It…
naveen
  • 452
  • 4
  • 14
4
votes
2 answers

DB Query Commands are producing strange sql queries

I have my model as: type Report struct { ID int `json:"id,omitempty" gorm:"primary_key"` Title *string `json:"title" gorm:"not null"` } I have initialized variable report as var report Report I have successfully auto migrated this…
1tree
  • 43
  • 1
  • 3
4
votes
2 answers

CockroachDB as Eventstore a good idea?

I'm looking for an EventStore for an EvenSourcing and CQRS system that i'm considering to develop in the neares future. I've startet to get familiar with CockroachDB and impressed by scalability, while having all that guaranties, that are nice for…
aholbreich
  • 4,443
  • 1
  • 20
  • 32
4
votes
1 answer

CockroachDB: select and cast byte -> string type

I've got a query storing a UUIDv4 as a byte type in CockroachDB (v1.0). Its generated with Cockroach's documented 'uuid_v4()' function. When making selections, the results will return with the byte-typed format, like…
jiveTurkey
  • 589
  • 3
  • 5
  • 16
4
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
  • 323
  • 1
  • 6
4
votes
3 answers

Return random rows from `SELECT` in CockroachDB

How can I select random rows from a SQL table using CockroachDB? For example, if I have a number of questions and I want to generate a different sequence each time a student loads them.
Loiselle
  • 452
  • 2
  • 10
1
2 3
17 18