push:sqlite creating weird tables
__old_push_categories
are created and are automatically refrenced from the other tables. Now when I do a normal insert, I get this error no such table: main.__old_push_categories
Using a placeholder with an inArray
.where(inArray(users.id), ['abc', 'def']))
.where(inArray(users.id), ['abc', 'def']))
DB insertion - Date field (mode: string) is using default value instead of passed value
Best practice on connections for PostgreSQL
remaining connection slots are reserved for non-replication superuser connections
...Minimum value for Postgres bigserial
id: bigserial('id', { mode: 'number', ...}).primaryKey()
...Prepend raw fields with table/subquery name in rendered SQL
"field_name"
instead of "alias"."field_name"
.
This actually causes issues when you have overlapping field names in sql in your joins.
Example:...Is there a faster way todo this?
Using one function to query many tables of same structure
How can I use a schema to generate something like this:
pgTable - raw sql
HELP: Key columns "resource_id" and "id" are of incompatible types: text and integer.
Docs unclear on connection pool vs. direct connection
Serializable isolation level - for update selects
Json object aggregate
select
s) to retrieve rows and their related translation strings. My schema has a bunch of tables like so:
```ts
export const projects = pgTable('projects', {
id: nanoid('id').default(generateNanoid()).primaryKey(),
createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),...many to many self reference
Extract a type from a table
Best practice on running migrations
await migrate(db, { migrationsFolder: "drizzle" });
await migrate(db, { migrationsFolder: "drizzle" });
Initial query after Neon's suspend_compute
I have some enum types on a schema, but I can't define it in drizzle-orm.
pgEnum
but if I use it, when creating migrations or pushing to the database it'll try to change the table column types from main.enum_name
to enum_name
which fails.
It'll be great if we had something similar to the schema.table
but for enums (schema.enum
)....Unexpected identifier 'TABLE'
drizzle-kit generate:pg
to generate this schema
```sql
CREATE TABLE IF NOT EXISTS users (
user_id INT PRIMARY KEY,
username VARCHAR(255),...