new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Drizzle ORM · all subjects

cockroach/sequences

4 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Sequences in CockroachDB

Sequences in CockroachDB are special single-row tables created to generate unique identifiers, often used for auto-incrementing primary key values. They provide a thread-safe way to generate unique sequential values across multiple sessions.

cockroachSequence function basic usage

The cockroachSequence function is imported from 'drizzle-orm/cockroach-core'. It can be called with just a name parameter to create a sequence with no additional configuration: export const customSequence = cockroachSequence('name');

cockroachSequence parameters

The cockroachSequence function accepts an optional configuration object with the following parameters: startWith (starting value), maxValue (maximum value), minValue (minimum value), cache (number of values to cache), and increment (increment step between values). Example: export const customSequence = cockroachSequence('name', { startWith: 100, maxValue: 10000, minValue: 100, cache: 10, increment: 2 });

Sequences in custom CockroachDB schema

To create a sequence in a custom schema, first create a custom schema using cockroachSchema, then call the sequence method on it. Example: export const customSchema = cockroachSchema('custom_schema'); export const customSequence = customSchema.sequence('name');

Give your agent this brain